Features/#171 update integration of edisgo overlying grid#179
Open
joda9 wants to merge 14 commits into
Open
Conversation
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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Switch eDisGo integration to new
edisgo.runrunner and decouple from eTraGo. eGo can now run eDisGo-only (overlying grid loaded from CSV instead of eTraGo disaggregation). Legacy inline 5-taskrun_edisgoreplaced byedisgo.run.run_edisgo(cfg, overlying_grid_data=…)per grid, driven by a preset config.Closes #171.
Changes
tools/edisgo_integration.pyEDisGoNetworks.__init__:etrago_networkoptional (None→ eDisGo-only).eTraGoblock;extendableaccepts list or dict (eTraGo 0.10+).eDisGo.presetandeDisGo.overlying_grid_source("etrago"or path)._build_run_edisgo_config()builds runner config viaextends: <preset>+ per-grid overrides._run_one_grid_via_runner()callsedisgo.run.run_edisgo, optionally withoverlying_grid_datafrom eTraGo._load_edisgo_resultsimports from<grid>/main.zip.tools/io.py: passesetrago_network=Nonewhen no eTraGo; guards_total_inv_costagainstetrago is None; same list/dictextendablehandling.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.scenario_setting_uc4_example_MS.json,scenario_setting_etrago_files_and_edisgo.json.Breaking changes
run_edisgo()withouteDisGo.preset→NotImplementedError.csv_importlayout:<csv_import>/<mv_grid_id>/main.zip(was folder).