veriflow.configuration.utils#
A module for frequently used config elements in the context of verification.
Classes
|
A lead times config element. |
|
Configuration pointing to a local file. |
|
Config for multiple local files using pathlib.Path.glob. |
|
A range. |
|
A time period config element. |
|
Configuration for a verification pair. |
|
Definition of the verification period. |
- class veriflow.configuration.utils.LeadTimes(*, unit, values)[source]#
A lead times config element.
- Parameters:
unit (TimeUnits)
values (Annotated[list[int] | Range, BeforeValidator(func=~veriflow.configuration.utils.LeadTimes.<lambda>, json_schema_input_type=PydanticUndefined)])
- values: <lambda>, json_schema_input_type=PydanticUndefined)]#
- class veriflow.configuration.utils.LocalFile(*, directory, filename)[source]#
Configuration pointing to a local file.
- class veriflow.configuration.utils.LocalFiles(*, directory, filename_glob)[source]#
Config for multiple local files using pathlib.Path.glob.
- class veriflow.configuration.utils.TimePeriod(*, start, end)[source]#
A time period config element.
- start: Annotated[datetime, FieldInfo(annotation=NoneType, required=True, description='YYYY-MM-DD[T]HH:MM[:SS[.ffffff]][Z or [±]HH[:]MM], see: https://docs.pydantic.dev/2.0/usage/types/datetime/#validation-of-datetime-types')]#
- end: Annotated[datetime, FieldInfo(annotation=NoneType, required=True, description='YYYY-MM-DD[T]HH:MM[:SS[.ffffff]][Z or [±]HH[:]MM], see: https://docs.pydantic.dev/2.0/usage/types/datetime/#validation-of-datetime-types')]#
- classmethod to_utc_naive_numpy_datetime(v)[source]#
Convert timezone aware datetimes to naive UTC; leave naive untouched (assumed UTC).
- property start_datetime64: datetime64#
Get start as numpy format.
- property end_datetime64: datetime64#
Get start as numpy format.
- class veriflow.configuration.utils.VerificationPair(*, id, obs, sim, variable)[source]#
Configuration for a verification pair.
Should consist of an id and reference to a source for observations and simulations. The id can be any arbitrary string, and the obs and sim fields should contain an exact reference to a configured source in the datasource configuration. The variable field selects which physical variable from each source’s dataset to verify; after id mapping the same internal variable name must exist as a data variable on both the observation and simulation source.
- Parameters:
id (str)
obs (Annotated[str, StringConstraints(strip_whitespace=None, to_upper=None, to_lower=None, strict=None, min_length=1, max_length=None, pattern=^[A-Za-z][A-Za-z0-9_]*$, ascii_only=None), MinLen(min_length=1)])
sim (Annotated[str, StringConstraints(strip_whitespace=None, to_upper=None, to_lower=None, strict=None, min_length=1, max_length=None, pattern=^[A-Za-z][A-Za-z0-9_]*$, ascii_only=None), MinLen(min_length=1)])
- obs: ", metadata=[MinLen(min_length=1)])]#
- sim: ", metadata=[MinLen(min_length=1)])]#
- variable: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='The variable name references a physical variable to be verified. Must match the variable definition in the datasource. IdMapping can be set in the general config, to map external variables to an internal definition. This is needed when you want to verify data from different sources, where the variable definition is not equal.', metadata=[MinLen(min_length=1)])]#
- class veriflow.configuration.utils.VerificationPeriod(*, start, end, dimension='forecast_reference_time')[source]#
Definition of the verification period.
- dimension: Annotated[Literal['forecast_reference_time', 'time'], FieldInfo(annotation=NoneType, required=True, description="The dimension along which the verification period is defined. Using 'forecast_reference_time' allows for a forecast-centric verification run, whereas 'time' allows for an observation-centric verification run.")]#