wolfhece 2.1.23__py3-none-any.whl → 2.1.27__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,150 @@
1
+ """
2
+ The command-line interface for the acceptability
3
+ """
4
+ import argparse
5
+ from .acceptability import Base_data_creation, Vulnerability, Acceptability, Accept_Manager
6
+
7
+ def main():
8
+
9
+ parser = argparse.ArgumentParser(
10
+ description="A tool to obtain vulnerability and acceptability for regions in Walloon Region and particularly in Vesdre valley.")
11
+
12
+ parser.add_argument("function",
13
+ nargs="?",
14
+ choices=['base_data_creation', 'vulnerability', 'acceptability', 'check'],
15
+ default='acceptability',
16
+ )
17
+ args:argparse.Namespace
18
+ args, sub_args = parser.parse_known_args()
19
+
20
+ if args.function == "check":
21
+
22
+ parser.add_argument("dir",
23
+ type=str,
24
+ help="Add path to the main directory with all folders. This sets the path of all outputs and inputs",
25
+ default='Data')
26
+ parser.add_argument("GDB",
27
+ type=str,
28
+ help="Add the name of the main gdb like GT_Resilence_dataRisques202010.gdb",
29
+ default='GT_Resilence_dataRisques202010.gdb')
30
+ parser.add_argument("CaPa",
31
+ type=str,
32
+ help="Add the name of the Cadaster geopackage, like Cadastre_Walloon.gpkg",
33
+ default='Cadastre_Walloon.gpkg')
34
+ parser.add_argument("PICC",
35
+ type=str,
36
+ help="Add the name of the PICC gdb, like PICC_vDIFF.gdb",
37
+ default='PICC_vDIFF.gdb')
38
+ parser.add_argument("CE",
39
+ type=str,
40
+ help="Add the name of the river extent from IGN, like CE_IGN_top10v.shp",
41
+ default='CE_IGN_TOP10V/CE_IGN_TOP10V.shp')
42
+
43
+ parser.add_argument("scenario",
44
+ type=str,
45
+ help="scenario name",
46
+ default='Scenario1')
47
+ parser.add_argument("study_area",
48
+ type=str,
49
+ help="Add the area of interest, like Theux, Chaufontaine, Eupen, etc.",
50
+ default='Bassin_Vesdre')
51
+
52
+ args = parser.parse_args()
53
+
54
+ manager = Accept_Manager(main_dir=args.dir,
55
+ Study_area=args.study_area,
56
+ scenario=args.scenario,
57
+ Original_gdb=args.GDB,
58
+ CaPa_Walloon=args.CaPa,
59
+ PICC_Walloon=args.PICC,
60
+ CE_IGN_top10v=args.CE)
61
+
62
+
63
+ elif args.function == "base_data_creation":
64
+
65
+ parser.add_argument("dir",
66
+ type=str,
67
+ help="Add path to the main directory with all folders. This sets the path of all outputs and inputs",
68
+ default='Data')
69
+ parser.add_argument("GDB",
70
+ type=str,
71
+ help="Add the name of the main gdb like GT_Resilence_dataRisques202010.gdb",
72
+ default='GT_Resilence_dataRisques202010.gdb')
73
+ parser.add_argument("study_area",
74
+ type=str,
75
+ help="Add the name of the study area shapefile, Vesdre Valley like Bassin_SA.shp",
76
+ default='Bassin_Vesdre.shp')
77
+ parser.add_argument("CaPa",
78
+ type=str,
79
+ help="Add the name of the Cadaster geopackage, like Cadastre_Walloon.gpkg",
80
+ default='Cadastre_Walloon.gpkg')
81
+ parser.add_argument("PICC",
82
+ type=str,
83
+ help="Add the name of the PICC gdb, like PICC_vDIFF.gdb",
84
+ default='PICC_vDIFF.gdb')
85
+ parser.add_argument("CE",
86
+ type=str,
87
+ help="Add the name of the river extent from IGN, like CE_IGN_top10v.shp",
88
+ default='CE_IGN_TOP10V/CE_IGN_TOP10V.shp')
89
+ parser.add_argument("resolution",
90
+ type=float,
91
+ help="Add the resolution of water_depth files. If water_depth files have resolution 1 meter, you can put it as 1",
92
+ default=1.)
93
+ parser.add_argument("number_procs",
94
+ type=int,
95
+ help="Add the number of processors to use",
96
+ default=1)
97
+ args = parser.parse_args()
98
+
99
+ Base_data_creation(main_dir=args.dir,
100
+ Original_gdb=args.GDB,
101
+ Study_area=args.study_area,
102
+ CaPa_Walloon=args.CaPa,
103
+ PICC_Walloon=args.PICC,
104
+ CE_IGN_top10v=args.CE,
105
+ resolution=args.resolution,
106
+ number_procs=args.number_procs)
107
+
108
+ elif args.function == "vulnerability":
109
+
110
+ parser.add_argument("dir",
111
+ type=str,
112
+ help="Add path to the main directory with all folders.This sets the path of all outputs and inputs",
113
+ default='Data')
114
+ parser.add_argument("scenario",
115
+ type=str,
116
+ help="scenario name",
117
+ default='Scenario1')
118
+ parser.add_argument("study_area",
119
+ type=str,
120
+ help="Add the area of interest, like Theux, Chaufontaine, Eupen, etc.",
121
+ default='Bassin_Vesdre')
122
+ args = parser.parse_args()
123
+
124
+ Vulnerability(main_dir=args.dir,
125
+ scenario=args.scenario,
126
+ Study_area=args.study_area)
127
+
128
+ elif args.function == "acceptability":
129
+
130
+ parser.add_argument("dir",
131
+ type=str,
132
+ help="Add path to the main directory with all folders.This sets the path of all outputs and inputs",
133
+ default='Data')
134
+ parser.add_argument("study_area",
135
+ type=str,
136
+ help="Add the name of area, like Theux, Chaudfontaine, Eupen, etc.",
137
+ default='Bassin_Vesdre')
138
+ parser.add_argument("scenario",
139
+ type=str,
140
+ help="Scenario number",
141
+ default='Scenario1')
142
+
143
+ args = parser.parse_args()
144
+
145
+ Acceptability(main_dir=args.dir,
146
+ scenario=args.scenario,
147
+ Study_area=args.study_area)
148
+
149
+ if __name__ == '__main__':
150
+ main()