Skip to content

feat: configurable timestep selection for the run pipeline (#663)#692

Merged
joda9 merged 2 commits into
edisgo_run_edisgofrom
663_timeseries_selection
Jul 8, 2026
Merged

feat: configurable timestep selection for the run pipeline (#663)#692
joda9 merged 2 commits into
edisgo_run_edisgofrom
663_timeseries_selection

Conversation

@joda9

@joda9 joda9 commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

Add a select_timesteps pipeline task that reduces the analysed time index to a selected subset, in two modes:

  • manual: an explicit set/range of timesteps (positioned before the imports so egon_data downloads are restricted to the selected steps);
  • auto: the most critical time intervals, via either a power flow (get_most_critical_time_intervals(by="power_flow")) or the residual load (by="residual_load", no power flow — intervals centered on the highest/lowest residual-load steps, snapped to time_step_day_start).

Auto selection may yield two disconnected intervals. pm_optimize now detects a non-contiguous time index and runs a separate, independent OPF per contiguous interval (storage/heat state does not carry across the gap), merging the per-interval results and reporting per-interval solve status. reinforce handles the reduced index unchanged.

Architecture: pipeline tasks stay thin (mode selection + data transfer); the computation lives in edisgo core:

  • selection logic in tools.temporal_complexity_reduction (get_most_critical_time_steps/_intervals gain a by mode; public select_two_intervals/intervals_overlap);
  • the multi-interval OPF split/merge in opf.powermodels_opf.pm_optimize.

Also:

  • EV flexibility bands built in a dedicated build_flexibility_bands task and aligned (year + frequency) to the analysis index in reduce_timeseries_data_to_given_timeindex;
  • OPFResults.interval_results for the per-interval solve report;
  • config surface: a top-level timeseries_selection block + uc5_select_timesteps preset + run_example_05.py;
  • tests in tests/run, tests/tools, tests/opf.

Description

Please include a summary of the change and which issue is fixed.

Fixes # (issue)

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • New and adjusted code is formatted using the pre-commit hooks
  • New and adjusted code includes type hinting now
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • The Read the Docs documentation is compiling correctly
  • If new packages are needed, I added them the setup.py, and if needed the rtd_requirements.txt, the eDisGo_env.yml and the eDisGo_env_dev.yml.
  • I have added new features to the corresponding whatsnew file

Moritz Schloesser and others added 2 commits July 8, 2026 11:59
Add a `select_timesteps` pipeline task that reduces the analysed time
index to a selected subset, in two modes:

- manual: an explicit set/range of timesteps (positioned before the
  imports so egon_data downloads are restricted to the selected steps);
- auto: the most critical time intervals, via either a power flow
  (`get_most_critical_time_intervals(by="power_flow")`) or the residual
  load (`by="residual_load"`, no power flow — intervals centered on the
  highest/lowest residual-load steps, snapped to `time_step_day_start`).

Auto selection may yield two disconnected intervals. `pm_optimize` now
detects a non-contiguous time index and runs a separate, independent OPF
per contiguous interval (storage/heat state does not carry across the
gap), merging the per-interval results and reporting per-interval solve
status. `reinforce` handles the reduced index unchanged.

Architecture: pipeline tasks stay thin (mode selection + data transfer);
the computation lives in edisgo core:
- selection logic in tools.temporal_complexity_reduction
  (`get_most_critical_time_steps`/`_intervals` gain a `by` mode; public
  `select_two_intervals`/`intervals_overlap`);
- the multi-interval OPF split/merge in opf.powermodels_opf.pm_optimize.

Also:
- EV flexibility bands built in a dedicated `build_flexibility_bands`
  task and aligned (year + frequency) to the analysis index in
  `reduce_timeseries_data_to_given_timeindex`;
- `OPFResults.interval_results` for the per-interval solve report;
- config surface: a top-level `timeseries_selection` block +
  `uc5_select_timesteps` preset + `run_example_05.py`;
- tests in tests/run, tests/tools, tests/opf.
@joda9 joda9 merged commit 80a24e2 into edisgo_run_edisgo Jul 8, 2026
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant