Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -271,10 +271,10 @@ rule rulegraph:
input:
config_file=rules.dump_graph_config.output.config_file,
output:
dot=resources("dag_rulegraph.dot"),
pdf=resources("dag_rulegraph.pdf"),
png=resources("dag_rulegraph.png"),
svg=resources("dag_rulegraph.svg"),
dot=resources("dag/dag_rulegraph.dot"),
pdf=resources("dag/dag_rulegraph.pdf"),
png=resources("dag/dag_rulegraph.png"),
svg=resources("dag/dag_rulegraph.svg"),
shell:
r"""
# Generate DOT file using nested snakemake with the dumped final config
Expand Down Expand Up @@ -309,10 +309,10 @@ rule filegraph:
input:
config_file=rules.dump_graph_config.output.config_file,
output:
dot=resources("dag_filegraph.dot"),
pdf=resources("dag_filegraph.pdf"),
png=resources("dag_filegraph.png"),
svg=resources("dag_filegraph.svg"),
dot=resources("dag/dag_filegraph.dot"),
pdf=resources("dag/dag_filegraph.pdf"),
png=resources("dag/dag_filegraph.png"),
svg=resources("dag/dag_filegraph.svg"),
shell:
r"""
# Generate DOT file using nested snakemake with the dumped final config
Expand Down
10 changes: 9 additions & 1 deletion pixi.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ xarray = ">=2024.3.0,<2025.7.0"
xlrd = ">=2.0.2"
yaml = ">=0.2.5"
snakemake-storage-plugin-cached-http = ">=0.1.0"
pydot = ">=4.0.1"

[feature.doc.tasks.build-docs]
args = ["dir", {"arg" = "output", "default" = "html"}]
Expand Down
20 changes: 20 additions & 0 deletions rules/development.smk
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,26 @@
#
# SPDX-License-Identifier: MIT


rule build_interactive_dag:
"""Create interactive HTML DAG with rule I/O popup."""
input:
svg=resources("dag/dag_rulegraph.svg"),
filegraph=resources("dag/dag_filegraph.dot"),
js="data/js/svg-pan-zoom.min.js",
output:
html=resources("dag/dag_interactive.html"),
log:
logs("build_interactive_dag.log"),
benchmark:
benchmarks("build_interactive_dag")
threads: 1
resources:
mem_mb=500,
script:
"../scripts/build_interactive_dag.py"


if (
config["electricity"]["base_network"] == "osm"
and config["data"]["osm"]["source"] == "build"
Expand Down
19 changes: 19 additions & 0 deletions rules/retrieve.smk
Original file line number Diff line number Diff line change
Expand Up @@ -1158,3 +1158,22 @@ if (MOBILITY_PROFILES_DATASET := dataset_version("mobility_profiles"))["source"]
run:
copy2(input["kfz"], output["kfz"])
copy2(input["pkw"], output["pkw"])


rule retrieve_svg_pan_zoom:
output:
js="data/js/svg-pan-zoom.min.js",
log:
"logs/retrieve_svg_pan_zoom.log",
threads: 1
resources:
mem_mb=200,
run:
import urllib.request

url = (
"https://cdn.jsdelivr.net/npm/svg-pan-zoom@3.6.1/dist/"
"svg-pan-zoom.min.js"
)

urllib.request.urlretrieve(url, output.js)
Loading