ska_ost_senscalc.low.validation
This module provides semantic validation for inputs to the Sensitivity Calculator, including checking for required values, setting default values, and domain related checks.
Syntactic validation and basic validation, for example of min/max values of numbers, is done by Connexion and the OpenAPI spec.
- class ska_ost_senscalc.low.validation.EnumConversion[source]
Utility class to convert OpenAPI enumeration members to Python Enum members.
OpenAPI enums generally map to Python enums but their name will usually be formatted differently, as the Python convention is for enumeration member names to be all upper case. This class decouples the OpenAPI naming convention from that all-caps requirement.
- ska_ost_senscalc.low.validation.validate_and_set_defaults_for_continuum(user_input: dict) dict [source]
- Parameters:
user_input – the parameters from the HTTP request for the /api/low/continuum/calculate request
- Returns:
A new copy of the input dict, with defaults set for missing values
- Raises:
ValueError if the input data is not valid
- ska_ost_senscalc.low.validation.validate_and_set_defaults_for_pss(user_input: dict) dict [source]
- Parameters:
user_input – the parameters from the HTTP request for the /api/low/pss/calculate request
- Returns:
A new copy of the input dict, with defaults set for missing values
- Raises:
ValueError if the input data is not valid
- ska_ost_senscalc.low.validation.validate_and_set_defaults_for_zoom(user_input: dict) dict [source]
- Parameters:
user_input – the parameters from the HTTP request for the /api/low/zoom/calculate request
- Returns:
A new copy of the input dict, with defaults set for missing values
- Raises:
ValueError if the input data is not valid
- ska_ost_senscalc.low.validation.validate_weighting_params(*, spectral_mode: str, freq_centre: float | int, pointing_centre: str, subarray_configuration: str, weighting_mode: str, robustness: int | None) WeightingInput [source]
Validate arguments for a LOW weighting query, returning a typed encapsulation of those arguments.