`make_global_summaries` not compatible with scenario management
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 615
- Forks
- 459
- Avg merge
- 4d 14h
- Merged PRs (30d)
- 6
Description
Version Checks (indicate both or one)
-
I have confirmed this bug exists on the lastest release of PyPSA-Eur.
-
I have confirmed this bug exists on the current
masterbranch of PyPSA-Eur.
Issue Description
Potentially related #2100 .
In the lines here the input files are manually constructed instead of relying on snakemake.input. This can lead to an inconsistency, if e.g. planning_horizon is overwritten in a scenario to a value that is not in the config:
https://github.com/PyPSA/pypsa-eur/blob/master/scripts/make_global_summary.py#L46-L54
e.g. config defines planning_horizon: [2030] but scenario defines planning_horizon: [2040]. In that case the snakemake workflow will produce 2030 for the files (incorrect), but the script is looking for 2040 (correct).
As far as I can tell the problem lies with using config here directly, instead of the overwritten config:
https://github.com/PyPSA/pypsa-eur/blob/master/rules/postprocess.smk#L307
Reproducible Example
-
Expected Behavior
Installed Versions
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with scripts/make_global_summary.py lines 46-54 and rules/postprocess.smk around line 307, comparing the manually constructed paths with snakemake.input and the overwritten scenario configuration. Reproduce the case where planning_horizon changes from 2030 to 2040 and verify that the workflow and summary script use the same files.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100