time_field

Contents

time_field#

tollan.config.types.time_field(formats_allowed: str | Sequence[str] | None = None) type[Time][source]#

Create a pydantic field type for validating astropy Time.

Parameters:

formats_allowed (None | str | Sequence[str], optional) – Allowed time formats

Returns:

Pydantic-compatible time field

Return type:

Annotated[Time, TimeValidator]

Examples

>>> UnixTime = time_field(formats_allowed=['unix', 'unix_tai'])