flexmeasures.data.schemas.forecasting.pipeline
Classes
- class flexmeasures.data.schemas.forecasting.pipeline.AnnotationRegressorSchema(*, only: Sequence[str] | AbstractSet[str] | None = None, exclude: Sequence[str] | AbstractSet[str] = (), many: bool | None = None, load_only: Sequence[str] | AbstractSet[str] = (), dump_only: Sequence[str] | AbstractSet[str] = (), partial: bool | Sequence[str] | AbstractSet[str] | None = None, unknown: Literal['exclude', 'include', 'raise'] | None = None)
Schema for a single annotation regressor in the forecasting pipeline config.
- remove_none_values(data, **kwargs)
Omit null fields from the serialised config to keep it clean.
- skip_empty_sources(data, **kwargs)
Omit empty sources before custom ID fields serialise objects.
- class flexmeasures.data.schemas.forecasting.pipeline.ForecasterParametersSchema(*, only: Sequence[str] | AbstractSet[str] | None = None, exclude: Sequence[str] | AbstractSet[str] = (), many: bool | None = None, load_only: Sequence[str] | AbstractSet[str] = (), dump_only: Sequence[str] | AbstractSet[str] = (), partial: bool | Sequence[str] | AbstractSet[str] | None = None, unknown: Literal['exclude', 'include', 'raise'] | None = None)
NB cli-exclusive fields are not exposed via the API (removed by make_openapi_compatible).
- resolve_config(data: dict, original_data: dict | None = None, **kwargs) dict
Resolve timing parameters, using sensible defaults and choices.
Defaults: 1. predict-period defaults to minimum of (FM planning horizon and max-forecast-horizon) only if there is a single default viewpoint. 2. max-forecast-horizon defaults to the predict-period 3. forecast-frequency defaults to minimum of (FM planning horizon, predict-period, max-forecast-horizon)
Choices: 1. If max-forecast-horizon < predict-period, we raise a ValidationError due to incomplete coverage 2. retraining-frequency becomes the maximum of (FM planning horizon and forecast-frequency, this is capped by the predict-period.
- class flexmeasures.data.schemas.forecasting.pipeline.ForecastingTriggerSchema(*, only: Sequence[str] | AbstractSet[str] | None = None, exclude: Sequence[str] | AbstractSet[str] = (), many: bool | None = None, load_only: Sequence[str] | AbstractSet[str] = (), dump_only: Sequence[str] | AbstractSet[str] = (), partial: bool | Sequence[str] | AbstractSet[str] | None = None, unknown: Literal['exclude', 'include', 'raise'] | None = None)
- class flexmeasures.data.schemas.forecasting.pipeline.TrainPredictPipelineConfigSchema(*, only: Sequence[str] | AbstractSet[str] | None = None, exclude: Sequence[str] | AbstractSet[str] = (), many: bool | None = None, load_only: Sequence[str] | AbstractSet[str] = (), dump_only: Sequence[str] | AbstractSet[str] = (), partial: bool | Sequence[str] | AbstractSet[str] | None = None, unknown: Literal['exclude', 'include', 'raise'] | None = None)
-
- fold_in_max_training_period(data, **kwargs)
Read the deprecated max-training-period as the train-period it always was.
Both said how far back training may reach, so a config carrying both asks twice, and the shorter of the two is all that either of them allows. Folding it in here keeps configs written before the two were merged working, without keeping the merged name in the schema.