TargetMetadata#

class openstef_beam.analysis.models.target_metadata.TargetMetadata(**data: Any) None[source]

Bases: BaseModel

Metadata for a forecasting target in the analysis pipeline.

Contains essential information about a target including its grouping context and lead time filtering criteria. Lead time filtering determines which predictions are included based on how far ahead they were made (e.g., 1-hour ahead vs 24-hour ahead forecasts).

Raises:

ValueError – When limit constraints are not met (either ‘limit’ alone or both ‘upper_limit’ and ‘lower_limit’ must be specified).

Parameters:

data (Any)

name: TypeAliasType
group_name: TypeAliasType
filtering: TypeAliasType | None
limit: float | None
upper_limit: float | None
lower_limit: float | None
run_name: TypeAliasType
validate_limits() TargetMetadata[source]

Validate that either limit or both upper_limit and lower_limit are provided.

Return type:

TargetMetadata

Returns:

The validated TargetMetadata instance.

Raises:

ValueError – If neither limit nor (upper_limit and lower_limit) are provided, or if both limit and (upper_limit or lower_limit) are provided.

with_filtering(filtering: Filtering) Self[source]

Returns a copy of the target metadata with different lead time filtering applied.

Parameters:
  • filtering (TypeAliasType) – New lead time filtering criteria to apply

  • filtering

Returns:

New TargetMetadata instance with updated lead time filtering

Return type:

Self

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'protected_namespaces': (), 'ser_json_inf_nan': 'null'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].