epyt-flow 0.1.1__py3-none-any.whl → 0.3.0__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.
- epyt_flow/EPANET/compile_linux.sh +4 -0
- epyt_flow/EPANET/compile_macos.sh +4 -0
- epyt_flow/VERSION +1 -1
- epyt_flow/__init__.py +29 -18
- epyt_flow/data/benchmarks/leakdb.py +7 -12
- epyt_flow/data/networks.py +404 -40
- epyt_flow/rest_api/base_handler.py +14 -0
- epyt_flow/rest_api/scada_data/__init__.py +0 -0
- epyt_flow/rest_api/{scada_data_handler.py → scada_data/data_handlers.py} +3 -162
- epyt_flow/rest_api/scada_data/export_handlers.py +140 -0
- epyt_flow/rest_api/scada_data/handlers.py +209 -0
- epyt_flow/rest_api/scenario/__init__.py +0 -0
- epyt_flow/rest_api/scenario/event_handlers.py +118 -0
- epyt_flow/rest_api/{scenario_handler.py → scenario/handlers.py} +86 -67
- epyt_flow/rest_api/scenario/simulation_handlers.py +174 -0
- epyt_flow/rest_api/scenario/uncertainty_handlers.py +118 -0
- epyt_flow/rest_api/server.py +61 -24
- epyt_flow/simulation/events/leakages.py +27 -17
- epyt_flow/simulation/scada/scada_data.py +545 -14
- epyt_flow/simulation/scada/scada_data_export.py +39 -12
- epyt_flow/simulation/scenario_config.py +14 -20
- epyt_flow/simulation/scenario_simulator.py +358 -114
- epyt_flow/simulation/sensor_config.py +693 -37
- epyt_flow/topology.py +149 -8
- epyt_flow/utils.py +75 -18
- {epyt_flow-0.1.1.dist-info → epyt_flow-0.3.0.dist-info}/METADATA +33 -5
- {epyt_flow-0.1.1.dist-info → epyt_flow-0.3.0.dist-info}/RECORD +30 -22
- epyt_flow/EPANET/compile.sh +0 -4
- {epyt_flow-0.1.1.dist-info → epyt_flow-0.3.0.dist-info}/LICENSE +0 -0
- {epyt_flow-0.1.1.dist-info → epyt_flow-0.3.0.dist-info}/WHEEL +0 -0
- {epyt_flow-0.1.1.dist-info → epyt_flow-0.3.0.dist-info}/top_level.txt +0 -0
epyt_flow/data/networks.py
CHANGED
|
@@ -25,21 +25,47 @@ def create_empty_sensor_config(f_inp: str) -> SensorConfig:
|
|
|
25
25
|
return sim.sensor_config
|
|
26
26
|
|
|
27
27
|
|
|
28
|
-
def get_default_hydraulic_options() -> dict:
|
|
28
|
+
def get_default_hydraulic_options(flow_units_id: int = None) -> dict:
|
|
29
29
|
"""
|
|
30
30
|
Gets standard hydraulic default options -- i.e. switch to pressure-driven analysis.
|
|
31
31
|
|
|
32
|
+
Parameters
|
|
33
|
+
----------
|
|
34
|
+
flow_units_id : `int`, optional
|
|
35
|
+
Specifies the flow units to be used in this scenario.
|
|
36
|
+
If None, the units from the .inp file will be used.
|
|
37
|
+
|
|
38
|
+
Must be one of the following EPANET toolkit constants:
|
|
39
|
+
|
|
40
|
+
- EN_CFS = 0 (cubic foot/sec)
|
|
41
|
+
- EN_GPM = 1 (gal/min)
|
|
42
|
+
- EN_MGD = 2 (Million gal/day)
|
|
43
|
+
- EN_IMGD = 3 (Imperial MGD)
|
|
44
|
+
- EN_AFD = 4 (ac-foot/day)
|
|
45
|
+
- EN_LPS = 5 (liter/sec)
|
|
46
|
+
- EN_LPM = 6 (liter/min)
|
|
47
|
+
- EN_MLD = 7 (Megaliter/day)
|
|
48
|
+
- EN_CMH = 8 (cubic meter/hr)
|
|
49
|
+
- EN_CMD = 9 (cubic meter/day)
|
|
50
|
+
|
|
51
|
+
The default is None.
|
|
52
|
+
|
|
32
53
|
Returns
|
|
33
54
|
-------
|
|
34
55
|
`dict`
|
|
35
56
|
Dictionary with default hydraulics options that can be passed to
|
|
36
57
|
:func:`~epyt_flow.simulation.scenario_simulator.ScenarioSimulator.set_general_parameters`.
|
|
37
58
|
"""
|
|
38
|
-
|
|
39
|
-
|
|
59
|
+
params = {"demand_model": {"type": "PDA", "pressure_min": 0, "pressure_required": 0.1,
|
|
60
|
+
"pressure_exponent": 0.5}}
|
|
61
|
+
if flow_units_id is not None:
|
|
62
|
+
params |= {"flow_units_id": flow_units_id}
|
|
40
63
|
|
|
64
|
+
return params
|
|
41
65
|
|
|
42
|
-
|
|
66
|
+
|
|
67
|
+
def load_inp(f_in: str, include_empty_sensor_config: bool = True,
|
|
68
|
+
flow_units_id: int = None) -> ScenarioConfig:
|
|
43
69
|
"""
|
|
44
70
|
Loads an .inp file and wraps it into a scenario configuration.
|
|
45
71
|
|
|
@@ -52,6 +78,24 @@ def load_inp(f_in: str, include_empty_sensor_config: bool = True) -> ScenarioCon
|
|
|
52
78
|
scenario configuration.
|
|
53
79
|
|
|
54
80
|
The default is True.
|
|
81
|
+
flow_units_id : `int`, optional
|
|
82
|
+
Specifies the flow units to be used in this scenario.
|
|
83
|
+
If None, the units from the .inp file will be used.
|
|
84
|
+
|
|
85
|
+
Must be one of the following EPANET toolkit constants:
|
|
86
|
+
|
|
87
|
+
- EN_CFS = 0 (cubic foot/sec)
|
|
88
|
+
- EN_GPM = 1 (gal/min)
|
|
89
|
+
- EN_MGD = 2 (Million gal/day)
|
|
90
|
+
- EN_IMGD = 3 (Imperial MGD)
|
|
91
|
+
- EN_AFD = 4 (ac-foot/day)
|
|
92
|
+
- EN_LPS = 5 (liter/sec)
|
|
93
|
+
- EN_LPM = 6 (liter/min)
|
|
94
|
+
- EN_MLD = 7 (Megaliter/day)
|
|
95
|
+
- EN_CMH = 8 (cubic meter/hr)
|
|
96
|
+
- EN_CMD = 9 (cubic meter/day)
|
|
97
|
+
|
|
98
|
+
The default is None.
|
|
55
99
|
|
|
56
100
|
Returns
|
|
57
101
|
-------
|
|
@@ -63,12 +107,14 @@ def load_inp(f_in: str, include_empty_sensor_config: bool = True) -> ScenarioCon
|
|
|
63
107
|
|
|
64
108
|
if include_empty_sensor_config is True:
|
|
65
109
|
return ScenarioConfig(f_inp_in=f_in, sensor_config=create_empty_sensor_config(f_inp=f_in),
|
|
66
|
-
general_params=get_default_hydraulic_options())
|
|
110
|
+
general_params=get_default_hydraulic_options(flow_units_id))
|
|
67
111
|
else:
|
|
68
|
-
return ScenarioConfig(f_inp_in=f_in,
|
|
112
|
+
return ScenarioConfig(f_inp_in=f_in,
|
|
113
|
+
general_params=get_default_hydraulic_options(flow_units_id))
|
|
69
114
|
|
|
70
115
|
|
|
71
|
-
def load_net1(download_dir: str = get_temp_folder(), verbose: bool = True
|
|
116
|
+
def load_net1(download_dir: str = get_temp_folder(), verbose: bool = True,
|
|
117
|
+
flow_units_id: int = None) -> ScenarioConfig:
|
|
72
118
|
"""
|
|
73
119
|
Loads (and downloads if necessary) the Net1 network.
|
|
74
120
|
|
|
@@ -82,6 +128,24 @@ def load_net1(download_dir: str = get_temp_folder(), verbose: bool = True) -> Sc
|
|
|
82
128
|
If True, a progress bar is shown while downloading the file.
|
|
83
129
|
|
|
84
130
|
The default is True.
|
|
131
|
+
flow_units_id : `int`, optional
|
|
132
|
+
Specifies the flow units to be used in this scenario.
|
|
133
|
+
If None, the units from the .inp file will be used.
|
|
134
|
+
|
|
135
|
+
Must be one of the following EPANET toolkit constants:
|
|
136
|
+
|
|
137
|
+
- EN_CFS = 0 (cubic foot/sec)
|
|
138
|
+
- EN_GPM = 1 (gal/min)
|
|
139
|
+
- EN_MGD = 2 (Million gal/day)
|
|
140
|
+
- EN_IMGD = 3 (Imperial MGD)
|
|
141
|
+
- EN_AFD = 4 (ac-foot/day)
|
|
142
|
+
- EN_LPS = 5 (liter/sec)
|
|
143
|
+
- EN_LPM = 6 (liter/min)
|
|
144
|
+
- EN_MLD = 7 (Megaliter/day)
|
|
145
|
+
- EN_CMH = 8 (cubic meter/hr)
|
|
146
|
+
- EN_CMD = 9 (cubic meter/day)
|
|
147
|
+
|
|
148
|
+
The default is None.
|
|
85
149
|
|
|
86
150
|
Returns
|
|
87
151
|
-------
|
|
@@ -94,10 +158,11 @@ def load_net1(download_dir: str = get_temp_folder(), verbose: bool = True) -> Sc
|
|
|
94
158
|
"asce-tf-wdst/Net1.inp"
|
|
95
159
|
|
|
96
160
|
download_if_necessary(f_in, url, verbose)
|
|
97
|
-
return load_inp(f_in)
|
|
161
|
+
return load_inp(f_in, flow_units_id=flow_units_id)
|
|
98
162
|
|
|
99
163
|
|
|
100
|
-
def load_net2(download_dir: str = get_temp_folder(), verbose: bool = True
|
|
164
|
+
def load_net2(download_dir: str = get_temp_folder(), verbose: bool = True,
|
|
165
|
+
flow_units_id: int = None) -> ScenarioConfig:
|
|
101
166
|
"""
|
|
102
167
|
Loads (and downloads if necessary) the Net2 network.
|
|
103
168
|
|
|
@@ -111,6 +176,24 @@ def load_net2(download_dir: str = get_temp_folder(), verbose: bool = True) -> Sc
|
|
|
111
176
|
If True, a progress bar is shown while downloading the file.
|
|
112
177
|
|
|
113
178
|
The default is True.
|
|
179
|
+
flow_units_id : `int`, optional
|
|
180
|
+
Specifies the flow units to be used in this scenario.
|
|
181
|
+
If None, the units from the .inp file will be used.
|
|
182
|
+
|
|
183
|
+
Must be one of the following EPANET toolkit constants:
|
|
184
|
+
|
|
185
|
+
- EN_CFS = 0 (cubic foot/sec)
|
|
186
|
+
- EN_GPM = 1 (gal/min)
|
|
187
|
+
- EN_MGD = 2 (Million gal/day)
|
|
188
|
+
- EN_IMGD = 3 (Imperial MGD)
|
|
189
|
+
- EN_AFD = 4 (ac-foot/day)
|
|
190
|
+
- EN_LPS = 5 (liter/sec)
|
|
191
|
+
- EN_LPM = 6 (liter/min)
|
|
192
|
+
- EN_MLD = 7 (Megaliter/day)
|
|
193
|
+
- EN_CMH = 8 (cubic meter/hr)
|
|
194
|
+
- EN_CMD = 9 (cubic meter/day)
|
|
195
|
+
|
|
196
|
+
The default is None.
|
|
114
197
|
|
|
115
198
|
Returns
|
|
116
199
|
-------
|
|
@@ -123,10 +206,11 @@ def load_net2(download_dir: str = get_temp_folder(), verbose: bool = True) -> Sc
|
|
|
123
206
|
"asce-tf-wdst/Net2.inp"
|
|
124
207
|
|
|
125
208
|
download_if_necessary(f_in, url, verbose)
|
|
126
|
-
return load_inp(f_in)
|
|
209
|
+
return load_inp(f_in, flow_units_id=flow_units_id)
|
|
127
210
|
|
|
128
211
|
|
|
129
|
-
def load_net3(download_dir: str = get_temp_folder(), verbose: bool = True
|
|
212
|
+
def load_net3(download_dir: str = get_temp_folder(), verbose: bool = True,
|
|
213
|
+
flow_units_id: int = None) -> ScenarioConfig:
|
|
130
214
|
"""
|
|
131
215
|
Loads (and downloads if necessary) the Net3 network.
|
|
132
216
|
|
|
@@ -140,6 +224,24 @@ def load_net3(download_dir: str = get_temp_folder(), verbose: bool = True) -> Sc
|
|
|
140
224
|
If True, a progress bar is shown while downloading the file.
|
|
141
225
|
|
|
142
226
|
The default is True.
|
|
227
|
+
flow_units_id : `int`, optional
|
|
228
|
+
Specifies the flow units to be used in this scenario.
|
|
229
|
+
If None, the units from the .inp file will be used.
|
|
230
|
+
|
|
231
|
+
Must be one of the following EPANET toolkit constants:
|
|
232
|
+
|
|
233
|
+
- EN_CFS = 0 (cubic foot/sec)
|
|
234
|
+
- EN_GPM = 1 (gal/min)
|
|
235
|
+
- EN_MGD = 2 (Million gal/day)
|
|
236
|
+
- EN_IMGD = 3 (Imperial MGD)
|
|
237
|
+
- EN_AFD = 4 (ac-foot/day)
|
|
238
|
+
- EN_LPS = 5 (liter/sec)
|
|
239
|
+
- EN_LPM = 6 (liter/min)
|
|
240
|
+
- EN_MLD = 7 (Megaliter/day)
|
|
241
|
+
- EN_CMH = 8 (cubic meter/hr)
|
|
242
|
+
- EN_CMD = 9 (cubic meter/day)
|
|
243
|
+
|
|
244
|
+
The default is None.
|
|
143
245
|
|
|
144
246
|
Returns
|
|
145
247
|
-------
|
|
@@ -152,10 +254,11 @@ def load_net3(download_dir: str = get_temp_folder(), verbose: bool = True) -> Sc
|
|
|
152
254
|
"asce-tf-wdst/Net3.inp"
|
|
153
255
|
|
|
154
256
|
download_if_necessary(f_in, url, verbose)
|
|
155
|
-
return load_inp(f_in)
|
|
257
|
+
return load_inp(f_in, flow_units_id=flow_units_id)
|
|
156
258
|
|
|
157
259
|
|
|
158
|
-
def load_net6(download_dir: str = get_temp_folder(), verbose: bool = True
|
|
260
|
+
def load_net6(download_dir: str = get_temp_folder(), verbose: bool = True,
|
|
261
|
+
flow_units_id: int = None) -> ScenarioConfig:
|
|
159
262
|
"""
|
|
160
263
|
Loads (and downloads if necessary) the Net6 network.
|
|
161
264
|
|
|
@@ -169,6 +272,24 @@ def load_net6(download_dir: str = get_temp_folder(), verbose: bool = True) -> Sc
|
|
|
169
272
|
If True, a progress bar is shown while downloading the file.
|
|
170
273
|
|
|
171
274
|
The default is True.
|
|
275
|
+
flow_units_id : `int`, optional
|
|
276
|
+
Specifies the flow units to be used in this scenario.
|
|
277
|
+
If None, the units from the .inp file will be used.
|
|
278
|
+
|
|
279
|
+
Must be one of the following EPANET toolkit constants:
|
|
280
|
+
|
|
281
|
+
- EN_CFS = 0 (cubic foot/sec)
|
|
282
|
+
- EN_GPM = 1 (gal/min)
|
|
283
|
+
- EN_MGD = 2 (Million gal/day)
|
|
284
|
+
- EN_IMGD = 3 (Imperial MGD)
|
|
285
|
+
- EN_AFD = 4 (ac-foot/day)
|
|
286
|
+
- EN_LPS = 5 (liter/sec)
|
|
287
|
+
- EN_LPM = 6 (liter/min)
|
|
288
|
+
- EN_MLD = 7 (Megaliter/day)
|
|
289
|
+
- EN_CMH = 8 (cubic meter/hr)
|
|
290
|
+
- EN_CMD = 9 (cubic meter/day)
|
|
291
|
+
|
|
292
|
+
The default is None.
|
|
172
293
|
|
|
173
294
|
Returns
|
|
174
295
|
-------
|
|
@@ -180,10 +301,11 @@ def load_net6(download_dir: str = get_temp_folder(), verbose: bool = True) -> Sc
|
|
|
180
301
|
url = "https://github.com/OpenWaterAnalytics/WNTR/raw/main/examples/networks/Net6.inp"
|
|
181
302
|
|
|
182
303
|
download_if_necessary(f_in, url, verbose)
|
|
183
|
-
return load_inp(f_in)
|
|
304
|
+
return load_inp(f_in, flow_units_id=flow_units_id)
|
|
184
305
|
|
|
185
306
|
|
|
186
|
-
def load_richmond(download_dir: str = get_temp_folder(), verbose: bool = True
|
|
307
|
+
def load_richmond(download_dir: str = get_temp_folder(), verbose: bool = True,
|
|
308
|
+
flow_units_id: int = None) -> ScenarioConfig:
|
|
187
309
|
"""
|
|
188
310
|
Loads (and downloads if necessary) the Richmond network.
|
|
189
311
|
|
|
@@ -197,6 +319,24 @@ def load_richmond(download_dir: str = get_temp_folder(), verbose: bool = True) -
|
|
|
197
319
|
If True, a progress bar is shown while downloading the file.
|
|
198
320
|
|
|
199
321
|
The default is True.
|
|
322
|
+
flow_units_id : `int`, optional
|
|
323
|
+
Specifies the flow units to be used in this scenario.
|
|
324
|
+
If None, the units from the .inp file will be used.
|
|
325
|
+
|
|
326
|
+
Must be one of the following EPANET toolkit constants:
|
|
327
|
+
|
|
328
|
+
- EN_CFS = 0 (cubic foot/sec)
|
|
329
|
+
- EN_GPM = 1 (gal/min)
|
|
330
|
+
- EN_MGD = 2 (Million gal/day)
|
|
331
|
+
- EN_IMGD = 3 (Imperial MGD)
|
|
332
|
+
- EN_AFD = 4 (ac-foot/day)
|
|
333
|
+
- EN_LPS = 5 (liter/sec)
|
|
334
|
+
- EN_LPM = 6 (liter/min)
|
|
335
|
+
- EN_MLD = 7 (Megaliter/day)
|
|
336
|
+
- EN_CMH = 8 (cubic meter/hr)
|
|
337
|
+
- EN_CMD = 9 (cubic meter/day)
|
|
338
|
+
|
|
339
|
+
The default is None.
|
|
200
340
|
|
|
201
341
|
Returns
|
|
202
342
|
-------
|
|
@@ -209,10 +349,11 @@ def load_richmond(download_dir: str = get_temp_folder(), verbose: bool = True) -
|
|
|
209
349
|
"exeter-benchmarks/Richmond_standard.inp"
|
|
210
350
|
|
|
211
351
|
download_if_necessary(f_in, url, verbose)
|
|
212
|
-
return load_inp(f_in)
|
|
352
|
+
return load_inp(f_in, flow_units_id=flow_units_id)
|
|
213
353
|
|
|
214
354
|
|
|
215
|
-
def load_micropolis(download_dir: str = get_temp_folder(), verbose: bool = True
|
|
355
|
+
def load_micropolis(download_dir: str = get_temp_folder(), verbose: bool = True,
|
|
356
|
+
flow_units_id: int = None) -> ScenarioConfig:
|
|
216
357
|
"""
|
|
217
358
|
Loads (and downloads if necessary) the MICROPOLIS network.
|
|
218
359
|
|
|
@@ -226,6 +367,24 @@ def load_micropolis(download_dir: str = get_temp_folder(), verbose: bool = True)
|
|
|
226
367
|
If True, a progress bar is shown while downloading the file.
|
|
227
368
|
|
|
228
369
|
The default is True.
|
|
370
|
+
flow_units_id : `int`, optional
|
|
371
|
+
Specifies the flow units to be used in this scenario.
|
|
372
|
+
If None, the units from the .inp file will be used.
|
|
373
|
+
|
|
374
|
+
Must be one of the following EPANET toolkit constants:
|
|
375
|
+
|
|
376
|
+
- EN_CFS = 0 (cubic foot/sec)
|
|
377
|
+
- EN_GPM = 1 (gal/min)
|
|
378
|
+
- EN_MGD = 2 (Million gal/day)
|
|
379
|
+
- EN_IMGD = 3 (Imperial MGD)
|
|
380
|
+
- EN_AFD = 4 (ac-foot/day)
|
|
381
|
+
- EN_LPS = 5 (liter/sec)
|
|
382
|
+
- EN_LPM = 6 (liter/min)
|
|
383
|
+
- EN_MLD = 7 (Megaliter/day)
|
|
384
|
+
- EN_CMH = 8 (cubic meter/hr)
|
|
385
|
+
- EN_CMD = 9 (cubic meter/day)
|
|
386
|
+
|
|
387
|
+
The default is None.
|
|
229
388
|
|
|
230
389
|
Returns
|
|
231
390
|
-------
|
|
@@ -238,10 +397,11 @@ def load_micropolis(download_dir: str = get_temp_folder(), verbose: bool = True)
|
|
|
238
397
|
"MICROPOLIS_v1.inp"
|
|
239
398
|
|
|
240
399
|
download_if_necessary(f_in, url, verbose)
|
|
241
|
-
return load_inp(f_in)
|
|
400
|
+
return load_inp(f_in, flow_units_id=flow_units_id)
|
|
242
401
|
|
|
243
402
|
|
|
244
|
-
def load_balerma(download_dir: str = get_temp_folder(), verbose: bool = True
|
|
403
|
+
def load_balerma(download_dir: str = get_temp_folder(), verbose: bool = True,
|
|
404
|
+
flow_units_id: int = None) -> ScenarioConfig:
|
|
245
405
|
"""
|
|
246
406
|
Loads (and downloads if necessary) the Balerma network.
|
|
247
407
|
|
|
@@ -255,6 +415,24 @@ def load_balerma(download_dir: str = get_temp_folder(), verbose: bool = True) ->
|
|
|
255
415
|
If True, a progress bar is shown while downloading the file.
|
|
256
416
|
|
|
257
417
|
The default is True.
|
|
418
|
+
flow_units_id : `int`, optional
|
|
419
|
+
Specifies the flow units to be used in this scenario.
|
|
420
|
+
If None, the units from the .inp file will be used.
|
|
421
|
+
|
|
422
|
+
Must be one of the following EPANET toolkit constants:
|
|
423
|
+
|
|
424
|
+
- EN_CFS = 0 (cubic foot/sec)
|
|
425
|
+
- EN_GPM = 1 (gal/min)
|
|
426
|
+
- EN_MGD = 2 (Million gal/day)
|
|
427
|
+
- EN_IMGD = 3 (Imperial MGD)
|
|
428
|
+
- EN_AFD = 4 (ac-foot/day)
|
|
429
|
+
- EN_LPS = 5 (liter/sec)
|
|
430
|
+
- EN_LPM = 6 (liter/min)
|
|
431
|
+
- EN_MLD = 7 (Megaliter/day)
|
|
432
|
+
- EN_CMH = 8 (cubic meter/hr)
|
|
433
|
+
- EN_CMD = 9 (cubic meter/day)
|
|
434
|
+
|
|
435
|
+
The default is None.
|
|
258
436
|
|
|
259
437
|
Returns
|
|
260
438
|
-------
|
|
@@ -267,10 +445,11 @@ def load_balerma(download_dir: str = get_temp_folder(), verbose: bool = True) ->
|
|
|
267
445
|
"asce-tf-wdst/Balerma.inp"
|
|
268
446
|
|
|
269
447
|
download_if_necessary(f_in, url, verbose)
|
|
270
|
-
return load_inp(f_in)
|
|
448
|
+
return load_inp(f_in, flow_units_id=flow_units_id)
|
|
271
449
|
|
|
272
450
|
|
|
273
|
-
def load_rural(download_dir: str = get_temp_folder(), verbose: bool = True
|
|
451
|
+
def load_rural(download_dir: str = get_temp_folder(), verbose: bool = True,
|
|
452
|
+
flow_units_id: int = None) -> ScenarioConfig:
|
|
274
453
|
"""
|
|
275
454
|
Loads (and downloads if necessary) the Rural network.
|
|
276
455
|
|
|
@@ -284,6 +463,24 @@ def load_rural(download_dir: str = get_temp_folder(), verbose: bool = True) -> S
|
|
|
284
463
|
If True, a progress bar is shown while downloading the file.
|
|
285
464
|
|
|
286
465
|
The default is True.
|
|
466
|
+
flow_units_id : `int`, optional
|
|
467
|
+
Specifies the flow units to be used in this scenario.
|
|
468
|
+
If None, the units from the .inp file will be used.
|
|
469
|
+
|
|
470
|
+
Must be one of the following EPANET toolkit constants:
|
|
471
|
+
|
|
472
|
+
- EN_CFS = 0 (cubic foot/sec)
|
|
473
|
+
- EN_GPM = 1 (gal/min)
|
|
474
|
+
- EN_MGD = 2 (Million gal/day)
|
|
475
|
+
- EN_IMGD = 3 (Imperial MGD)
|
|
476
|
+
- EN_AFD = 4 (ac-foot/day)
|
|
477
|
+
- EN_LPS = 5 (liter/sec)
|
|
478
|
+
- EN_LPM = 6 (liter/min)
|
|
479
|
+
- EN_MLD = 7 (Megaliter/day)
|
|
480
|
+
- EN_CMH = 8 (cubic meter/hr)
|
|
481
|
+
- EN_CMD = 9 (cubic meter/day)
|
|
482
|
+
|
|
483
|
+
The default is None.
|
|
287
484
|
|
|
288
485
|
Returns
|
|
289
486
|
-------
|
|
@@ -296,10 +493,11 @@ def load_rural(download_dir: str = get_temp_folder(), verbose: bool = True) -> S
|
|
|
296
493
|
"asce-tf-wdst/RuralNetwork.inp"
|
|
297
494
|
|
|
298
495
|
download_if_necessary(f_in, url, verbose)
|
|
299
|
-
return load_inp(f_in)
|
|
496
|
+
return load_inp(f_in, flow_units_id=flow_units_id)
|
|
300
497
|
|
|
301
498
|
|
|
302
|
-
def load_bwsn1(download_dir: str = get_temp_folder(), verbose: bool = True
|
|
499
|
+
def load_bwsn1(download_dir: str = get_temp_folder(), verbose: bool = True,
|
|
500
|
+
flow_units_id: int = None) -> ScenarioConfig:
|
|
303
501
|
"""
|
|
304
502
|
Loads (and downloads if necessary) the BWSN-1 network.
|
|
305
503
|
|
|
@@ -313,6 +511,24 @@ def load_bwsn1(download_dir: str = get_temp_folder(), verbose: bool = True) -> S
|
|
|
313
511
|
If True, a progress bar is shown while downloading the file.
|
|
314
512
|
|
|
315
513
|
The default is True.
|
|
514
|
+
flow_units_id : `int`, optional
|
|
515
|
+
Specifies the flow units to be used in this scenario.
|
|
516
|
+
If None, the units from the .inp file will be used.
|
|
517
|
+
|
|
518
|
+
Must be one of the following EPANET toolkit constants:
|
|
519
|
+
|
|
520
|
+
- EN_CFS = 0 (cubic foot/sec)
|
|
521
|
+
- EN_GPM = 1 (gal/min)
|
|
522
|
+
- EN_MGD = 2 (Million gal/day)
|
|
523
|
+
- EN_IMGD = 3 (Imperial MGD)
|
|
524
|
+
- EN_AFD = 4 (ac-foot/day)
|
|
525
|
+
- EN_LPS = 5 (liter/sec)
|
|
526
|
+
- EN_LPM = 6 (liter/min)
|
|
527
|
+
- EN_MLD = 7 (Megaliter/day)
|
|
528
|
+
- EN_CMH = 8 (cubic meter/hr)
|
|
529
|
+
- EN_CMD = 9 (cubic meter/day)
|
|
530
|
+
|
|
531
|
+
The default is None.
|
|
316
532
|
|
|
317
533
|
Returns
|
|
318
534
|
-------
|
|
@@ -325,10 +541,11 @@ def load_bwsn1(download_dir: str = get_temp_folder(), verbose: bool = True) -> S
|
|
|
325
541
|
"asce-tf-wdst/BWSN_Network_1.inp"
|
|
326
542
|
|
|
327
543
|
download_if_necessary(f_in, url, verbose)
|
|
328
|
-
return load_inp(f_in)
|
|
544
|
+
return load_inp(f_in, flow_units_id=flow_units_id)
|
|
329
545
|
|
|
330
546
|
|
|
331
|
-
def load_bwsn2(download_dir: str = get_temp_folder(), verbose: bool = True
|
|
547
|
+
def load_bwsn2(download_dir: str = get_temp_folder(), verbose: bool = True,
|
|
548
|
+
flow_units_id: int = None) -> ScenarioConfig:
|
|
332
549
|
"""
|
|
333
550
|
Loads (and downloads if necessary) the BWSN-2 network.
|
|
334
551
|
|
|
@@ -342,6 +559,24 @@ def load_bwsn2(download_dir: str = get_temp_folder(), verbose: bool = True) -> S
|
|
|
342
559
|
If True, a progress bar is shown while downloading the file.
|
|
343
560
|
|
|
344
561
|
The default is True.
|
|
562
|
+
flow_units_id : `int`, optional
|
|
563
|
+
Specifies the flow units to be used in this scenario.
|
|
564
|
+
If None, the units from the .inp file will be used.
|
|
565
|
+
|
|
566
|
+
Must be one of the following EPANET toolkit constants:
|
|
567
|
+
|
|
568
|
+
- EN_CFS = 0 (cubic foot/sec)
|
|
569
|
+
- EN_GPM = 1 (gal/min)
|
|
570
|
+
- EN_MGD = 2 (Million gal/day)
|
|
571
|
+
- EN_IMGD = 3 (Imperial MGD)
|
|
572
|
+
- EN_AFD = 4 (ac-foot/day)
|
|
573
|
+
- EN_LPS = 5 (liter/sec)
|
|
574
|
+
- EN_LPM = 6 (liter/min)
|
|
575
|
+
- EN_MLD = 7 (Megaliter/day)
|
|
576
|
+
- EN_CMH = 8 (cubic meter/hr)
|
|
577
|
+
- EN_CMD = 9 (cubic meter/day)
|
|
578
|
+
|
|
579
|
+
The default is None.
|
|
345
580
|
|
|
346
581
|
Returns
|
|
347
582
|
-------
|
|
@@ -354,10 +589,11 @@ def load_bwsn2(download_dir: str = get_temp_folder(), verbose: bool = True) -> S
|
|
|
354
589
|
"asce-tf-wdst/BWSN_Network_2.inp"
|
|
355
590
|
|
|
356
591
|
download_if_necessary(f_in, url, verbose)
|
|
357
|
-
return load_inp(f_in)
|
|
592
|
+
return load_inp(f_in, flow_units_id=flow_units_id)
|
|
358
593
|
|
|
359
594
|
|
|
360
|
-
def load_anytown(download_dir: str = get_temp_folder(), verbose: bool = True
|
|
595
|
+
def load_anytown(download_dir: str = get_temp_folder(), verbose: bool = True,
|
|
596
|
+
flow_units_id: int = None) -> ScenarioConfig:
|
|
361
597
|
"""
|
|
362
598
|
Loads (and downloads if necessary) the Anytown network.
|
|
363
599
|
|
|
@@ -371,6 +607,24 @@ def load_anytown(download_dir: str = get_temp_folder(), verbose: bool = True) ->
|
|
|
371
607
|
If True, a progress bar is shown while downloading the file.
|
|
372
608
|
|
|
373
609
|
The default is True.
|
|
610
|
+
flow_units_id : `int`, optional
|
|
611
|
+
Specifies the flow units to be used in this scenario.
|
|
612
|
+
If None, the units from the .inp file will be used.
|
|
613
|
+
|
|
614
|
+
Must be one of the following EPANET toolkit constants:
|
|
615
|
+
|
|
616
|
+
- EN_CFS = 0 (cubic foot/sec)
|
|
617
|
+
- EN_GPM = 1 (gal/min)
|
|
618
|
+
- EN_MGD = 2 (Million gal/day)
|
|
619
|
+
- EN_IMGD = 3 (Imperial MGD)
|
|
620
|
+
- EN_AFD = 4 (ac-foot/day)
|
|
621
|
+
- EN_LPS = 5 (liter/sec)
|
|
622
|
+
- EN_LPM = 6 (liter/min)
|
|
623
|
+
- EN_MLD = 7 (Megaliter/day)
|
|
624
|
+
- EN_CMH = 8 (cubic meter/hr)
|
|
625
|
+
- EN_CMD = 9 (cubic meter/day)
|
|
626
|
+
|
|
627
|
+
The default is None.
|
|
374
628
|
|
|
375
629
|
Returns
|
|
376
630
|
-------
|
|
@@ -383,10 +637,11 @@ def load_anytown(download_dir: str = get_temp_folder(), verbose: bool = True) ->
|
|
|
383
637
|
"asce-tf-wdst/Anytown.inp"
|
|
384
638
|
|
|
385
639
|
download_if_necessary(f_in, url, verbose)
|
|
386
|
-
return load_inp(f_in)
|
|
640
|
+
return load_inp(f_in, flow_units_id=flow_units_id)
|
|
387
641
|
|
|
388
642
|
|
|
389
|
-
def load_dtown(download_dir: str = get_temp_folder(), verbose: bool = True
|
|
643
|
+
def load_dtown(download_dir: str = get_temp_folder(), verbose: bool = True,
|
|
644
|
+
flow_units_id: int = None) -> ScenarioConfig:
|
|
390
645
|
"""
|
|
391
646
|
Loads (and downloads if necessary) the D-Town network.
|
|
392
647
|
|
|
@@ -400,6 +655,24 @@ def load_dtown(download_dir: str = get_temp_folder(), verbose: bool = True) -> S
|
|
|
400
655
|
If True, a progress bar is shown while downloading the file.
|
|
401
656
|
|
|
402
657
|
The default is True.
|
|
658
|
+
flow_units_id : `int`, optional
|
|
659
|
+
Specifies the flow units to be used in this scenario.
|
|
660
|
+
If None, the units from the .inp file will be used.
|
|
661
|
+
|
|
662
|
+
Must be one of the following EPANET toolkit constants:
|
|
663
|
+
|
|
664
|
+
- EN_CFS = 0 (cubic foot/sec)
|
|
665
|
+
- EN_GPM = 1 (gal/min)
|
|
666
|
+
- EN_MGD = 2 (Million gal/day)
|
|
667
|
+
- EN_IMGD = 3 (Imperial MGD)
|
|
668
|
+
- EN_AFD = 4 (ac-foot/day)
|
|
669
|
+
- EN_LPS = 5 (liter/sec)
|
|
670
|
+
- EN_LPM = 6 (liter/min)
|
|
671
|
+
- EN_MLD = 7 (Megaliter/day)
|
|
672
|
+
- EN_CMH = 8 (cubic meter/hr)
|
|
673
|
+
- EN_CMD = 9 (cubic meter/day)
|
|
674
|
+
|
|
675
|
+
The default is None.
|
|
403
676
|
|
|
404
677
|
Returns
|
|
405
678
|
-------
|
|
@@ -411,10 +684,11 @@ def load_dtown(download_dir: str = get_temp_folder(), verbose: bool = True) -> S
|
|
|
411
684
|
url = "https://www.exeter.ac.uk/media/universityofexeter/emps/research/cws/downloads/d-town.inp"
|
|
412
685
|
|
|
413
686
|
download_if_necessary(f_in, url, verbose)
|
|
414
|
-
return load_inp(f_in)
|
|
687
|
+
return load_inp(f_in, flow_units_id=flow_units_id)
|
|
415
688
|
|
|
416
689
|
|
|
417
|
-
def load_ctown(download_dir: str = get_temp_folder(), verbose: bool = True
|
|
690
|
+
def load_ctown(download_dir: str = get_temp_folder(), verbose: bool = True,
|
|
691
|
+
flow_units_id: int = None) -> ScenarioConfig:
|
|
418
692
|
"""
|
|
419
693
|
Loads (and downloads if necessary) the C-Town network.
|
|
420
694
|
|
|
@@ -428,6 +702,24 @@ def load_ctown(download_dir: str = get_temp_folder(), verbose: bool = True) -> S
|
|
|
428
702
|
If True, a progress bar is shown while downloading the file.
|
|
429
703
|
|
|
430
704
|
The default is True.
|
|
705
|
+
flow_units_id : `int`, optional
|
|
706
|
+
Specifies the flow units to be used in this scenario.
|
|
707
|
+
If None, the units from the .inp file will be used.
|
|
708
|
+
|
|
709
|
+
Must be one of the following EPANET toolkit constants:
|
|
710
|
+
|
|
711
|
+
- EN_CFS = 0 (cubic foot/sec)
|
|
712
|
+
- EN_GPM = 1 (gal/min)
|
|
713
|
+
- EN_MGD = 2 (Million gal/day)
|
|
714
|
+
- EN_IMGD = 3 (Imperial MGD)
|
|
715
|
+
- EN_AFD = 4 (ac-foot/day)
|
|
716
|
+
- EN_LPS = 5 (liter/sec)
|
|
717
|
+
- EN_LPM = 6 (liter/min)
|
|
718
|
+
- EN_MLD = 7 (Megaliter/day)
|
|
719
|
+
- EN_CMH = 8 (cubic meter/hr)
|
|
720
|
+
- EN_CMD = 9 (cubic meter/day)
|
|
721
|
+
|
|
722
|
+
The default is None.
|
|
431
723
|
|
|
432
724
|
Returns
|
|
433
725
|
-------
|
|
@@ -439,11 +731,11 @@ def load_ctown(download_dir: str = get_temp_folder(), verbose: bool = True) -> S
|
|
|
439
731
|
url = "https://github.com/scy-phy/www.batadal.net/raw/master/data/CTOWN.INP"
|
|
440
732
|
|
|
441
733
|
download_if_necessary(f_in, url, verbose)
|
|
442
|
-
return load_inp(f_in)
|
|
734
|
+
return load_inp(f_in, flow_units_id=flow_units_id)
|
|
443
735
|
|
|
444
736
|
|
|
445
737
|
def load_kentucky(wdn_id: int = 1, download_dir: str = get_temp_folder(),
|
|
446
|
-
verbose: bool = True) -> ScenarioConfig:
|
|
738
|
+
verbose: bool = True, flow_units_id: int = None) -> ScenarioConfig:
|
|
447
739
|
"""
|
|
448
740
|
Loads (and downloads if necessary) the specified Kentucky network.
|
|
449
741
|
|
|
@@ -461,6 +753,24 @@ def load_kentucky(wdn_id: int = 1, download_dir: str = get_temp_folder(),
|
|
|
461
753
|
If True, a progress bar is shown while downloading the file.
|
|
462
754
|
|
|
463
755
|
The default is True.
|
|
756
|
+
flow_units_id : `int`, optional
|
|
757
|
+
Specifies the flow units to be used in this scenario.
|
|
758
|
+
If None, the units from the .inp file will be used.
|
|
759
|
+
|
|
760
|
+
Must be one of the following EPANET toolkit constants:
|
|
761
|
+
|
|
762
|
+
- EN_CFS = 0 (cubic foot/sec)
|
|
763
|
+
- EN_GPM = 1 (gal/min)
|
|
764
|
+
- EN_MGD = 2 (Million gal/day)
|
|
765
|
+
- EN_IMGD = 3 (Imperial MGD)
|
|
766
|
+
- EN_AFD = 4 (ac-foot/day)
|
|
767
|
+
- EN_LPS = 5 (liter/sec)
|
|
768
|
+
- EN_LPM = 6 (liter/min)
|
|
769
|
+
- EN_MLD = 7 (Megaliter/day)
|
|
770
|
+
- EN_CMH = 8 (cubic meter/hr)
|
|
771
|
+
- EN_CMD = 9 (cubic meter/day)
|
|
772
|
+
|
|
773
|
+
The default is None.
|
|
464
774
|
|
|
465
775
|
Returns
|
|
466
776
|
-------
|
|
@@ -478,12 +788,12 @@ def load_kentucky(wdn_id: int = 1, download_dir: str = get_temp_folder(),
|
|
|
478
788
|
f"asce-tf-wdst/ky{wdn_id}.inp"
|
|
479
789
|
|
|
480
790
|
download_if_necessary(f_in, url, verbose)
|
|
481
|
-
return load_inp(f_in)
|
|
791
|
+
return load_inp(f_in, flow_units_id=flow_units_id)
|
|
482
792
|
|
|
483
793
|
|
|
484
794
|
def load_hanoi(download_dir: str = get_temp_folder(),
|
|
485
795
|
include_default_sensor_placement: bool = False,
|
|
486
|
-
verbose: bool = True) -> ScenarioConfig:
|
|
796
|
+
verbose: bool = True, flow_units_id: int = None) -> ScenarioConfig:
|
|
487
797
|
"""
|
|
488
798
|
Loads (and downloads if necessary) the Hanoi network.
|
|
489
799
|
|
|
@@ -501,6 +811,24 @@ def load_hanoi(download_dir: str = get_temp_folder(),
|
|
|
501
811
|
If True, a progress bar is shown while downloading the file.
|
|
502
812
|
|
|
503
813
|
The default is True.
|
|
814
|
+
flow_units_id : `int`, optional
|
|
815
|
+
Specifies the flow units to be used in this scenario.
|
|
816
|
+
If None, the units from the .inp file will be used.
|
|
817
|
+
|
|
818
|
+
Must be one of the following EPANET toolkit constants:
|
|
819
|
+
|
|
820
|
+
- EN_CFS = 0 (cubic foot/sec)
|
|
821
|
+
- EN_GPM = 1 (gal/min)
|
|
822
|
+
- EN_MGD = 2 (Million gal/day)
|
|
823
|
+
- EN_IMGD = 3 (Imperial MGD)
|
|
824
|
+
- EN_AFD = 4 (ac-foot/day)
|
|
825
|
+
- EN_LPS = 5 (liter/sec)
|
|
826
|
+
- EN_LPM = 6 (liter/min)
|
|
827
|
+
- EN_MLD = 7 (Megaliter/day)
|
|
828
|
+
- EN_CMH = 8 (cubic meter/hr)
|
|
829
|
+
- EN_CMD = 9 (cubic meter/day)
|
|
830
|
+
|
|
831
|
+
The default is None.
|
|
504
832
|
|
|
505
833
|
Returns
|
|
506
834
|
-------
|
|
@@ -513,7 +841,7 @@ def load_hanoi(download_dir: str = get_temp_folder(),
|
|
|
513
841
|
"asce-tf-wdst/Hanoi.inp"
|
|
514
842
|
|
|
515
843
|
download_if_necessary(f_in, url, verbose)
|
|
516
|
-
config = load_inp(f_in)
|
|
844
|
+
config = load_inp(f_in, flow_units_id=flow_units_id)
|
|
517
845
|
|
|
518
846
|
if include_default_sensor_placement is True:
|
|
519
847
|
sensor_config = config.sensor_config
|
|
@@ -527,7 +855,7 @@ def load_hanoi(download_dir: str = get_temp_folder(),
|
|
|
527
855
|
|
|
528
856
|
def load_ltown(download_dir: str = get_temp_folder(), use_realistic_demands: bool = False,
|
|
529
857
|
include_default_sensor_placement: bool = False,
|
|
530
|
-
verbose: bool = True) -> ScenarioConfig:
|
|
858
|
+
verbose: bool = True, flow_units_id: int = None) -> ScenarioConfig:
|
|
531
859
|
"""
|
|
532
860
|
Loads (and downloads if necessary) the L-TOWN_v2 network.
|
|
533
861
|
|
|
@@ -551,6 +879,24 @@ def load_ltown(download_dir: str = get_temp_folder(), use_realistic_demands: boo
|
|
|
551
879
|
If True, a progress bar is shown while downloading the file.
|
|
552
880
|
|
|
553
881
|
The default is True.
|
|
882
|
+
flow_units_id : `int`, optional
|
|
883
|
+
Specifies the flow units to be used in this scenario.
|
|
884
|
+
If None, the units from the .inp file will be used.
|
|
885
|
+
|
|
886
|
+
Must be one of the following EPANET toolkit constants:
|
|
887
|
+
|
|
888
|
+
- EN_CFS = 0 (cubic foot/sec)
|
|
889
|
+
- EN_GPM = 1 (gal/min)
|
|
890
|
+
- EN_MGD = 2 (Million gal/day)
|
|
891
|
+
- EN_IMGD = 3 (Imperial MGD)
|
|
892
|
+
- EN_AFD = 4 (ac-foot/day)
|
|
893
|
+
- EN_LPS = 5 (liter/sec)
|
|
894
|
+
- EN_LPM = 6 (liter/min)
|
|
895
|
+
- EN_MLD = 7 (Megaliter/day)
|
|
896
|
+
- EN_CMH = 8 (cubic meter/hr)
|
|
897
|
+
- EN_CMD = 9 (cubic meter/day)
|
|
898
|
+
|
|
899
|
+
The default is None.
|
|
554
900
|
|
|
555
901
|
Returns
|
|
556
902
|
-------
|
|
@@ -567,7 +913,7 @@ def load_ltown(download_dir: str = get_temp_folder(), use_realistic_demands: boo
|
|
|
567
913
|
url = "https://zenodo.org/records/4017659/files/L-TOWN_Real.inp?download=1"
|
|
568
914
|
|
|
569
915
|
download_if_necessary(f_in, url, verbose)
|
|
570
|
-
config = load_inp(f_in)
|
|
916
|
+
config = load_inp(f_in, flow_units_id=flow_units_id)
|
|
571
917
|
|
|
572
918
|
if include_default_sensor_placement is True:
|
|
573
919
|
sensor_config = config.sensor_config
|
|
@@ -597,7 +943,7 @@ def load_ltown(download_dir: str = get_temp_folder(), use_realistic_demands: boo
|
|
|
597
943
|
|
|
598
944
|
def load_ltown_a(download_dir: str = get_temp_folder(), use_realistic_demands: bool = False,
|
|
599
945
|
include_default_sensor_placement: bool = False,
|
|
600
|
-
verbose: bool = True) -> ScenarioConfig:
|
|
946
|
+
verbose: bool = True, flow_units_id: int = None) -> ScenarioConfig:
|
|
601
947
|
"""
|
|
602
948
|
Loads (and downloads if necessary) the L-TOWN-A network (area "A" of the L-TOWN network).
|
|
603
949
|
|
|
@@ -621,6 +967,24 @@ def load_ltown_a(download_dir: str = get_temp_folder(), use_realistic_demands: b
|
|
|
621
967
|
If True, a progress bar is shown while downloading the file.
|
|
622
968
|
|
|
623
969
|
The default is True.
|
|
970
|
+
flow_units_id : `int`, optional
|
|
971
|
+
Specifies the flow units to be used in this scenario.
|
|
972
|
+
If None, the units from the .inp file will be used.
|
|
973
|
+
|
|
974
|
+
Must be one of the following EPANET toolkit constants:
|
|
975
|
+
|
|
976
|
+
- EN_CFS = 0 (cubic foot/sec)
|
|
977
|
+
- EN_GPM = 1 (gal/min)
|
|
978
|
+
- EN_MGD = 2 (Million gal/day)
|
|
979
|
+
- EN_IMGD = 3 (Imperial MGD)
|
|
980
|
+
- EN_AFD = 4 (ac-foot/day)
|
|
981
|
+
- EN_LPS = 5 (liter/sec)
|
|
982
|
+
- EN_LPM = 6 (liter/min)
|
|
983
|
+
- EN_MLD = 7 (Megaliter/day)
|
|
984
|
+
- EN_CMH = 8 (cubic meter/hr)
|
|
985
|
+
- EN_CMD = 9 (cubic meter/day)
|
|
986
|
+
|
|
987
|
+
The default is None.
|
|
624
988
|
|
|
625
989
|
Returns
|
|
626
990
|
-------
|
|
@@ -634,7 +998,7 @@ def load_ltown_a(download_dir: str = get_temp_folder(), use_realistic_demands: b
|
|
|
634
998
|
url = f"https://filedn.com/lumBFq2P9S74PNoLPWtzxG4/EPyT-Flow/Networks/{f_inp}"
|
|
635
999
|
|
|
636
1000
|
download_if_necessary(f_in, url, verbose)
|
|
637
|
-
config = load_inp(f_in)
|
|
1001
|
+
config = load_inp(f_in, flow_units_id=flow_units_id)
|
|
638
1002
|
|
|
639
1003
|
if include_default_sensor_placement is True:
|
|
640
1004
|
sensor_config = config.sensor_config
|