Add an option to create a filegraph in the dag rule#1574
Add an option to create a filegraph in the dag rule#1574fneum merged 11 commits intoPyPSA:masterfrom
Conversation
fneum
left a comment
There was a problem hiding this comment.
Nice utility! But avoid definition of dag_type outside rule definition.
It seems the current approach mixes two approaches (wildcards and parameters). With the current setup you could actually use
snakemake --{dag_type} all | sed -n "/digraph/,\$p" > {output.dot}
to run snakemake dag_filegraph.pdf or snakemake dag_rulegraph.pdf and forget about the params or config setting.
I would also be fine to just create both rulegraph and filegraph on run snakemake dag.
Snakefile
Outdated
| dag_type = config.get("dag_type", "rulegraph") | ||
|
|
||
|
|
There was a problem hiding this comment.
| dag_type = config.get("dag_type", "rulegraph") |
Snakefile
Outdated
| conda: | ||
| "envs/environment.yaml" | ||
| params: | ||
| dag_type=dag_type, |
There was a problem hiding this comment.
| dag_type=dag_type, | |
| dag_type=config.get("dag_type", "rulegraph"), |
Co-authored-by: Fabian Neumann <[email protected]>
|
Thanks @fneum for the review. Using only wildcards implies that we cannot have a default behaviour. That's why I suggest using # Not possible
snakemake dag
# Possible
snakemake resources/dag_rulegraph.pdf
snakemake resources/dag_filegraph.pdfAlso, as the Would there be an implementation with wildcards and a default value? |
|
Another option would be two separate rules: |
Closes # (if applicable).
Changes proposed in this Pull Request
Checklist
envs/environment.yaml.config/config.default.yaml.doc/configtables/*.csv.doc/data_sources.rst.doc/release_notes.rstis added.