Skip to content

Temporal complexity reduction: inject timestep selection into per-grid eDisGo runs#193

Open
MoritzSchloesser wants to merge 3 commits into
devfrom
189-temporal-complexity-reduction
Open

Temporal complexity reduction: inject timestep selection into per-grid eDisGo runs#193
MoritzSchloesser wants to merge 3 commits into
devfrom
189-temporal-complexity-reduction

Conversation

@MoritzSchloesser

@MoritzSchloesser MoritzSchloesser commented Jul 8, 2026

Copy link
Copy Markdown

What

Partial solution to #189 — the temporal complexity reduction only
(spatial reduction remains open in that issue).

Wires the eDisGo run pipeline's configurable timestep selection
(openego/eDisGo#663) through to eGo's per-grid runner.
EDisGoNetworks._build_run_edisgo_config now injects a top-level
timeseries_selection block into each grid's runner config, mirroring the
existing overlying_grid injection. The block resolves per grid from the
scenario setting:

  • eDisGo.timeseries_selection — a default applied to every grid.
  • eDisGo.timeseries_selection_per_grid — optional per-grid overrides,
    keyed by MV grid id (string). A grid's entry fully replaces the default.

If neither is present, no block is injected and eDisGo keeps its full-year
behaviour, so the change is backward compatible.

Why

Full-year optimization/reinforcement over every MVLV grid is prohibitively
expensive for the eGo milestone. This lets a run reduce each grid to a few
critical time intervals (auto power_flow / residual_load) or pin
specific grids to a manual time series — mixing both in one run.

Example

scenario_setting_uc5_example.json (added) shows the feature: a
residual_load auto default for all grids plus a manual 24-step override
for grid 32355.

Scope / follow-up

Testing

  • Config injection verified against the uc5 scenario (default vs per-grid
    override resolution).
  • Backward compatibility: scenarios without a timeseries_selection block
    produce an unchanged runner config.

Part of #189.

Moritz Schloesser and others added 2 commits July 8, 2026 14:01
Wire the eDisGo run pipeline's configurable timestep selection
(openego/eDisGo#663) through to eGo's per-grid runner.

`_build_run_edisgo_config` now injects a top-level
`timeseries_selection` block into each grid's runner config, mirroring
the existing `overlying_grid` injection. The block is read from the
scenario setting's `eDisGo.timeseries_selection` (a default applied to
every grid) with an optional per-grid override from
`eDisGo.timeseries_selection_per_grid`, keyed by MV grid id. This lets a
run use auto (power_flow / residual_load) selection by default while
pinning specific grids to a manual time series.

Add `scenario_setting_uc5_example.json` demonstrating the feature: a
residual_load auto default plus a manual per-grid override for grid
32355.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@ClaraBuettner

ClaraBuettner commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

EDIT: Problem fixed (see comment below)

When I try to run it I run into:

INFO:edisgo.run:  -> task 'import_overlying_grid_data'
WARNING:edisgo.run:task 'import_overlying_grid_data': source='etrago' but no overlying_grid_data passed to run_edisgo — skipping.
INFO:edisgo.run:  -> task 'select_timesteps'
ERROR:ego.tools.edisgo_integration:MV grid 32377 failed: 
Traceback (most recent call last):
  File "/home/clara/ego/eGo/ego/tools/edisgo_integration.py", line 621, in _run_edisgo_pool
    edisgo_grid = self.run_edisgo(mv_grid_id)
  File "/home/clara/ego/eGo/ego/tools/edisgo_integration.py", line 747, in run_edisgo
    return self._run_one_grid_via_runner(mv_grid_id)
  File "/home/clara/ego/eGo/ego/tools/edisgo_integration.py", line 723, in _run_one_grid_via_runner
    edisgo_grid = edisgo_runner(cfg,overlying_grid_data=overlying_grid_data)
  File "/home/clara/ego/eDisGo/edisgo/run/runner.py", line 80, in run_edisgo
    return _run_pipeline_on(
  File "/home/clara/ego/eDisGo/edisgo/run/runner.py", line 144, in _run_pipeline_on
    result = task_fn(edisgo, ctx, **step_params)
  File "/home/clara/ego/eDisGo/edisgo/run/tasks/timeseries.py", line 535, in task_select_timesteps
    raise ValueError(
ValueError: select_timesteps method 'residual_load' needs overlying-grid data to be present (run import_overlying_grid_data before it).

I use the following settings in eGo:

  "eDisGo": {
    "preset": "uc5_select_timesteps",
    "grid_path": "/home/clara/edisgo/grids",
    "overlying_grid": true,
    "overlying_grid_source": "etrago",
    "legacy_ding0_grids": false,
    "choice_mode": "manual",
    "cluster_attributes": [],
    "only_cluster": false,
    "manual_grids": [32377, 32355],
    "n_clusters": 1,
    "parallelization": false,
    "max_calc_time": 1.0,
    "max_workers": 1,
    "max_cos_phi_renewable": 0.9,

    "results": "ego_tests_temporal_complexity",
    "solver": "gurobi",
    "gridversion": null,

Since I don't have the overlying grid data as files, I use "etrago" as the overlying_grid_source and a path to the etrago files. Before, these settings worked fine. Do you have any idea what might have changed?

@ClaraBuettner

Copy link
Copy Markdown
Contributor

Sorry, I found the reason for the problem in my config file. It is a bit misleading that you have to do some settings twice. It seems to be working now. I will do some additional tests

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.

Integrate temporal and spatial complexity reduction of MVLV-grids

2 participants