Skip to content

Check if scenario file exists before attempting to load#993

Merged
FabianHofmann merged 1 commit intoPyPSA:masterfrom
koen-vg:check-scenario-file-exists
Mar 26, 2024
Merged

Check if scenario file exists before attempting to load#993
FabianHofmann merged 1 commit intoPyPSA:masterfrom
koen-vg:check-scenario-file-exists

Conversation

@koen-vg
Copy link
Copy Markdown
Contributor

@koen-vg koen-vg commented Mar 26, 2024

A very simple quality of life improvement. Useful when running the create_scenarios rule the first time.

When wishing to generate a new scenarios files (say, "scenarios2.yaml"), one could change the corresponding config option (run/scenarios/file) and run the create_scenarios rule. However, if say "scenarios2.yaml" doesn't exist yet, the get_scenarios function fails. An awkward solution is to first create "scenarios2.yaml" manually (and put in some mock scenarios, otherwise scenarios.keys() fails!), and then run create_scenarios. With this check, that's not necessary anymore.

Checklist

  • I tested my contribution locally and it seems to work fine.
  • Code and workflow changes are sufficiently documented.
  • Changed dependencies are added to envs/environment.yaml.
  • Changes in configuration options are added in all of config.default.yaml.
  • Changes in configuration options are also documented in doc/configtables/*.csv.
  • A release note doc/release_notes.rst is added.

Useful when running the `create_scenarios` rule the first time.
@FabianHofmann
Copy link
Copy Markdown
Contributor

makes sense!

@FabianHofmann FabianHofmann enabled auto-merge March 26, 2024 11:27
@FabianHofmann FabianHofmann merged commit da0c327 into PyPSA:master Mar 26, 2024
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.

2 participants