Skip to content

Features/#171 update integration of edisgo overlying grid#179

Open
joda9 wants to merge 14 commits into
devfrom
features/#171-update-integration-of-edisgo-overlying-grid
Open

Features/#171 update integration of edisgo overlying grid#179
joda9 wants to merge 14 commits into
devfrom
features/#171-update-integration-of-edisgo-overlying-grid

Conversation

@joda9
Copy link
Copy Markdown

@joda9 joda9 commented May 21, 2026

Summary

Switch eDisGo integration to new edisgo.run runner and decouple from eTraGo. eGo can now run eDisGo-only (overlying grid loaded from CSV instead of eTraGo disaggregation). Legacy inline 5-task run_edisgo replaced by edisgo.run.run_edisgo(cfg, overlying_grid_data=…) per grid, driven by a preset config.

Closes #171.

Changes

  • tools/edisgo_integration.py
    • EDisGoNetworks.__init__: etrago_network optional (None → eDisGo-only).
    • Tolerates missing/empty eTraGo block; extendable accepts list or dict (eTraGo 0.10+).
    • New config fields eDisGo.preset and eDisGo.overlying_grid_source ("etrago" or path).
    • _build_run_edisgo_config() builds runner config via extends: <preset> + per-grid overrides.
    • _run_one_grid_via_runner() calls edisgo.run.run_edisgo, optionally with overlying_grid_data from eTraGo.
    • Legacy inline tasks 1–5 removed.
    • _load_edisgo_results imports from <grid>/main.zip.
  • tools/io.py: passes etrago_network=None when no eTraGo; guards _total_inv_cost against etrago is None; same list/dict extendable handling.
  • tools/utilities.py: drops hard "eDisGo requires eTraGo" check.
  • tools/economics.py: eDisGo-only path no longer crashes on missing eTraGo costs.
  • appl.py: default JSON → scenario_setting_etrago_files_and_edisgo.json.
  • New scenario settings: scenario_setting_uc4_example_MS.json, scenario_setting_etrago_files_and_edisgo.json.

Breaking changes

  • run_edisgo() without eDisGo.presetNotImplementedError.
  • csv_import layout: <csv_import>/<mv_grid_id>/main.zip (was folder).

Jonas Danke and others added 14 commits April 20, 2026 11:51
Drop the validation that aborted eGo whenever eDisGo was enabled
without eTraGo. This unblocks the eDisGo-only workflow.
Make the eGo / eDisGoResults pipeline tolerate self.etrago is None:
- import etrago.tools.io.load_config_file optionally
- only build etrago_network when self.etrago is not None
- accept extendable as either a list or a dict with
  extendable_components
- guard grid_investment_costs and storage_investment_costs
  accesses behind self.etrago is not None
- compute overnight_costs only when end_snapshot is set,
  otherwise leave it as None
- skip storage_mv_integration without an eTraGo run
Allow EDisGoNetworks to be constructed without an eTraGo network so
the eDisGo-only workflow can run. The reduced eTraGo wrapper is only
built when an etrago_network is provided, and missing eTraGo keys in
the scenario settings (scn_name, extendable, pf_post_lopf) fall back
to defensive defaults.
When eDisGo.preset is set in the scenario settings, EDisGoNetworks
forwards the per-grid run to edisgo.run.run_edisgo, passing a config
that extends the named preset and overrides grid_path, results dir,
scenario and database/ssh blocks. The legacy code path (without
preset) is unchanged and still drives the eTraGo-coupled tasks.
The file is not created automatically and therefore missing otherwise
_run_one_grid_via_runner now derives overlying_grid_data from the
eTraGo result bus when configured, and injects overlying_grid.path
into the runner config when overlying_grid_source points at a CSV
directory. The result is passed through edisgo.run.run_edisgo's
new overlying_grid_data kwarg.

run_edisgo() is replaced with a thin wrapper that delegates to
_run_one_grid_via_runner when a preset is set; the inlined legacy
task workflow is removed (presets cover it).

Switches appl.py to the new scenario_setting_etrago_files_and_edisgo
config; removes the unused UC1/UC2/R4MU scenario JSONs.
economics.py:
- Use value.results instead of value.network.results (eDisGo API).
- Skip grids with empty grid_expansion_costs instead of crashing.
- Replace deprecated DataFrame.append with pd.concat.

edisgo_integration.py:
- Skip edisgo_grid_investment when no eTraGo snapshots are configured.
  The annuity scaling requires eTraGo's snapshot subset and would
  otherwise raise KeyError on start_snapshot/end_snapshot in
  eDisGo-only mode. Guard both csv_import and normal paths.
- _build_run_edisgo_config: differentiate overlying_grid_source values.
  "etrago" passes data via runner arg (no cfg block), a path is
  forwarded as overlying_grid.path, and a missing source now sets
  overlying_grid: null to override placeholder paths baked into the
  preset (avoids FileNotFoundError on /path/to/overlying_grid_csv_dir).
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.

Update integration of eDisGo

2 participants