Produces a single float32 column energy_saving_window whose value is 1.0 during the two regulatory energy-saving periods in force during the 2022–2023 European energy crisis and 0.0 otherwise.
The two bundled windows are:
EnSikuMaV (Kurzfristenergieversorgungssicherungsmaßnahmenverordnung): in force 2022-09-01 00:00 CEST through 2023-04-15 23:00 CEST, including the February 2023 extension.
EU Council Regulation 2022/1854: mandatory −5 % peak-hour consumption reduction 2022-12-01 00:00 CET through 2023-03-31 23:00 CEST.
The intensity values are 1.0 for both rows; overlapping hours (December 2022 through March 2023) therefore also yield 1.0.
Accepted for provider-factory API uniformity; has no effect.
None
Notes
An open-ended Ukraine-invasion step dummy (2022-02-24 onward) was considered and rejected: the load effect is gradual and non-permanent, and in recent training windows the signal would be near-constant and uninformative to tree-based models. The include_entsoe_day_ahead_price flag already captures the energy-price channel that the invasion primarily affected.
Examples
import pandas as pdfrom spotforecast2_safe.preprocessing.exog_providers import ( EnergyCrisisWindowProvider,)# Window is active: 2022-10-01 is inside ENSIKUMAV_DEidx_in = pd.date_range("2022-10-01", periods=24, freq="h", tz="UTC")out_in = EnergyCrisisWindowProvider().build(idx_in)print(out_in.columns.tolist(), out_in.shape)assert (out_in["energy_saving_window"] ==1.0).all()# Window is inactive: 2022-07-01 predates both regulatory periodsidx_out = pd.date_range("2022-07-01", periods=24, freq="h", tz="UTC")out_out = EnergyCrisisWindowProvider().build(idx_out)assert (out_out["energy_saving_window"] ==0.0).all()