opticks.utils.parser_helpers
Package for Pydantic and YAML helpers.
Module Attributes
Annotated Quantity type for use in Pydantic models. |
|
Annotated Quantity type for use in Pydantic models, restricted to positive values. |
Functions
|
Checks whether the quantity_text can be parsed as a valid Quantity object. |
- PositivePydanticQty
Annotated Quantity type for use in Pydantic models, restricted to positive values.
alias of
Annotated[Quantity,BeforeValidator(func=_parse_quantity, json_schema_input_type=PydanticUndefined),AfterValidator(func=_validate_positive_quantity),PlainSerializer(func=_serialize_quantity, return_type=str, when_used=always)]
- PydanticQty
Annotated Quantity type for use in Pydantic models.
Parses strings like ‘12905 mm’ into astropy Quantity objects, and serializes them back to strings.
alias of
Annotated[Quantity,BeforeValidator(func=_parse_quantity, json_schema_input_type=PydanticUndefined),PlainSerializer(func=_serialize_quantity, return_type=str, when_used=always)]