veriflow.configuration.base#

The base configuration definitions for the veriflow pipeline.

Classes

GeneralInfoConfig(*, verification_period, ...)

General configuration information that is shared across the pipeline.

IdMappingConfig(*[, variable, station])

Config for mapping external ids to their internal definition.

class veriflow.configuration.base.GeneralInfoConfig(*, verification_period, verification_pairs, lead_times=None, cache_dir='.verification_cache')[source]#

General configuration information that is shared across the pipeline.

Parameters:
verification_period: Annotated[VerificationPeriod, FieldInfo(annotation=NoneType, required=True, description='The start and end of the verification period.')]#
verification_pairs: Annotated[list[VerificationPair], FieldInfo(annotation=NoneType, required=True, description='Specify pairs for computation of verification metrics. This allows you to verify multiple variables and multiple sources. For example, by specifying two pairs: verify simulated discharge for ModelA and ModelB against observed discharge fromsource Observed.')]#
lead_times: Annotated[LeadTimes | None, FieldInfo(annotation=NoneType, required=False, default='A set of lead times for which to evaluate of the verification scores. A lead time is the timedelta between the forecast reference time of a forecast (t0, analysis_time, initialization time) and the valid time (time, observed time) and is also known as: lead time or forecast horizon)')]#
cache_dir: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Path pointing to a cache directory. ', "Will be automatically created if it doesn't yet exist.")]#
get_verification_pair(pair_id)[source]#

Get one verification_pair by its id.

Parameters:

pair_id (str)

Return type:

VerificationPair

property verification_period_on_time: TimePeriod#

The verification period along the time dimension.

property verification_period_on_frt: TimePeriod#

The verification period along the forecast reference time dimension.

verification_period_and_lead_times_consistent()[source]#

Check that the verification period and lead times are consistent.

Return type:

Self

class veriflow.configuration.base.IdMappingConfig(*, variable=None, station=None)[source]#

Config for mapping external ids to their internal definition.

Parameters:
  • variable (IdMap | None)

  • station (IdMap | None)

variable: Annotated[IdMap | None, FieldInfo(annotation=NoneType, required=True, description='Mapping of internal to external definitions per source as a dictionary. The key corresponds to the internal definition and the value is another dictionary with keys corresponding to the source and the value to the external definition. ')]#
station: Annotated[IdMap | None, FieldInfo(annotation=NoneType, required=True, description='Mapping of internal to external definitions per source as a dictionary. The key corresponds to the internal definition and the value is another dictionary with keys corresponding to the source and the value to the external definition. ')]#
rename_dataset(dataset)[source]#

Apply the configured id mapping to a dataset.

Variable names (data variable names) and station identifiers are renamed from the external (source-specific) definition to the internal definition.

Parameters:

dataset (Dataset)

Return type:

Dataset