11# Emulate a user configuring the module.
22configfile : workflow .source_path ("./test_config.yaml" )
33
4- # Emulate how another workflow might create inputs for this module.
5- rule create_external_input :
6- message : "Example of a rule external to your module."
4+ rule download_netherlands_shapes :
5+ message : "Download and unzip the Netherlands shapes."
76 output :
8- text_file = "results/module_area_potentials/resources/user/user_message.md"
9- run :
10- from pathlib import Path
11- from textwrap import dedent
12- text = dedent ("""Modular workflows can be used by more than one project!
13- For example, this text comes from a file external to the module.
14- Try your best to make this workflow reusable so that others may benefit from your methods."""
15- )
16- file_path = Path (output .text_file )
17- with file_path .open ("w" ) as f :
18- f .write (text )
7+ "results/module_area_potentials/resources/user/shapes/NLD.parquet" ,
8+ shell :
9+ """
10+ curl -sSLo {output} https://surfdrive.surf.nl/files/index.php/s/ey3RmiCbajp69oQ/download
11+ """
12+
13+ rule download_netherlands_protected_areas :
14+ message : "Download and unzip a dummy drop-in dataset for Netherlands protected areas (not based on WDPA)."
15+ output :
16+ zipfile = "results/module_area_potentials/resources/user/wdpa.gdb.zip" ,
17+ wdpa = directory ("results/module_area_potentials/resources/user/wdpa.gdb" ),
18+ shell :
19+ """
20+ curl -sSLo {output.zipfile} https://surfdrive.surf.nl/files/index.php/s/msuXQETNbCWawDh/download
21+ unzip {output.zipfile} -d results/module_area_potentials/resources/user/
22+ """
1923
2024# Import the module and configure it.
2125# `snakefile:` specifies the module. It can use file paths and special github(...) / gitlab(...) markers
@@ -30,7 +34,9 @@ use rule * from module_area_potentials as module_area_potentials_*
3034
3135# Request something from the module
3236rule all :
33- message : "A generic test case for your module ."
37+ message : "Run the module for the Netherlands shapes ."
3438 default_target : True
3539 input :
36- "results/module_area_potentials/results/combined_text.md"
40+ "results/module_area_potentials/resources/user/shapes/NLD.parquet" ,
41+ "results/module_area_potentials/resources/user/wdpa.gdb" ,
42+ "results/module_area_potentials/results/NLD/area_potential_report.html" ,
0 commit comments