-
Notifications
You must be signed in to change notification settings - Fork 0
/
Snakefile
73 lines (57 loc) · 2.08 KB
/
Snakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
from pathlib import Path
####SETTINGS####
localrules: create_sims, grid, locations # these rules are not submitted
## TODO this list also in the script create sims. How to access this list in a python script?
wind_speed_list = [30, 20]
win = True
root = Path(r'.')
####End result####
rule all:
input:
path_fig=expand("reports/U{wind_speed}.png", wind_speed=wind_speed_list),
rule analyse:
input:
path="data/4-output/U{wind_speed}/U{wind_speed}_p1.tab"
output:
path_fig="reports/U{wind_speed}.png"
script:
root/r'src/4-analyze/analyse.py'
rule run:
input:
output_bot=root/r'data/3-input/bed.bot',
output_p1=root/r'data/3-input/p1.xyn',
path_sims=expand("data/4-output/U{wind_speed}/U{wind_speed}.swn", wind_speed=wind_speed_list)
output:
res="data/4-output/U{wind_speed}/U{wind_speed}_p1.tab"
run:
if not win:
shell("data/4-output/U{wildcards.wind_speed}/run_SWAN.sh U{wildcards.wind_speed}")
else:
shell("cd data/4-output/U{wildcards.wind_speed} && copy U{wildcards.wind_speed}.swn INPUT && call ..\\..\\..\\bin\\swan_4131A_1_del_w64_i18_omp.exe ")
rule create_sims:
input:
bot=root/r'data/3-input/bed.bot',
p1=root/r'data/3-input/p1.xyn',
path_template = root/r'config/template'
output:
path_sims=expand("data/4-output/U{wind_speed}/U{wind_speed}.swn", wind_speed=wind_speed_list)
script:
root/r'src/1-prepare/create_sims.py'
rule grid:
input:
path_bot=root/r'data/1-external/bed.bot',
path_fxw=root/r'data/1-external/obs.fxw',
output:
output_bot=root/r'data/3-input/bed.bot',
output_fxw=root/r'data/3-input/obs.fxw',
script:
root/r'src/1-prepare/create_grid.py'
rule locations:
input:
path_p1=root/r'data/1-external/p1.xyn',
path_p2=root/r'data/1-external/p2.xyn',
output:
output_p1=root/r'data/3-input/p1.xyn',
output_p2=root/r'data/3-input/p2.xyn',
script:
root/r'src/1-prepare/create_output_locations.py'