ConstantComponentSplitter#

class openstef_models.models.component_splitting.constant_component_splitter.ConstantComponentSplitter(config: ConstantComponentSplitterConfig)[source]

Bases: ComponentSplitter

Constant ratio-based component splitter for energy data.

Splits energy time series into predefined components using fixed ratios. Useful as a baseline splitter when users know the energy distribution or need a simple reference implementation.

The splitter applies constant multiplication factors to the source data based on predefined component ratios. No training is required since ratios are user-specified. Performance depends entirely on the accuracy of the provided ratios.

Example

Basic usage with known solar/wind distribution

>>> from openstef_core.types import EnergyComponentType
>>> config = ConstantComponentSplitterConfig(
...     source_column="total_load",
...     components=[EnergyComponentType.SOLAR, EnergyComponentType.WIND],
...     component_ratios={
...         EnergyComponentType.SOLAR: 0.6,
...         EnergyComponentType.WIND: 0.4
...     }
... )
>>> splitter = ConstantComponentSplitter(config)
>>> components = splitter.predict(time_series_data)

Using predefined configurations

>>> solar_splitter = ConstantComponentSplitter.known_solar_park()
>>> wind_splitter = ConstantComponentSplitter.known_wind_farm()
Parameters:

config (ConstantComponentSplitterConfig)

__init__(config: ConstantComponentSplitterConfig) → None[source]

Initialize the constant component splitter.

Parameters:

config (ConstantComponentSplitterConfig) – Configuration with component ratios and source column.

property config: ConstantComponentSplitterConfig

Get the splitter configuration.

Returns:

Current configuration with component ratios and settings.

Overrides:

ComponentSplitter.config

property is_fitted: bool

Check if the predictor has been fitted.

Overrides:

Predictor.is_fitted

fit(data: TimeSeriesDataset, data_val: TimeSeriesDataset | None = None) → None[source]

Fit the predictor to the input data.

This method should be called before generating predictions. It allows the predictor to learn parameters from the training data.

Parameters:
Return type:

None

Overrides:

Predictor.fit

predict(data: TimeSeriesDataset) → EnergyComponentDataset[source]

Generate predictions for the input data.

This method should use the fitted parameters to generate predictions.

Parameters:

data (TimeSeriesDataset) – The input data to generate predictions for.

Return type:

EnergyComponentDataset

Returns:

Predictions for the input data.

Raises:

NotFittedError – If the predictor has not been fitted yet.

Overrides:

Predictor.predict

classmethod known_solar_park() → Self[source]

Create a ConstantComponentSplitter with typical ratios for a solar park.

Return type:

Self

Returns:

Configured ConstantComponentSplitter instance.

classmethod known_wind_farm() → Self[source]

Create a ConstantComponentSplitter with typical ratios for a wind farm.

Return type:

Self

Returns:

Configured ConstantComponentSplitter instance.