fix: make CBA workflow correctly run single runs and collection (multi climate year) runs#625
Open
measrainsey wants to merge 10 commits intomasterfrom
Open
fix: make CBA workflow correctly run single runs and collection (multi climate year) runs#625measrainsey wants to merge 10 commits intomasterfrom
measrainsey wants to merge 10 commits intomasterfrom
Conversation
13 tasks
Conflicts: doc/release_notes.rst
lisazeyen
requested changes
Apr 20, 2026
Collaborator
lisazeyen
left a comment
There was a problem hiding this comment.
Great @measrainsey ! Also just some minor comments here on reformulating the release notes and summarizing one part of the cba.smk into a function.
Comment on lines
+601
to
+605
| run = w.get("run", config_provider("run", "name")(w)) | ||
| if isinstance(run, list): | ||
| run = run[0] if run else "" | ||
| if not run: | ||
| return [] |
Collaborator
There was a problem hiding this comment.
This pattern is used quite often, should we modularize into a function?
Co-authored-by: lisazeyen <35347358+lisazeyen@users.noreply.github.com>
for more information, see https://pre-commit.ci
Member
Author
|
Thanks @lisazeyen for your review! I implemented your suggestion to the PR description, and I refactored the commonly used code into a function - feel free take another look at let me know if you have any other suggestions! :) |
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.
Closes:
Changes proposed in this Pull Request
PR to fix the CBA workflow so that it works consistently for both single runs and collection runs
Tasks
Workflow
rules/cba.smk: the workflow now distinguishes between different kinds of runs, via a function calledcba_projects_run()NT)cba.scenarios) (e.g.,NT-cyears)cba.sb_scenario(e.g.,NT-cy2009)With these changes:
I tested by running the command
snakemake -call cba --configfile config/config.tyndp.yaml.If just the

NTis run, then the results create only theNTfolder, with solved SB networks and CBA results.If
NT-cyearsis run, there are two possibilities:resources/<run>/cba/networks/simple_*.ncalready exist (in the desired temporal resolution and such), then theNTresults won't include the solved SB networksThis is the file directory of a situation where the intermediate files didn't exist, so the NT SB solved networks were also recreated in the results. Also note that the collection rule,
NT-cyears, only has the ensemble results.Conversely, if I run the
NT-cy1998scenario, which referencescba.sb_scenario: NT, if theNT-cy1998resources folder already has the required intermediate resources file(s), then the workflow won't run and solve the SB networks for theNTagain.Open issues
Notes
Checklist
[ ] Changed dependencies are added topixi.toml(usingpixi add <dependency-name>).[ ] Changes in configuration options are added inconfig/config.default.yaml.[ ] Changes in configuration options are documented indoc/configtables/*.csv.[ ] Changes in configuration options are added inconfig/test/*.yaml.pixi run -e open-tyndp tyndp-cyears-test).[ ] Open-TYNDP SPDX license header added to all touched files.[ ] For new data sources or versions, these instructions have been followed.[ ] New rules are documented in the appropriatedoc/*.rstfiles.doc/release_notes.rstis added.[ ] Major features are documented with up-to-date information inREADMEanddoc/index.rst.[ ] Module docstrings added to new Python scripts.