epanet-plus 0.1.2__cp312-cp312-macosx_10_13_x86_64.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.
Files changed (106) hide show
  1. docs/conf.py +67 -0
  2. epanet-msx-src/dispersion.h +27 -0
  3. epanet-msx-src/hash.c +107 -0
  4. epanet-msx-src/hash.h +28 -0
  5. epanet-msx-src/include/epanetmsx.h +104 -0
  6. epanet-msx-src/include/epanetmsx_export.h +42 -0
  7. epanet-msx-src/mathexpr.c +937 -0
  8. epanet-msx-src/mathexpr.h +39 -0
  9. epanet-msx-src/mempool.c +204 -0
  10. epanet-msx-src/mempool.h +24 -0
  11. epanet-msx-src/msxchem.c +1285 -0
  12. epanet-msx-src/msxcompiler.c +368 -0
  13. epanet-msx-src/msxdict.h +42 -0
  14. epanet-msx-src/msxdispersion.c +586 -0
  15. epanet-msx-src/msxerr.c +116 -0
  16. epanet-msx-src/msxfile.c +260 -0
  17. epanet-msx-src/msxfuncs.c +175 -0
  18. epanet-msx-src/msxfuncs.h +35 -0
  19. epanet-msx-src/msxinp.c +1504 -0
  20. epanet-msx-src/msxout.c +398 -0
  21. epanet-msx-src/msxproj.c +791 -0
  22. epanet-msx-src/msxqual.c +2011 -0
  23. epanet-msx-src/msxrpt.c +400 -0
  24. epanet-msx-src/msxtank.c +422 -0
  25. epanet-msx-src/msxtoolkit.c +1164 -0
  26. epanet-msx-src/msxtypes.h +551 -0
  27. epanet-msx-src/msxutils.c +524 -0
  28. epanet-msx-src/msxutils.h +56 -0
  29. epanet-msx-src/newton.c +158 -0
  30. epanet-msx-src/newton.h +34 -0
  31. epanet-msx-src/rk5.c +287 -0
  32. epanet-msx-src/rk5.h +39 -0
  33. epanet-msx-src/ros2.c +293 -0
  34. epanet-msx-src/ros2.h +35 -0
  35. epanet-msx-src/smatrix.c +816 -0
  36. epanet-msx-src/smatrix.h +29 -0
  37. epanet-src/AUTHORS +60 -0
  38. epanet-src/LICENSE +21 -0
  39. epanet-src/enumstxt.h +151 -0
  40. epanet-src/epanet.c +5937 -0
  41. epanet-src/epanet2.c +961 -0
  42. epanet-src/epanet2.def +131 -0
  43. epanet-src/errors.dat +79 -0
  44. epanet-src/flowbalance.c +186 -0
  45. epanet-src/funcs.h +219 -0
  46. epanet-src/genmmd.c +1000 -0
  47. epanet-src/hash.c +177 -0
  48. epanet-src/hash.h +28 -0
  49. epanet-src/hydcoeffs.c +1303 -0
  50. epanet-src/hydraul.c +1164 -0
  51. epanet-src/hydsolver.c +781 -0
  52. epanet-src/hydstatus.c +442 -0
  53. epanet-src/include/epanet2.h +466 -0
  54. epanet-src/include/epanet2_2.h +1962 -0
  55. epanet-src/include/epanet2_enums.h +518 -0
  56. epanet-src/inpfile.c +884 -0
  57. epanet-src/input1.c +672 -0
  58. epanet-src/input2.c +970 -0
  59. epanet-src/input3.c +2265 -0
  60. epanet-src/leakage.c +527 -0
  61. epanet-src/mempool.c +146 -0
  62. epanet-src/mempool.h +24 -0
  63. epanet-src/output.c +853 -0
  64. epanet-src/project.c +1691 -0
  65. epanet-src/quality.c +695 -0
  66. epanet-src/qualreact.c +800 -0
  67. epanet-src/qualroute.c +696 -0
  68. epanet-src/report.c +1559 -0
  69. epanet-src/rules.c +1500 -0
  70. epanet-src/smatrix.c +871 -0
  71. epanet-src/text.h +508 -0
  72. epanet-src/types.h +928 -0
  73. epanet-src/util/cstr_helper.c +59 -0
  74. epanet-src/util/cstr_helper.h +38 -0
  75. epanet-src/util/errormanager.c +92 -0
  76. epanet-src/util/errormanager.h +39 -0
  77. epanet-src/util/filemanager.c +212 -0
  78. epanet-src/util/filemanager.h +81 -0
  79. epanet-src/validate.c +408 -0
  80. epanet.cpython-312-darwin.so +0 -0
  81. epanet_plus/VERSION +1 -0
  82. epanet_plus/__init__.py +8 -0
  83. epanet_plus/epanet_plus.c +118 -0
  84. epanet_plus/epanet_toolkit.py +2759 -0
  85. epanet_plus/epanet_wrapper.py +2434 -0
  86. epanet_plus/include/epanet_plus.h +9 -0
  87. epanet_plus-0.1.2.dist-info/METADATA +155 -0
  88. epanet_plus-0.1.2.dist-info/RECORD +106 -0
  89. epanet_plus-0.1.2.dist-info/WHEEL +6 -0
  90. epanet_plus-0.1.2.dist-info/licenses/LICENSE +21 -0
  91. epanet_plus-0.1.2.dist-info/top_level.txt +11 -0
  92. examples/basic_usage.py +35 -0
  93. examples/epanet_msx.py +35 -0
  94. python-extension/ext.c +344 -0
  95. python-extension/pyepanet.c +2150 -0
  96. python-extension/pyepanet.h +144 -0
  97. python-extension/pyepanet2.c +1835 -0
  98. python-extension/pyepanet2.h +142 -0
  99. python-extension/pyepanet_plus.c +37 -0
  100. python-extension/pyepanet_plus.h +4 -0
  101. python-extension/pyepanetmsx.c +388 -0
  102. python-extension/pyepanetmsx.h +35 -0
  103. tests/test_epanet.py +16 -0
  104. tests/test_epanetmsx.py +36 -0
  105. tests/test_epyt.py +114 -0
  106. tests/test_load_inp_from_buffer.py +18 -0
@@ -0,0 +1,2434 @@
1
+ """
2
+ This module contains a Python wrapper (incl. error handling) for EPANET and EPANET-MSX functions.
3
+ """
4
+ import warnings
5
+ import epanet
6
+
7
+
8
+ class EpanetAPI():
9
+ """
10
+ Interface for EPANET and EPANET-MSX functions, incl. a proper error handling.
11
+
12
+ Parameters
13
+ ----------
14
+ use_project : `bool`, optional
15
+ If True, projects will be used when calling EPANET functions (default in EPANET >= 2.2).
16
+ Note that this is incompatible with EPANET-MSX. Please set to False when using EPANET-MSX.
17
+
18
+ The default is False.
19
+
20
+ raise_on_error : `bool`, optional
21
+ True if an exception should be raised in the case of an error/warning, False otherwise.
22
+
23
+ The default is True.
24
+ warn_on_error : `bool`, optional
25
+ True if a warning should be generated in the case of an error/warning, False otherwise.
26
+
27
+ The default is False.
28
+ ignore_error_codes : `list[int]`, optional
29
+ List of error codes that should be ignored -- i.e., no exception or warning
30
+ will be generated.
31
+
32
+ The default is an empty list.
33
+ """
34
+ def __init__(self, use_project: bool = False, raise_exception_on_error: bool = True,
35
+ warn_on_error: bool = False, ignore_error_codes: list[int] = []):
36
+ if not isinstance(use_project, bool):
37
+ raise TypeError("'use_project' must be an instance of 'bool' " +
38
+ f"but not of '{type(use_project)}'")
39
+ if not isinstance(raise_exception_on_error, bool):
40
+ raise TypeError("'raise_exception_on_error' must be an instance of 'bool' " +
41
+ f"but not of '{type(raise_exception_on_error)}'")
42
+ if not isinstance(warn_on_error, bool):
43
+ raise TypeError("'warn_on_error' must be an instance of 'bool' " +
44
+ f"but not of type '{type(warn_on_error)}'")
45
+ if not isinstance(ignore_error_codes, list):
46
+ raise TypeError("'ignore_error_codes' must be an instance of 'list[int]' " +
47
+ f"but not of '{type(ignore_error_codes)}'")
48
+ else:
49
+ if any(not isinstance(item, int) for item in ignore_error_codes):
50
+ raise TypeError("All items in 'ignore_error_codes' must be of type 'int'")
51
+
52
+ if raise_exception_on_error is True and warn_on_error is True:
53
+ raise ValueError("'raise_exception_on_error' and 'warn_on_error' can not be both True")
54
+
55
+ self._use_project = use_project
56
+ self._ph = None
57
+ self._raise_on_error = raise_exception_on_error
58
+ self._warn_on_error = warn_on_error
59
+ self._ignore_error_codes = ignore_error_codes
60
+ self._last_error_code = 0
61
+ self._last_error_desc = None
62
+
63
+ def set_error_handling(self, raise_exception_on_error: bool, warn_on_error: bool,
64
+ ignore_error_codes: list[int] = []) -> None:
65
+ """
66
+ Specifies the behavior in the case of an error/warning --
67
+ i.e. should an exception or warning be raised or not?
68
+
69
+ Parameters
70
+ ----------
71
+ raise_exception_on_error : `bool`
72
+ True if an exception should be raised, False otherwise.
73
+ warn_on_error : `bool`
74
+ True if a warning should be generated, False otherwise.
75
+ ignore_error_codes : `list[int]`
76
+ List of error codes that should be ignored -- i.e., no exception or
77
+ warning will be generated.
78
+ """
79
+ self._raise_on_error = raise_exception_on_error
80
+ self._warn_on_error = warn_on_error
81
+ self._ignore_error_codes = ignore_error_codes
82
+
83
+ def get_last_error_desc(self) -> str:
84
+ """
85
+ Returns the description of the last EPANET-(MSX) error/warning (if any).
86
+
87
+ Returns
88
+ -------
89
+ `str`
90
+ Description of the last error/warning. None, if there was no error/warning.
91
+ """
92
+ return self._last_error_desc
93
+
94
+ def get_last_error_code(self) -> int:
95
+ """
96
+ Returns the code of the last EPANET-(MSX) error/warnning (if any).
97
+
98
+ Refer to the `EPANET documentation <http://wateranalytics.org/EPANET/group___warning_codes.html>`_
99
+ for a list of all possible warning codes and their meanings.
100
+
101
+ Returns
102
+ -------
103
+ `int`
104
+ Code of the last error/warning. 0, if there was no error/warning.
105
+ """
106
+ return self._last_error_code
107
+
108
+ def was_last_func_successful(self) -> bool:
109
+ """
110
+ Checks if the last EPANET call was successful or not.
111
+
112
+ Parameters
113
+ ----------
114
+ `bool`
115
+ True if the last EPANET call returned an error/warning, False otherwise.
116
+ """
117
+ return self._last_error_desc is None
118
+
119
+ def _reset_error(self) -> None:
120
+ self._last_error_code = 0
121
+ self._last_error_desc = None
122
+
123
+ def _process_result(self, ret: tuple, msx_call: bool = False):
124
+ ret_other = None
125
+ if len(ret) == 1:
126
+ errcode = ret[0]
127
+ else:
128
+ errcode, *ret_other = ret
129
+
130
+ if errcode != 0:
131
+ self._last_error_code = errcode
132
+ if msx_call is False:
133
+ self._last_error_desc = self.geterror(errcode)
134
+ else:
135
+ self._last_error_desc = self.MSXgeterror(errcode)
136
+
137
+ if self._last_error_code not in self._ignore_error_codes:
138
+ if self._warn_on_error:
139
+ warnings.warn(self._last_error_desc, RuntimeWarning)
140
+ if self._raise_on_error:
141
+ raise RuntimeError(self._last_error_desc)
142
+
143
+ if ret_other is not None and len(ret_other) == 1:
144
+ return ret_other[0]
145
+ else:
146
+ return ret_other
147
+
148
+ @property
149
+ def use_project(self) -> bool:
150
+ """
151
+ Returns whether EPANET projects are used or not.
152
+
153
+ Returns
154
+ -------
155
+ `bool`
156
+ True, if EPANET projects are used, False otherwise.
157
+ """
158
+ return self._use_project
159
+
160
+ @property
161
+ def ph(self) -> int:
162
+ """
163
+ Returns a pointer (memory address) to the project structure.
164
+
165
+ Returns
166
+ -------
167
+ `int`
168
+ Pointer to project structure -- please do not change or access the memory location!
169
+ """
170
+ return self._ph
171
+
172
+ def openfrombuffer(self, inpBuffer: str, inpFile: str, rptFile: str, outFile: str):
173
+ """
174
+ EN_openfrombuffer -- extension of EPANET and part of EPANET-PLUS
175
+
176
+ Parameters
177
+ ----------
178
+ inpBuffer : `str`
179
+ inpFile : `str`
180
+ rptFile : `str`
181
+ outFile : `str`
182
+ """
183
+ if self._use_project is False:
184
+ return self._process_result(epanet.ENopenfrombuffer(inpBuffer, inpFile, rptFile,
185
+ outFile))
186
+ else:
187
+ return self._process_result(epanet.EN_openfrombuffer(inpBuffer, inpFile, rptFile,
188
+ outFile))
189
+
190
+ def createproject(self):
191
+ """
192
+ EN_createproject
193
+ """
194
+ if self._use_project is False:
195
+ raise ValueError("Can not create project because of use_project=False")
196
+ else:
197
+ self._ph = self._process_result(epanet.EN_createproject())
198
+
199
+ def deleteproject(self):
200
+ """
201
+ EN_deleteproject
202
+ """
203
+ if self._use_project is False:
204
+ raise ValueError("Can not delete project because of use_project=False")
205
+ else:
206
+ if self._ph is not None:
207
+ res = self._process_result(epanet.EN_deleteproject(self._ph))
208
+ self._ph = None
209
+
210
+ return res
211
+
212
+ def init(self, rptFile: str, outFile: str, unitsType: int, headLossType: int):
213
+ """
214
+ EN_init
215
+
216
+ Parameters
217
+ ----------
218
+ rptFile : `str`
219
+ outFile : `str`
220
+ unitsType : `int`
221
+ headLossType : `int`
222
+ """
223
+ if self._use_project is False:
224
+ return self._process_result(epanet.ENinit(rptFile, outFile, unitsType, headLossType))
225
+ else:
226
+ return self._process_result(epanet.EN_init(self._ph, rptFile, outFile, unitsType,
227
+ headLossType))
228
+
229
+ def open(self, inpFile: str, rptFile: str, outFile: str):
230
+ """
231
+ EN_open
232
+
233
+ Parameters
234
+ ----------
235
+ inpFile : `str`
236
+ rptFile : `str`
237
+ outFile : `str`
238
+ """
239
+ if self._use_project is False:
240
+ return self._process_result(epanet.ENopen(inpFile, rptFile, outFile))
241
+ else:
242
+ return self._process_result(epanet.EN_open(self._ph, inpFile, rptFile, outFile))
243
+
244
+ def openX(self, inpFile: str, rptFile: str, outFile: str):
245
+ """
246
+ EN_openX
247
+
248
+ Parameters
249
+ ----------
250
+ inpFile : `str`
251
+ rptFile : `str`
252
+ outFile : `str`
253
+ """
254
+ if self._use_project is False:
255
+ return self._process_result(epanet.ENopenX(inpFile, rptFile, outFile))
256
+ else:
257
+ return self._process_result(epanet.EN_openX(self._ph, inpFile, rptFile, outFile))
258
+
259
+ def gettitle(self):
260
+ """
261
+ EN_gettitle
262
+ """
263
+ if self._use_project is False:
264
+ return self._process_result(epanet.ENgettitle())
265
+ else:
266
+ return self._process_result(epanet.EN_gettitle(self._ph))
267
+
268
+ def settitle(self, line1: str, line2: str, line3: str):
269
+ """
270
+ EN_settitle
271
+
272
+ Parameters
273
+ ----------
274
+ line1: str
275
+ line2: str
276
+ line3: str
277
+ """
278
+ if self._use_project is False:
279
+ return self._process_result(epanet.ENsettitle(line1, line2, line3))
280
+ else:
281
+ return self._process_result(epanet.EN_settitle(self._ph, line1, line2, line3))
282
+
283
+ def getcomment(self, obj: int, index: int):
284
+ """
285
+ EN_getcomment
286
+
287
+ Parameters
288
+ ----------
289
+ obj : `int`
290
+ index : `int`
291
+ """
292
+ if self._use_project is False:
293
+ return self._process_result(epanet.ENgetcomment(obj, index))
294
+ else:
295
+ return self._process_result(epanet.EN_getcomment(self._ph, obj, index))
296
+
297
+ def setcomment(self, obj: int, index: int, comment: str):
298
+ """
299
+ EN_setcomment
300
+
301
+ Parameters
302
+ ----------
303
+ obj : `int`
304
+ index : `int`
305
+ comment : `str`
306
+ """
307
+ if self._use_project is False:
308
+ return self._process_result(epanet.ENsetcomment(obj, index, comment))
309
+ else:
310
+ return self._process_result(epanet.EN_setcomment(self._ph, obj, index, comment))
311
+
312
+ def getcount(self, obj: int):
313
+ """
314
+ EN_getcount
315
+
316
+ Parameters
317
+ ----------
318
+ obj : `int`
319
+ """
320
+ if self._use_project is False:
321
+ return self._process_result(epanet.ENgetcount(obj))
322
+ else:
323
+ return self._process_result(epanet.EN_getcount(self._ph, obj))
324
+
325
+ def saveinpfile(self, filename: str):
326
+ """
327
+ EN_saveinpfile
328
+
329
+ Parameters
330
+ ----------
331
+ filename : `str`
332
+ """
333
+ if self._use_project is False:
334
+ return self._process_result(epanet.ENsaveinpfile(filename))
335
+ else:
336
+ return self._process_result(epanet.EN_saveinpfile(self._ph, filename))
337
+
338
+ def close(self):
339
+ """
340
+ EN_close
341
+ """
342
+ if self._use_project is False:
343
+ return self._process_result(epanet.ENclose())
344
+ else:
345
+ if self._ph is not None:
346
+ return self._process_result(epanet.EN_close(self._ph))
347
+
348
+ def solveH(self):
349
+ """
350
+ EN_solveH
351
+ """
352
+ if self._use_project is False:
353
+ return self._process_result(epanet.ENsolveH())
354
+ else:
355
+ return self._process_result(epanet.EN_solveH(self._ph))
356
+
357
+ def usehydfile(self, filename: str):
358
+ """
359
+ EN_usehydfile
360
+
361
+ Parameters
362
+ ----------
363
+ filename : `str`
364
+ """
365
+ if self._use_project is False:
366
+ return self._process_result(epanet.ENusehydfile(filename))
367
+ else:
368
+ return self._process_result(epanet.EN_usehydfile(filename))
369
+
370
+ def openH(self):
371
+ """
372
+ EN_openH
373
+ """
374
+ if self._use_project is False:
375
+ return self._process_result(epanet.ENopenH())
376
+ else:
377
+ return self._process_result(epanet.EN_openH(self._ph))
378
+
379
+ def initH(self, initFlag: int):
380
+ """
381
+ EN_initH
382
+
383
+ Parameters
384
+ ----------
385
+ initFlag : `int`
386
+ """
387
+ if self._use_project is False:
388
+ return self._process_result(epanet.ENinitH(initFlag))
389
+ else:
390
+ return self._process_result(epanet.EN_initH(self._ph, initFlag))
391
+
392
+ def runH(self):
393
+ """
394
+ EN_runH
395
+ """
396
+ if self._use_project is False:
397
+ return self._process_result(epanet.ENrunH())
398
+ else:
399
+ return self._process_result(epanet.EN_runH(self._ph))
400
+
401
+ def nextH(self):
402
+ """
403
+ EN_nextH
404
+ """
405
+ if self._use_project is False:
406
+ return self._process_result(epanet.ENnextH())
407
+ else:
408
+ return self._process_result(epanet.EN_nextH(self._ph))
409
+
410
+ def saveH(self):
411
+ """
412
+ EN_saveH
413
+ """
414
+ if self._use_project is False:
415
+ return self._process_result(epanet.ENsaveH())
416
+ else:
417
+ return self._process_result(epanet.EN_saveH(self._ph))
418
+
419
+ def savehydfile(self, filename):
420
+ """
421
+ EN_savehydfile
422
+
423
+ Parameters
424
+ ----------
425
+ filename : `str`
426
+ """
427
+ if self._use_project is False:
428
+ return self._process_result(epanet.ENsavehydfile(filename))
429
+ else:
430
+ return self._process_result(epanet.EN_savehydfile(self._ph, filename))
431
+
432
+ def closeH(self):
433
+ """
434
+ EN_closeH
435
+ """
436
+ if self._use_project is False:
437
+ return self._process_result(epanet.ENcloseH())
438
+ else:
439
+ return self._process_result(epanet.EN_closeH(self._ph))
440
+
441
+ def solveQ(self):
442
+ """
443
+ EN_solveQ
444
+ """
445
+ if self._use_project is False:
446
+ return self._process_result(epanet.ENsolveQ())
447
+ else:
448
+ return self._process_result(epanet.EN_solveQ(self._ph))
449
+
450
+ def openQ(self):
451
+ """
452
+ EN_openQ
453
+ """
454
+ if self._use_project is False:
455
+ return self._process_result(epanet.ENopenQ())
456
+ else:
457
+ return self._process_result(epanet.EN_openQ(self._ph))
458
+
459
+ def initQ(self, save_flag: int):
460
+ """
461
+ EN_initQ
462
+
463
+ Parameters
464
+ ----------
465
+ save_flag : `int`
466
+ """
467
+ if self._use_project is False:
468
+ return self._process_result(epanet.ENinitQ(save_flag))
469
+ else:
470
+ return self._process_result(epanet.EN_initQ(self._ph, save_flag))
471
+
472
+ def runQ(self):
473
+ """
474
+ EN_runQ
475
+ """
476
+ if self._use_project is False:
477
+ return self._process_result(epanet.ENrunQ())
478
+ else:
479
+ return self._process_result(epanet.EN_runQ(self._ph))
480
+
481
+ def nextQ(self):
482
+ """
483
+ EN_nextQ
484
+ """
485
+ if self._use_project is False:
486
+ return self._process_result(epanet.ENnextQ())
487
+ else:
488
+ return self._process_result(epanet.EN_nextQ(self._ph))
489
+
490
+ def stepQ(self):
491
+ """
492
+ EN_stepQ
493
+ """
494
+ if self._use_project is False:
495
+ return self._process_result(epanet.ENstepQ())
496
+ else:
497
+ return self._process_result(epanet.EN_stepQ(self._ph))
498
+
499
+ def closeQ(self):
500
+ """
501
+ EN_closeQ
502
+ """
503
+ if self._use_project is False:
504
+ return self._process_result(epanet.ENcloseQ())
505
+ else:
506
+ return self._process_result(epanet.EN_closeQ(self._ph))
507
+
508
+ def writeline(self, line: str):
509
+ """
510
+ EN_writeline
511
+
512
+ Parameters
513
+ ----------
514
+ line : `str`
515
+ """
516
+ if self._use_project is False:
517
+ return self._process_result(epanet.ENwriteline(line))
518
+ else:
519
+ return self._process_result(epanet.EN_writeline(self._ph, line))
520
+
521
+ def report(self):
522
+ """
523
+ EN_report
524
+ """
525
+ if self._use_project is False:
526
+ return self._process_result(epanet.ENreport())
527
+ else:
528
+ return self._process_result(epanet.EN_report(self._ph))
529
+
530
+ def copyreport(self):
531
+ """
532
+ EN_copyreport
533
+ """
534
+ if self._use_project is False:
535
+ return self._process_result(epanet.ENcopyreport())
536
+ else:
537
+ return self._process_result(epanet.EN_copyreport(self._ph))
538
+
539
+ def clearreport(self):
540
+ """
541
+ EN_clearreport
542
+ """
543
+ if self._use_project is False:
544
+ return self._process_result(epanet.ENclearreport())
545
+ else:
546
+ return self._process_result(epanet.EN_clearreport(self._ph))
547
+
548
+ def resetreport(self):
549
+ """
550
+ EN_resetreport
551
+ """
552
+ if self._use_project is False:
553
+ return self._process_result(epanet.ENresetreport())
554
+ else:
555
+ return self._process_result(epanet.EN_resetreport(self._ph))
556
+
557
+ def setreport(self, format_desc: str):
558
+ """
559
+ EN_setreport
560
+
561
+ Parameters
562
+ ----------
563
+ format_desc : `str`
564
+ """
565
+ if self._use_project is False:
566
+ return self._process_result(epanet.ENsetreport(format_desc))
567
+ else:
568
+ return self._process_result(epanet.EN_setreport(self._ph, format_desc))
569
+
570
+ def setstatusreport(self, level: int):
571
+ """
572
+ EN_setstatusreport
573
+
574
+ Parameters
575
+ ----------
576
+ level : `int`
577
+ """
578
+ if self._use_project is False:
579
+ return self._process_result(epanet.ENsetstatusreport(level))
580
+ else:
581
+ return self._process_result(epanet.EN_setstatusreport(self._ph, level))
582
+
583
+ def getversion(self):
584
+ """
585
+ EN_getversion
586
+ """
587
+ if self._use_project is False:
588
+ return self._process_result(epanet.ENgetversion())
589
+ else:
590
+ return self._process_result(epanet.EN_getversion())
591
+
592
+ def geterror(self, error_code: int):
593
+ """
594
+ EN_geterror
595
+
596
+ Parameters
597
+ ----------
598
+ error_code : `int`
599
+ """
600
+ if self._use_project is False:
601
+ err, err_msg = epanet.ENgeterror(error_code)
602
+ else:
603
+ err, err_msg = epanet.EN_geterror(error_code)
604
+
605
+ if err != 0:
606
+ raise RuntimeError("Failed to get error message")
607
+
608
+ return err_msg
609
+
610
+ def getstatistic(self, stat_type: int):
611
+ """
612
+ EN_getstatistic
613
+
614
+ Parameters
615
+ ----------
616
+ stat_type : `int`
617
+ """
618
+ if self._use_project is False:
619
+ return self._process_result(epanet.ENgetstatistic(stat_type))
620
+ else:
621
+ return self._process_result(epanet.EN_getstatistic(self._ph, stat_type))
622
+
623
+ def getresultindex(self, result_type: int, index: int):
624
+ """
625
+ EN_getresultindex
626
+
627
+ Parameters
628
+ ----------
629
+ result_type : `int`
630
+ index : `int`
631
+ """
632
+ if self._use_project is False:
633
+ return self._process_result(epanet.ENgetresultindex(result_type, index))
634
+ else:
635
+ return self._process_result(epanet.EN_getresultindex(self._ph, result_type, index))
636
+
637
+ def getoption(self, option: int):
638
+ """
639
+ EN_getoption
640
+
641
+ Parameters
642
+ ----------
643
+ option : `int`
644
+ """
645
+ if self._use_project is False:
646
+ return self._process_result(epanet.ENgetoption(option))
647
+ else:
648
+ return self._process_result(epanet.EN_getoption(self._ph, option))
649
+
650
+ def setoption(self, option: int, value: float):
651
+ """
652
+ EN_setoption
653
+
654
+ Parameters
655
+ ----------
656
+ option : `int`
657
+ value : `float`
658
+ """
659
+ if self._use_project is False:
660
+ return self._process_result(epanet.ENsetoption(option, value))
661
+ else:
662
+ return self._process_result(epanet.EN_setoption(self._ph, option, value))
663
+
664
+ def getflowunits(self):
665
+ """
666
+ EN_getflowunits
667
+ """
668
+ if self._use_project is False:
669
+ return self._process_result(epanet.ENgetflowunits())
670
+ else:
671
+ return self._process_result(epanet.EN_getflowunits(self._ph))
672
+
673
+ def setflowunits(self, units: int):
674
+ """
675
+ EN_setflowunits
676
+
677
+ Parameters
678
+ ----------
679
+ units : `int`
680
+ """
681
+ if self._use_project is False:
682
+ return self._process_result(epanet.ENsetflowunits(units))
683
+ else:
684
+ return self._process_result(epanet.EN_setflowunits(self._ph, units))
685
+
686
+ def gettimeparam(self, param: int):
687
+ """
688
+ EN_gettimeparam
689
+
690
+ Parameters
691
+ ----------
692
+ param : `int`
693
+ """
694
+ if self._use_project is False:
695
+ return self._process_result(epanet.ENgettimeparam(param))
696
+ else:
697
+ return self._process_result(epanet.EN_gettimeparam(self._ph, param))
698
+
699
+ def settimeparam(self, param: int, value: int):
700
+ """
701
+ EN_settimeparam
702
+
703
+ Parameters
704
+ ----------
705
+ param : `int`
706
+ value : `int`
707
+ """
708
+ if self._use_project is False:
709
+ return self._process_result(epanet.ENsettimeparam(param, value))
710
+ else:
711
+ return self._process_result(epanet.EN_settimeparam(self._ph, param, value))
712
+
713
+ def getqualinfo(self):
714
+ """
715
+ EN_getqualinfo
716
+ """
717
+ if self._use_project is False:
718
+ return self._process_result(epanet.ENgetqualinfo())
719
+ else:
720
+ return self._process_result(epanet.EN_getqualinfo(self._ph))
721
+
722
+ def getqualtype(self):
723
+ """
724
+ EN_getqualtype
725
+ """
726
+ if self._use_project is False:
727
+ return self._process_result(epanet.ENgetqualtype())
728
+ else:
729
+ return self._process_result(epanet.EN_getqualtype(self._ph))
730
+
731
+ def setqualtype(self, qual_type: int, chem_name: str, chem_units: str, trace_node_id: str):
732
+ """
733
+ EN_setqualtype
734
+
735
+ Parameters
736
+ ----------
737
+ qual_type : `int`
738
+ chem_name : `str`
739
+ chem_units : `str`
740
+ trace_node_id : `str`
741
+ """
742
+ if self._use_project is False:
743
+ return self._process_result(epanet.ENsetqualtype(qual_type, chem_name, chem_units,
744
+ trace_node_id))
745
+ else:
746
+ return self._process_result(epanet.EN_setqualtype(self._ph, qual_type, chem_name,
747
+ chem_units, trace_node_id))
748
+
749
+ def addnode(self, node_id: str, node_type: int):
750
+ """
751
+ EN_addnode
752
+
753
+ Parameters
754
+ ----------
755
+ node_id : `str`
756
+ node_type : `int`
757
+ """
758
+ if self._use_project is False:
759
+ return self._process_result(epanet.ENaddnode(node_id, node_type))
760
+ else:
761
+ return self._process_result(epanet.EN_addnode(self._ph, node_id, node_type))
762
+
763
+ def deletenode(self, index: int, action_code: int):
764
+ """
765
+ EN_deletenode
766
+
767
+ Parameters
768
+ ----------
769
+ index : `int`
770
+ action_code : `int`
771
+ """
772
+ if self._use_project is False:
773
+ return self._process_result(epanet.ENdeletenode(index, action_code))
774
+ else:
775
+ return self._process_result(epanet.EN_deletenode(self._ph, index, action_code))
776
+
777
+ def getnodeindex(self, node_id: str):
778
+ """
779
+ EN_getnodeindex
780
+
781
+ Parameters
782
+ ----------
783
+ node_id : `str`
784
+ """
785
+ if self._use_project is False:
786
+ return self._process_result(epanet.ENgetnodeindex(node_id))
787
+ else:
788
+ return self._process_result(epanet.EN_getnodeindex(self._ph, node_id))
789
+
790
+ def getnodeid(self, index: int):
791
+ """
792
+ EN_getnodeid
793
+
794
+ Parameters
795
+ ----------
796
+ index : `int`
797
+ """
798
+ if self._use_project is False:
799
+ return self._process_result(epanet.ENgetnodeid(index))
800
+ else:
801
+ return self._process_result(epanet.EN_getnodeid(self._ph, index))
802
+
803
+ def setnodeid(self, index: int, new_id: str):
804
+ """
805
+ EN_setnodeid
806
+
807
+ Parameters
808
+ ----------
809
+ index : `int`
810
+ new_id : `str`
811
+ """
812
+ if self._use_project is False:
813
+ return self._process_result(epanet.ENsetnodeid(index, new_id))
814
+ else:
815
+ return self._process_result(epanet.EN_setnodeid(self._ph, index, new_id))
816
+
817
+ def getnodetype(self, index: int):
818
+ """
819
+ EN_getnodetype
820
+
821
+ Parameters
822
+ ----------
823
+ index : `int`
824
+ """
825
+ if self._use_project is False:
826
+ return self._process_result(epanet.ENgetnodetype(index))
827
+ else:
828
+ return self._process_result(epanet.EN_getnodetype(self._ph, index))
829
+
830
+ def getnodevalue(self, index: int, node_property: int):
831
+ """
832
+ EN_getnodevalue
833
+
834
+ Parameters
835
+ ----------
836
+ index : `int`
837
+ node_property : `int`
838
+ """
839
+ if self._use_project is False:
840
+ return self._process_result(epanet.ENgetnodevalue(index, node_property))
841
+ else:
842
+ return self._process_result(epanet.EN_getnodevalue(self._ph, index, node_property))
843
+
844
+ def setnodevalue(self, index: int, node_property: int, value: float):
845
+ """
846
+ EN_setnodevalue
847
+
848
+ Parameters
849
+ ----------
850
+ index : `int`
851
+ node_property : `int`
852
+ value : `float`
853
+ """
854
+ if self._use_project is False:
855
+ return self._process_result(epanet.ENsetnodevalue(index, node_property, value))
856
+ else:
857
+ return self._process_result(epanet.EN_setnodevalue(self._ph, index, node_property,
858
+ value))
859
+
860
+ def setjuncdata(self, index: int, elev: float, dmnd: float, dmnd_pat: str):
861
+ """
862
+ EN_setjuncdata
863
+
864
+ Parameters
865
+ ----------
866
+ index : `int`
867
+ elev : `float`
868
+ dmnd : `float`
869
+ dmdn_pat : `float`
870
+ """
871
+ if self._use_project is False:
872
+ return self._process_result(epanet.ENsetjuncdata(index, elev, dmnd, dmnd_pat))
873
+ else:
874
+ return self._process_result(epanet.EN_setjuncdata(self._ph, index, elev, dmnd,
875
+ dmnd_pat))
876
+
877
+ def settankdata(self, index: int, elev: float, initlvl: float, minlvl: float, maxlvl: float,
878
+ diam: float, minvol: float, volcurve: str):
879
+ """
880
+ EN_settankdata
881
+
882
+ Parameters
883
+ ----------
884
+ index : `int`
885
+ elev : `float`
886
+ initlvl : `float`
887
+ minlvl : `float`
888
+ maxlvl : `float`
889
+ diam : `float`
890
+ minvol : `float`
891
+ volcurve : `str`
892
+ """
893
+ if self._use_project is False:
894
+ return self._process_result(epanet.ENsettankdata(index, elev, initlvl, minlvl, maxlvl,
895
+ diam, minvol, volcurve))
896
+ else:
897
+ return self._process_result(epanet.EN_settankdata(self._ph, index, elev, initlvl,
898
+ minlvl, maxlvl, diam, minvol,
899
+ volcurve))
900
+
901
+ def getcoord(self, index: int):
902
+ """
903
+ EN_getcoord
904
+
905
+ Parameters
906
+ ----------
907
+ index : `int`
908
+ """
909
+ if self._use_project is False:
910
+ return self._process_result(epanet.ENgetcoord(index))
911
+ else:
912
+ return self._process_result(epanet.EN_getcoord(self._ph, index))
913
+
914
+ def setcoord(self, index: int, x: float, y: float):
915
+ """
916
+ EN_setcoord
917
+
918
+ Parameters
919
+ ----------
920
+ index : `int`
921
+ x : `float`
922
+ y : `float`
923
+ """
924
+ if self._use_project is False:
925
+ return self._process_result(epanet.ENsetcoord(index, x, y))
926
+ else:
927
+ return self._process_result(epanet.EN_setcoord(self._ph, index, x, y))
928
+
929
+ def getdemandmodel(self):
930
+ """
931
+ EN_getdemandmodel
932
+ """
933
+ if self._use_project is False:
934
+ return self._process_result(epanet.ENgetdemandmodel())
935
+ else:
936
+ return self._process_result(epanet.EN_getdemandmodel(self._ph))
937
+
938
+ def setdemandmodel(self, demand_type: int, pmin: float, preq: float, pexp: float):
939
+ """
940
+ EN_setdemandmodel
941
+
942
+ Parameters
943
+ ----------
944
+ demand_type : `int`
945
+ pmin : `float`
946
+ preq : `float`
947
+ pexp : `float`
948
+ """
949
+ if self._use_project is False:
950
+ return self._process_result(epanet.ENsetdemandmodel(demand_type, pmin, preq, pexp))
951
+ else:
952
+ return self._process_result(epanet.EN_setdemandmodel(self._ph, demand_type,
953
+ pmin, preq, pexp))
954
+
955
+ def adddemand(self, node_index: int, base_demand: float, demand_pattern: str, demand_name: str):
956
+ """
957
+ EN_adddemand
958
+
959
+ node_index : `int`
960
+ base_demand : `float`
961
+ demand_pattern : `str`
962
+ demand_name : `str`
963
+ """
964
+ if self._use_project is False:
965
+ return self._process_result(epanet.ENadddemand(node_index, base_demand, demand_pattern,
966
+ demand_name))
967
+ else:
968
+ return self._process_result(epanet.EN_adddemand(self._ph, node_index, base_demand,
969
+ demand_pattern, demand_name))
970
+
971
+ def deletedemand(self, node_index: int, demand_index: int):
972
+ """
973
+ EN_deletedemand
974
+
975
+ Parameters
976
+ ----------
977
+ node_index : `int`
978
+ demand_index : `int`
979
+ """
980
+ if self._use_project is False:
981
+ return self._process_result(epanet.ENdeletedemand(node_index, demand_index))
982
+ else:
983
+ return self._process_result(epanet.EN_deletedemand(self._ph, node_index, demand_index))
984
+
985
+ def getdemandindex(self, node_index: int, demand_name: str):
986
+ """
987
+ EN_getdemandindex
988
+
989
+ Parameters
990
+ ----------
991
+ node_index : `int`
992
+ demand_name : `str`
993
+ """
994
+ if self._use_project is False:
995
+ return self._process_result(epanet.ENgetdemandindex(node_index, demand_name))
996
+ else:
997
+ return self._process_result(epanet.EN_getdemandindex(self._ph, node_index, demand_name))
998
+
999
+ def getnumdemands(self, node_index: int):
1000
+ """
1001
+ EN_getnumdemands
1002
+
1003
+ Parameters
1004
+ ----------
1005
+ node_index : `int`
1006
+ """
1007
+ if self._use_project is False:
1008
+ return self._process_result(epanet.ENgetnumdemands(node_index))
1009
+ else:
1010
+ return self._process_result(epanet.EN_getnumdemands(self._ph, node_index))
1011
+
1012
+ def getbasedemand(self, node_index: int, demand_index: int):
1013
+ """
1014
+ EN_getbasedemand
1015
+
1016
+ Parameters
1017
+ ----------
1018
+ node_index : `int`
1019
+ demand_index : `int`
1020
+ """
1021
+ if self._use_project is False:
1022
+ return self._process_result(epanet.ENgetbasedemand(node_index, demand_index))
1023
+ else:
1024
+ return self._process_result(epanet.EN_getbasedemand(self._ph, node_index, demand_index))
1025
+
1026
+ def setbasedemand(self, node_index: int, demand_index: int, base_demand: float):
1027
+ """
1028
+ EN_setbasedemand
1029
+
1030
+ Parameters
1031
+ ----------
1032
+ node_index : `int`
1033
+ demand_index : `int`
1034
+ base_demand : `float`
1035
+ """
1036
+ if self._use_project is False:
1037
+ return self._process_result(epanet.ENsetbasedemand(node_index, demand_index,
1038
+ base_demand))
1039
+ else:
1040
+ return self._process_result(epanet.EN_setbasedemand(self._ph, node_index, demand_index,
1041
+ base_demand))
1042
+
1043
+ def getdemandpattern(self, node_index: int, demand_index: int):
1044
+ """
1045
+ EN_getdemandpattern
1046
+
1047
+ Parameters
1048
+ ----------
1049
+ node_index : `int`
1050
+ demand_index : `int`
1051
+ """
1052
+ if self._use_project is False:
1053
+ return self._process_result(epanet.ENgetdemandpattern(node_index, demand_index))
1054
+ else:
1055
+ return self._process_result(epanet.EN_getdemandpattern(self._ph, node_index,
1056
+ demand_index))
1057
+
1058
+ def setdemandpattern(self, node_index: int, demand_index: int, pat_index: int):
1059
+ """
1060
+ EN_setdemandpattern
1061
+
1062
+ Parameters
1063
+ ----------
1064
+ node_index : `int`
1065
+ demand_index : `int`
1066
+ pat_index : `int`
1067
+ """
1068
+ if self._use_project is False:
1069
+ return self._process_result(epanet.ENsetdemandpattern(node_index, demand_index,
1070
+ pat_index))
1071
+ else:
1072
+ return self._process_result(epanet.EN_setdemandpattern(self._ph, node_index,
1073
+ demand_index, pat_index))
1074
+
1075
+ def getdemandname(self, node_index: int, demand_index: int):
1076
+ """
1077
+ EN_getdemandname
1078
+
1079
+ Parameters
1080
+ ----------
1081
+ node_index : `int`
1082
+ demand_index : `int`
1083
+ """
1084
+ if self._use_project is False:
1085
+ return self._process_result(epanet.ENgetdemandname(node_index, demand_index))
1086
+ else:
1087
+ return self._process_result(epanet.EN_getdemandname(self._ph, node_index, demand_index))
1088
+
1089
+ def setdemandname(self, node_index: int, demand_index: int, demand_name: str):
1090
+ """
1091
+ EN_setdemandname
1092
+
1093
+ Parameters
1094
+ ----------
1095
+ node_index : `int`
1096
+ demand_index : `int`
1097
+ demand_name : `str`
1098
+ """
1099
+ if self._use_project is False:
1100
+ return self._process_result(epanet.ENsetdemandname(node_index, demand_index,
1101
+ demand_name))
1102
+ else:
1103
+ return self._process_result(epanet.EN_setdemandname(self._ph, node_index, demand_index,
1104
+ demand_name))
1105
+
1106
+ def addlink(self, id: str, link_type: int, from_node: str, to_node: str):
1107
+ """
1108
+ EN_addlink
1109
+
1110
+ Parameters
1111
+ ----------
1112
+ id : `str`
1113
+ link_type : `int`
1114
+ from_node : `str`
1115
+ to_node : `str`
1116
+ """
1117
+ if self._use_project is False:
1118
+ return self._process_result(epanet.ENaddlink(id, link_type, from_node, to_node))
1119
+ else:
1120
+ return self._process_result(epanet.EN_addlink(self._ph, id, link_type, from_node,
1121
+ to_node))
1122
+
1123
+ def deletelink(self, index: int, action_code: int):
1124
+ """
1125
+ EN_deletelink
1126
+
1127
+ Parameters
1128
+ ----------
1129
+ index : `int`
1130
+ action_code : `int`
1131
+ """
1132
+ if self._use_project is False:
1133
+ return self._process_result(epanet.ENdeletelink(index, action_code))
1134
+ else:
1135
+ return self._process_result(epanet.EN_deletelink(self._ph, index, action_code))
1136
+
1137
+ def getlinkindex(self, link_id: str):
1138
+ """
1139
+ EN_getlinkindex
1140
+
1141
+ Parameters
1142
+ ----------
1143
+ link_id : `str`
1144
+ """
1145
+ if self._use_project is False:
1146
+ return self._process_result(epanet.ENgetlinkindex(link_id))
1147
+ else:
1148
+ return self._process_result(epanet.EN_getlinkindex(self._ph, link_id))
1149
+
1150
+ def getlinkid(self, index: int):
1151
+ """
1152
+ EN_getlinkid
1153
+
1154
+ Parameters
1155
+ ----------
1156
+ index : `int`
1157
+ """
1158
+ if self._use_project is False:
1159
+ return self._process_result(epanet.ENgetlinkid(index))
1160
+ else:
1161
+ return self._process_result(epanet.EN_getlinkid(self._ph, index))
1162
+
1163
+ def setlinkid(self, index: int, new_id: str):
1164
+ """
1165
+ EN_setlinkid
1166
+
1167
+ Parameters
1168
+ ----------
1169
+ index : `int`
1170
+ new_id : `str`
1171
+ """
1172
+ if self._use_project is False:
1173
+ return self._process_result(epanet.ENsetlinkid(index, new_id))
1174
+ else:
1175
+ return self._process_result(epanet.EN_setlinkid(self._ph, index, new_id))
1176
+
1177
+ def getlinktype(self, index: int):
1178
+ """
1179
+ EN_getlinktype
1180
+
1181
+ Parameters
1182
+ ----------
1183
+ index : `int`
1184
+ """
1185
+ if self._use_project is False:
1186
+ return self._process_result(epanet.ENgetlinktype(index))
1187
+ else:
1188
+ return self._process_result(epanet.EN_getlinktype(self._ph, index))
1189
+
1190
+ def setlinktype(self, index: int, link_type: int, action_code: int):
1191
+ """
1192
+ EN_setlinktype
1193
+
1194
+ Parameters
1195
+ ----------
1196
+ index : `int`
1197
+ link_type : `int`
1198
+ action_code : `int`
1199
+ """
1200
+ if self._use_project is False:
1201
+ return self._process_result(epanet.ENsetlinktype(index, link_type, action_code))
1202
+ else:
1203
+ return self._process_result(epanet.EN_setlinktype(self._ph, index, link_type,
1204
+ action_code))
1205
+
1206
+ def getlinknodes(self, index: int):
1207
+ """
1208
+ EN_getlinknodes
1209
+
1210
+ Parameters
1211
+ ----------
1212
+ index : `int`
1213
+ """
1214
+ if self._use_project is False:
1215
+ return self._process_result(epanet.ENgetlinknodes(index))
1216
+ else:
1217
+ return self._process_result(epanet.EN_getlinknodes(self._ph, index))
1218
+
1219
+ def setlinknodes(self, index: int, node1: int, node2: int):
1220
+ """
1221
+ EN_setlinknodes
1222
+
1223
+ Parameters
1224
+ ----------
1225
+ index : `int`
1226
+ node1 : `int`
1227
+ node2 : `int`
1228
+ """
1229
+ if self._use_project is False:
1230
+ return self._process_result(epanet.ENsetlinknodes(index, node1, node2))
1231
+ else:
1232
+ return self._process_result(epanet.EN_setlinknodes(self._ph, index, node1, node2))
1233
+
1234
+ def getlinkvalue(self, index: int, property: int):
1235
+ """
1236
+ EN_getlinkvalue
1237
+
1238
+ Parameters
1239
+ ----------
1240
+ index : `int`
1241
+ property : `int`
1242
+ """
1243
+ if self._use_project is False:
1244
+ return self._process_result(epanet.ENgetlinkvalue(index, property))
1245
+ else:
1246
+ return self._process_result(epanet.EN_getlinkvalue(self._ph, index, property))
1247
+
1248
+ def setlinkvalue(self, index: int, property: int, value: float):
1249
+ """
1250
+ EN_setlinkvalue
1251
+
1252
+ Parameters
1253
+ ----------
1254
+ index : `int`
1255
+ property : `int`
1256
+ value : `float`
1257
+ """
1258
+ if self._use_project is False:
1259
+ return self._process_result(epanet.ENsetlinkvalue(index, property, value))
1260
+ else:
1261
+ return self._process_result(epanet.EN_setlinkvalue(self._ph, index, property, value))
1262
+
1263
+ def setpipedata(self, index: int, length: float, diam: float, rough: float, mloss: float):
1264
+ """
1265
+ EN_setpipedata
1266
+
1267
+ Parameters
1268
+ ----------
1269
+ index : `int`
1270
+ length : `float`
1271
+ diam : `float`
1272
+ rough : `float`
1273
+ mloss : `float`
1274
+ """
1275
+ if self._use_project is False:
1276
+ return self._process_result(epanet.ENsetpipedata(index, length, diam, rough, mloss))
1277
+ else:
1278
+ return self._process_result(epanet.EN_setpipedata(self._ph, index, length, diam, rough,
1279
+ mloss))
1280
+
1281
+ def getvertexcount(self, index: int):
1282
+ """
1283
+ EN_getvertexcount
1284
+
1285
+ Parameters
1286
+ ----------
1287
+ index : `int`
1288
+ """
1289
+ if self._use_project is False:
1290
+ return self._process_result(epanet.ENgetvertexcount(index))
1291
+ else:
1292
+ return self._process_result(epanet.EN_getvertexcount(self._ph, index))
1293
+
1294
+ def getvertex(self, index: int, vertex: int):
1295
+ """
1296
+ EN_getvertex
1297
+
1298
+ Parameters
1299
+ ----------
1300
+ index : `int`
1301
+ vertex : `int`
1302
+ """
1303
+ if self._use_project is False:
1304
+ return self._process_result(epanet.ENgetvertex(index, vertex))
1305
+ else:
1306
+ return self._process_result(epanet.EN_getvertex(self._ph, index, vertex))
1307
+
1308
+ def setvertices(self, index: int, x: list[float], y: list[float], count: int):
1309
+ """
1310
+ EN_setvertices
1311
+
1312
+ Parameters
1313
+ ----------
1314
+ index : `int`
1315
+ x : `list[float]`
1316
+ y : `list[float]`
1317
+ count : `int`
1318
+ """
1319
+ if self._use_project is False:
1320
+ return self._process_result(epanet.ENsetvertices(index, x, y, count))
1321
+ else:
1322
+ return self._process_result(epanet.EN_setvertices(self._ph, index, x, y, count))
1323
+
1324
+ def getpumptype(self, link_index: int):
1325
+ """
1326
+ EN_getpumptype
1327
+
1328
+ Parameters
1329
+ ----------
1330
+ link_index : `int`
1331
+ """
1332
+ if self._use_project is False:
1333
+ return self._process_result(epanet.ENgetpumptype(link_index))
1334
+ else:
1335
+ return self._process_result(epanet.EN_getpumptype(self._ph, link_index))
1336
+
1337
+ def getheadcurveindex(self, link_index: int):
1338
+ """
1339
+ EN_getheadcurveindex
1340
+
1341
+ Parameters
1342
+ ----------
1343
+ link_index : `int`
1344
+ """
1345
+ if self._use_project is False:
1346
+ return self._process_result(epanet.ENgetheadcurveindex(link_index))
1347
+ else:
1348
+ return self._process_result(epanet.EN_getheadcurveindex(self._ph, link_index))
1349
+
1350
+ def setheadcurveindex(self, link_index: int, curve_index: int):
1351
+ """
1352
+ EN_setheadcurveindex
1353
+
1354
+ Parameters
1355
+ ----------
1356
+ link_index : `int`
1357
+ curve_index : `int`
1358
+ """
1359
+ if self._use_project is False:
1360
+ return self._process_result(epanet.ENsetheadcurveindex(link_index, curve_index))
1361
+ else:
1362
+ return self._process_result(epanet.EN_setheadcurveindex(self._ph, link_index,
1363
+ curve_index))
1364
+
1365
+ def addpattern(self, id: str):
1366
+ """
1367
+ EN_addpattern
1368
+
1369
+ Parameters
1370
+ ----------
1371
+ id : `str`
1372
+ """
1373
+ if self._use_project is False:
1374
+ return self._process_result(epanet.ENaddpattern(id))
1375
+ else:
1376
+ return self._process_result(epanet.EN_addpattern(self._ph, id))
1377
+
1378
+ def deletepattern(self, index: int):
1379
+ """
1380
+ EN_deletepattern
1381
+
1382
+ Parameters
1383
+ ----------
1384
+ index : `int`
1385
+ """
1386
+ if self._use_project is False:
1387
+ return self._process_result(epanet.ENdeletepattern(index))
1388
+ else:
1389
+ return self._process_result(epanet.EN_deletepattern(self._ph, index))
1390
+
1391
+ def getpatternindex(self, pattern_id: str):
1392
+ """
1393
+ EN_getpatternindex
1394
+
1395
+ Parameters
1396
+ ----------
1397
+ pattern_id : `str`
1398
+ """
1399
+ if self._use_project is False:
1400
+ return self._process_result(epanet.ENgetpatternindex(pattern_id))
1401
+ else:
1402
+ return self._process_result(epanet.EN_getpatternindex(self._ph, pattern_id))
1403
+
1404
+ def getpatternid(self, index: int):
1405
+ """
1406
+ EN_getpatternid
1407
+
1408
+ Parameters
1409
+ ----------
1410
+ index : `int`
1411
+ """
1412
+ if self._use_project is False:
1413
+ return self._process_result(epanet.ENgetpatternid(index))
1414
+ else:
1415
+ return self._process_result(epanet.EN_getpatternid(self._ph, index))
1416
+
1417
+ def setpatternid(self, index: int, id: str):
1418
+ """
1419
+ EN_setpatternid
1420
+
1421
+ Parameters
1422
+ ----------
1423
+ index : `int`
1424
+ id : `str`
1425
+ """
1426
+ if self._use_project is False:
1427
+ return self._process_result(epanet.ENsetpatternid(index, id))
1428
+ else:
1429
+ return self._process_result(epanet.EN_setpatternid(self._ph, index, id))
1430
+
1431
+ def getpatternlen(self, index: int):
1432
+ """
1433
+ EN_getpatternlen
1434
+
1435
+ Parameters
1436
+ ----------
1437
+ index : `int`
1438
+ """
1439
+ if self._use_project is False:
1440
+ return self._process_result(epanet.ENgetpatternlen(index))
1441
+ else:
1442
+ return self._process_result(epanet.EN_getpatternlen(self._ph, index))
1443
+
1444
+ def getpatternvalue(self, index: int, period: int):
1445
+ """
1446
+ EN_getpatternvalue
1447
+
1448
+ Parameters
1449
+ ----------
1450
+ index : `int`
1451
+ period : `int`
1452
+ """
1453
+ if self._use_project is False:
1454
+ return self._process_result(epanet.ENgetpatternvalue(index, period))
1455
+ else:
1456
+ return self._process_result(epanet.EN_getpatternvalue(self._ph, index, period))
1457
+
1458
+ def setpatternvalue(self, index: int, period: int, value: float):
1459
+ """
1460
+ EN_setpatternvalue
1461
+
1462
+ Parameters
1463
+ ----------
1464
+ index : `int`
1465
+ period : `int`
1466
+ value : `float`
1467
+ """
1468
+ if self._use_project is False:
1469
+ return self._process_result(epanet.ENsetpatternvalue(index, period, value))
1470
+ else:
1471
+ return self._process_result(epanet.EN_setpatternvalue(self._ph, index, period, value))
1472
+
1473
+ def getaveragepatternvalue(self, index: int):
1474
+ """
1475
+ EN_getaveragepatternvalue
1476
+
1477
+ Parameters
1478
+ ----------
1479
+ index : `int`
1480
+ """
1481
+ if self._use_project is False:
1482
+ return self._process_result(epanet.ENgetaveragepatternvalue(index))
1483
+ else:
1484
+ return self._process_result(epanet.EN_getaveragepatternvalue(self._ph, index))
1485
+
1486
+ def setpattern(self, index: int, values: list[float], len: int):
1487
+ """
1488
+ EN_setpattern
1489
+
1490
+ Parameters
1491
+ ----------
1492
+ index : `int`
1493
+ values : `list[float]`
1494
+ len : `int`
1495
+ """
1496
+ if self._use_project is False:
1497
+ return self._process_result(epanet.ENsetpattern(index, values, len))
1498
+ else:
1499
+ return self._process_result(epanet.EN_setpattern(self._ph, index, values, len))
1500
+
1501
+ def addcurve(self, id: str):
1502
+ """
1503
+ EN_addcurve
1504
+
1505
+ Parameters
1506
+ ----------
1507
+ id : `str`
1508
+ """
1509
+ if self._use_project is False:
1510
+ return self._process_result(epanet.ENaddcurve(id))
1511
+ else:
1512
+ return self._process_result(epanet.EN_addcurve(self._ph, id))
1513
+
1514
+ def deletecurve(self, index: int):
1515
+ """
1516
+ EN_deletecurve
1517
+
1518
+ Parameters
1519
+ ----------
1520
+ index : `int`
1521
+ """
1522
+ if self._use_project is False:
1523
+ return self._process_result(epanet.ENdeletecurve(index))
1524
+ else:
1525
+ return self._process_result(epanet.EN_deletecurve(self._ph, index))
1526
+
1527
+ def getcurveindex(self, id: str):
1528
+ """
1529
+ EN_getcurveindex
1530
+
1531
+ Parameters
1532
+ ----------
1533
+ id : `str`
1534
+ """
1535
+ if self._use_project is False:
1536
+ return self._process_result(epanet.ENgetcurveindex(id))
1537
+ else:
1538
+ return self._process_result(epanet.EN_getcurveindex(self._ph, id))
1539
+
1540
+ def getcurveid(self, index: int):
1541
+ """
1542
+ EN_getcurveid
1543
+
1544
+ Parameters
1545
+ ----------
1546
+ index : `int`
1547
+ """
1548
+ if self._use_project is False:
1549
+ return self._process_result(epanet.ENgetcurveid(index))
1550
+ else:
1551
+ return self._process_result(epanet.EN_getcurveid(self._ph, index))
1552
+
1553
+ def setcurveid(self, index: int, id: str):
1554
+ """
1555
+ EN_setcurveid
1556
+
1557
+ Parameters
1558
+ ----------
1559
+ index : `int`
1560
+ id : `str`
1561
+ """
1562
+ if self._use_project is False:
1563
+ return self._process_result(epanet.ENsetcurveid(index, id))
1564
+ else:
1565
+ return self._process_result(epanet.EN_setcurveid(self._ph, index, id))
1566
+
1567
+ def getcurvelen(self, index: int):
1568
+ """
1569
+ EN_getcurvelen
1570
+
1571
+ Parameters
1572
+ ----------
1573
+ index : `int`
1574
+ """
1575
+ if self._use_project is False:
1576
+ return self._process_result(epanet.ENgetcurvelen(index))
1577
+ else:
1578
+ return self._process_result(epanet.EN_getcurvelen(self._ph, index))
1579
+
1580
+ def getcurvetype(self, index: int):
1581
+ """
1582
+ EN_getcurvetype
1583
+
1584
+ Parameters
1585
+ ----------
1586
+ index : `int`
1587
+ """
1588
+ if self._use_project is False:
1589
+ return self._process_result(epanet.ENgetcurvetype(index))
1590
+ else:
1591
+ return self._process_result(epanet.EN_getcurvetype(self._ph, index))
1592
+
1593
+ def getcurvevalue(self, curve_index: int, point_index: int):
1594
+ """
1595
+ EN_getcurvevalue
1596
+
1597
+ Parameters
1598
+ ----------
1599
+ curve_index : `int`
1600
+ point_index : `int`
1601
+ """
1602
+ if self._use_project is False:
1603
+ return self._process_result(epanet.ENgetcurvevalue(curve_index, point_index))
1604
+ else:
1605
+ return self._process_result(epanet.EN_getcurvevalue(self._ph, curve_index, point_index))
1606
+
1607
+ def setcurvevalue(self, curve_index: int, point_index: int, x: float, y: float):
1608
+ """
1609
+ EN_setcurvevalue
1610
+
1611
+ Parameters
1612
+ ----------
1613
+ curve_index : `int`
1614
+ point_index : `int`
1615
+ x : `float`
1616
+ y : `float`
1617
+ """
1618
+ if self._use_project is False:
1619
+ return self._process_result(epanet.ENsetcurvevalue(curve_index, point_index, x, y))
1620
+ else:
1621
+ return self._process_result(epanet.EN_setcurvevalue(self._ph, curve_index, point_index,
1622
+ x, y))
1623
+
1624
+ def getcurve(self, index: int):
1625
+ """
1626
+ EN_getcurve
1627
+
1628
+ Parameters
1629
+ ----------
1630
+ index : `int`
1631
+ """
1632
+ if self._use_project is False:
1633
+ return self._process_result(epanet.ENgetcurve(index))
1634
+ else:
1635
+ return self._process_result(epanet.EN_getcurve(self._ph, index))
1636
+
1637
+ def setcurve(self, index: int, x_values: list[float], y_values: list[float], n_points: int):
1638
+ """
1639
+ EN_setcurve
1640
+
1641
+ Parameters
1642
+ ----------
1643
+ index : `int`
1644
+ x_values : `list[float]`
1645
+ y_values : `list[float]`
1646
+ n_points : `int`
1647
+ """
1648
+ if self._use_project is False:
1649
+ return self._process_result(epanet.ENsetcurve(index, x_values, y_values, n_points))
1650
+ else:
1651
+ return self._process_result(epanet.EN_setcurve(self._ph, index, x_values, y_values,
1652
+ n_points))
1653
+
1654
+ def addcontrol(self, type: int, link_index: int, setting: float, node_index: int, level: float):
1655
+ """
1656
+ EN_addcontrol
1657
+
1658
+ Parameters
1659
+ ----------
1660
+ type : `int`
1661
+ link_index : `int`
1662
+ setting : `float`
1663
+ node_index . `int`
1664
+ level : `float`
1665
+ """
1666
+ if self._use_project is False:
1667
+ return self._process_result(epanet.ENaddcontrol(type, link_index, setting, node_index,
1668
+ level))
1669
+ else:
1670
+ return self._process_result(epanet.EN_addcontrol(self._ph, type, link_index, setting,
1671
+ node_index, level))
1672
+
1673
+ def deletecontrol(self, index: int):
1674
+ """
1675
+ EN_deletecontrol
1676
+
1677
+ Parameters
1678
+ ----------
1679
+ index : `int`
1680
+ """
1681
+ if self._use_project is False:
1682
+ return self._process_result(epanet.ENdeletecontrol(index))
1683
+ else:
1684
+ return self._process_result(epanet.EN_deletecontrol(self._ph, index))
1685
+
1686
+ def getcontrol(self, index: int):
1687
+ """
1688
+ EN_getcontrol
1689
+
1690
+ Parameters
1691
+ ----------
1692
+ index : `int`
1693
+ """
1694
+ if self._use_project is False:
1695
+ return self._process_result(epanet.ENgetcontrol(index))
1696
+ else:
1697
+ return self._process_result(epanet.EN_getcontrol(self._ph, index))
1698
+
1699
+ def setcontrol(self, index: int, type: int, link_index: int, setting: float, node_index: int,
1700
+ level: float):
1701
+ """
1702
+ EN_setcontrol
1703
+
1704
+ Parameters
1705
+ ----------
1706
+ index : `int`
1707
+ type : `int`
1708
+ link_index : `int`
1709
+ setting : `float`
1710
+ node_index : `int`
1711
+ level : `float`
1712
+ """
1713
+ if self._use_project is False:
1714
+ return self._process_result(epanet.ENsetcontrol(index, type, link_index, setting,
1715
+ node_index, level))
1716
+ else:
1717
+ return self._process_result(epanet.EN_setcontrol(self._ph, index, type, link_index,
1718
+ setting, node_index, level))
1719
+
1720
+ def addrule(self, rule: str):
1721
+ """
1722
+ EN_addrule
1723
+
1724
+ Parameters
1725
+ ----------
1726
+ rule : `str`
1727
+ """
1728
+ if self._use_project is False:
1729
+ return self._process_result(epanet.ENaddrule(rule))
1730
+ else:
1731
+ return self._process_result(epanet.EN_addrule(self._ph, rule))
1732
+
1733
+ def deleterule(self, index: int):
1734
+ """
1735
+ EN_deleterule
1736
+
1737
+ Parameters
1738
+ ----------
1739
+ index : `int`
1740
+ """
1741
+ if self._use_project is False:
1742
+ return self._process_result(epanet.ENdeleterule(index))
1743
+ else:
1744
+ return self._process_result(epanet.EN_deleterule(self.ph, index))
1745
+
1746
+ def getrule(self, index: int):
1747
+ """
1748
+ EN_getrule
1749
+
1750
+ Parameters
1751
+ ----------
1752
+ index : `int`
1753
+ """
1754
+ if self._use_project is False:
1755
+ return self._process_result(epanet.ENgetrule(index))
1756
+ else:
1757
+ return self._process_result(epanet.EN_getrule(self._ph, index))
1758
+
1759
+ def getruleid(self, index: int):
1760
+ """
1761
+ EN_getruleID
1762
+
1763
+ Parameters
1764
+ ----------
1765
+ index : `int`
1766
+ """
1767
+ if self._use_project is False:
1768
+ return self._process_result(epanet.ENgetruleID(index))
1769
+ else:
1770
+ return self._process_result(epanet.EN_getruleID(self._ph, index))
1771
+
1772
+ def getpremise(self, rule_index: int, premise_index: int):
1773
+ """
1774
+ EN_getpremise
1775
+
1776
+ Parameters
1777
+ ----------
1778
+ rule_index : `int`
1779
+ premise_index : `int`
1780
+ """
1781
+ if self._use_project is False:
1782
+ return self._process_result(epanet.ENgetpremise(rule_index, premise_index))
1783
+ else:
1784
+ return self._process_result(epanet.EN_getpremise(self._ph, rule_index, premise_index))
1785
+
1786
+ def setpremise(self, rule_index: int, premise_index: int, logop: int, object: int,
1787
+ obj_index: int, variable: int, relop: int, status: int, value: float):
1788
+ """
1789
+ EN_setpremise
1790
+
1791
+ Parameters
1792
+ ----------
1793
+ rule_index : `int`
1794
+ premise_index : `int`
1795
+ logop : `int`
1796
+ object : `int`
1797
+ obj_index : `int`
1798
+ variable : `int`
1799
+ relop : `int`
1800
+ status : `int`
1801
+ value : `float`
1802
+ """
1803
+ if self._use_project is False:
1804
+ return self._process_result(epanet.ENsetpremise(rule_index, premise_index, logop,
1805
+ object, obj_index, variable, relop,
1806
+ status, value))
1807
+ else:
1808
+ return self._process_result(epanet.EN_setpremise(self._ph, rule_index, premise_index,
1809
+ logop, object, obj_index, variable,
1810
+ relop, status, value))
1811
+
1812
+ def setpremiseindex(self, rule_index: int, premise_index: int, obj_index: int):
1813
+ """
1814
+ EN_setpremiseindex
1815
+
1816
+ Parameters
1817
+ ----------
1818
+ rule_index : `int`
1819
+ premise_index : `int`
1820
+ obj_index : `int`
1821
+ """
1822
+ if self._use_project is False:
1823
+ return self._process_result(epanet.ENsetpremiseindex(rule_index, premise_index,
1824
+ obj_index))
1825
+ else:
1826
+ return self._process_result(epanet.EN_setpremiseindex(self._ph, rule_index,
1827
+ premise_index, obj_index))
1828
+
1829
+ def setpremisestatus(self, rule_index: int, premise_index: int, status: int):
1830
+ """
1831
+ EN_setpremisestatus
1832
+
1833
+ Parameters
1834
+ ----------
1835
+ rule_index : `int`
1836
+ premise_index : `int`
1837
+ status : `int`
1838
+ """
1839
+ if self._use_project is False:
1840
+ return self._process_result(epanet.ENsetpremisestatus(rule_index, premise_index,
1841
+ status))
1842
+ else:
1843
+ return self._process_result(epanet.EN_setpremisestatus(self._ph, rule_index,
1844
+ premise_index, status))
1845
+
1846
+ def setpremisevalue(self, rule_index: int, premise_index: int, value: float):
1847
+ """
1848
+ EN_setpremisevalue
1849
+
1850
+ Parameters
1851
+ ----------
1852
+ rule_index : `int`
1853
+ premise_index : `int`
1854
+ value : `float`
1855
+ """
1856
+ if self._use_project is False:
1857
+ return self._process_result(epanet.ENsetpremisevalue(rule_index, premise_index, value))
1858
+ else:
1859
+ return self._process_result(epanet.EN_setpremisevalue(self._ph, rule_index, premise_index, value))
1860
+
1861
+ def getthenaction(self, rule_index: int, action_index: int):
1862
+ """
1863
+ EN_getthenaction
1864
+
1865
+ Parameters
1866
+ ----------
1867
+ rule_index : `int`
1868
+ action_index : `int`
1869
+ """
1870
+ if self._use_project is False:
1871
+ return self._process_result(epanet.ENgetthenaction(rule_index, action_index))
1872
+ else:
1873
+ return self._process_result(epanet.EN_getthenaction(self._ph, rule_index, action_index))
1874
+
1875
+ def setthenaction(self, rule_index: int, action_index: int, link_index: int, status: int,
1876
+ setting: float):
1877
+ """
1878
+ EN_setthenaction
1879
+
1880
+ Parameters
1881
+ ----------
1882
+ rule_index : `int`
1883
+ action_index : `int`
1884
+ link_index : `int`
1885
+ status : `int`
1886
+ setting : `float`
1887
+ """
1888
+ if self._use_project is False:
1889
+ return self._process_result(epanet.ENsetthenaction(rule_index, action_index, link_index,
1890
+ status, setting))
1891
+ else:
1892
+ return self._process_result(epanet.EN_setthenaction(self._ph, rule_index, action_index,
1893
+ link_index, status, setting))
1894
+
1895
+ def getelseaction(self, rule_index: int, action_index: int):
1896
+ """
1897
+ EN_getelseaction
1898
+
1899
+ Parameters
1900
+ ----------
1901
+ rule_index : `int`
1902
+ action_index : `int`
1903
+ """
1904
+ if self._use_project is False:
1905
+ return self._process_result(epanet.ENgetelseaction(rule_index, action_index))
1906
+ else:
1907
+ return self._process_result(epanet.EN_getelseaction(self._ph, rule_index, action_index))
1908
+
1909
+ def setelseaction(self, rule_index: int, action_index: int, link_index: int, status: int,
1910
+ setting: float):
1911
+ """
1912
+ EN_setelseaction
1913
+
1914
+ Parameters
1915
+ ----------
1916
+ rule_index : `int`
1917
+ action_index : `int`
1918
+ link_index : `int`
1919
+ status : `int`
1920
+ setting : `float`
1921
+ """
1922
+ if self._use_project is False:
1923
+ return self._process_result(epanet.ENsetelseaction(rule_index, action_index, link_index,
1924
+ status, setting))
1925
+ else:
1926
+ return self._process_result(epanet.EN_setelseaction(self._ph, rule_index, action_index,
1927
+ link_index, status, setting))
1928
+
1929
+ def setrulepriority(self, index: int, priority: float):
1930
+ """
1931
+ EN_setrulepriority
1932
+
1933
+ Parameters
1934
+ ----------
1935
+ index : `int`
1936
+ priority : `float`
1937
+ """
1938
+ if self._use_project is False:
1939
+ return self._process_result(epanet.ENsetrulepriority(index, priority))
1940
+ else:
1941
+ return self._process_result(epanet.EN_setrulepriority(self._ph, index, priority))
1942
+
1943
+ def gettag(self, obj_type: int, obj_idx: int):
1944
+ """
1945
+ EN_gettag
1946
+
1947
+ Parameters
1948
+ ----------
1949
+ obj_type : `int`
1950
+ obj_idx : `int`
1951
+ """
1952
+ if self._use_project is False:
1953
+ return self._process_result(epanet.ENgettag(obj_type, obj_idx))
1954
+ else:
1955
+ return self._process_result(epanet.EN_gettag(self._ph, obj_type, obj_idx))
1956
+
1957
+ def settag(self, obj_type: int, obj_idx: int, tag: str):
1958
+ """
1959
+ EN_settag
1960
+
1961
+ Parameters
1962
+ ----------
1963
+ obj_type : `int`
1964
+ obj_idx : `int`
1965
+ tag : `str`
1966
+ """
1967
+ if self._use_project is False:
1968
+ return self._process_result(epanet.ENsettag(obj_type, obj_idx, tag))
1969
+ else:
1970
+ return self._process_result(epanet.EN_settag(self._ph, obj_type, obj_idx, tag))
1971
+
1972
+ def timetonextevent(self):
1973
+ """
1974
+ EN_timetonextevent
1975
+ """
1976
+ if self._use_project is False:
1977
+ return self._process_result(epanet.ENtimetonextevent())
1978
+ else:
1979
+ return self._process_result(epanet.EN_timetonextevent(self._ph))
1980
+
1981
+ def getnodevalues(self, property: int):
1982
+ """
1983
+ EN_getnodevalues
1984
+
1985
+ Parameters
1986
+ ----------
1987
+ property : `int`
1988
+ """
1989
+ if self._use_project is False:
1990
+ return self._process_result(epanet.ENgetnodevalues(property))
1991
+ else:
1992
+ return self._process_result(epanet.EN_getnodevalues(self._ph, property))
1993
+
1994
+ def getlinkvalues(self, property: int):
1995
+ """
1996
+ EN_getlinkvalues
1997
+
1998
+ Parameters
1999
+ ----------
2000
+ property : `int`
2001
+ """
2002
+ if self._use_project is False:
2003
+ return self._process_result(epanet.ENgetlinkvalues(property))
2004
+ else:
2005
+ return self._process_result(epanet.EN_getlinkvalues(self._ph, property))
2006
+
2007
+ def setvertex(self, link_idx: int, vertex_idx: int, x: float, y: float):
2008
+ """
2009
+ EN_setvertex
2010
+
2011
+ Parameters
2012
+ ----------
2013
+ link_idx : `int`
2014
+ vertex_idx : `int`
2015
+ x : `float`
2016
+ y : `float`
2017
+ """
2018
+ if self._use_project is False:
2019
+ return self._process_result(epanet.ENsetvertex(link_idx, vertex_idx, x, y))
2020
+ else:
2021
+ return self._process_result(epanet.EN_setvertex(self._ph, link_idx, vertex_idx, x, y))
2022
+
2023
+ def loadpatternfile(self, filename: str, id: str):
2024
+ """
2025
+ EN_loadpatternfile
2026
+
2027
+ Parameters
2028
+ ----------
2029
+ filename : `str`
2030
+ id : `str`
2031
+ """
2032
+ if self._use_project is False:
2033
+ return self._process_result(epanet.ENloadpatternfile(filename, id))
2034
+ else:
2035
+ return self._process_result(epanet.EN_loadpatternfile(self._ph, filename, id))
2036
+
2037
+ def setcurvetype(self, curve_idx: int, curve_type: int):
2038
+ """
2039
+ EN_setcurvetype
2040
+
2041
+ Parameters
2042
+ ----------
2043
+ curve_idx : `int`
2044
+ curve_type : `int`
2045
+ """
2046
+ if self._use_project is False:
2047
+ return self._process_result(epanet.ENsetcurvetype(curve_idx, curve_type))
2048
+ else:
2049
+ return self._process_result(epanet.EN_setcurvetype(self._ph, curve_idx, curve_type))
2050
+
2051
+ def getcontrolenabled(self, control_idx: int):
2052
+ """
2053
+ EN_getcontrolenabled
2054
+
2055
+ Parameters
2056
+ ----------
2057
+ control_idx : `int`
2058
+ """
2059
+ if self._use_project is False:
2060
+ return self._process_result(epanet.ENgetcontrolenabled(control_idx))
2061
+ else:
2062
+ return self._process_result(epanet.EN_getcontrolenabled(self._ph, control_idx))
2063
+
2064
+ def setcontrolenabled(self, control_idx: int, enabled: int):
2065
+ """
2066
+ EN_setcontrolenabled
2067
+
2068
+ Parameters
2069
+ ----------
2070
+ control_idx : `int`
2071
+ enabled : `int`
2072
+ """
2073
+ if self._use_project is False:
2074
+ return self._process_result(epanet.ENsetcontrolenabled(control_idx, enabled))
2075
+ else:
2076
+ return self._process_result(epanet.EN_setcontrolenabled(self._ph, control_idx, enabled))
2077
+
2078
+ def getruleenabled(self, rule_idx: int):
2079
+ """
2080
+ EN_getruleenabled
2081
+
2082
+ Parameters
2083
+ ----------
2084
+ rule_idx : `int`
2085
+ """
2086
+ if self._use_project is False:
2087
+ return self._process_result(epanet.ENgetruleenabled(rule_idx))
2088
+ else:
2089
+ return self._process_result(epanet.EN_getruleenabled(self._ph, rule_idx))
2090
+
2091
+ def setruleenabled(self, rule_idx: int, enabled: int):
2092
+ """
2093
+ EN_setruleenabled
2094
+
2095
+ Parameters
2096
+ ----------
2097
+ rule_idx : `int`
2098
+ enabled : `int`
2099
+ """
2100
+ if self._use_project is False:
2101
+ return self._process_result(epanet.ENsetruleenabled(rule_idx, enabled))
2102
+ else:
2103
+ return self._process_result(epanet.EN_setruleenabled(self._ph, rule_idx, enabled))
2104
+
2105
+ def MSXENopen(self, inp_file: str, rpt_file: str, out_file: str):
2106
+ """
2107
+ MSXENopen
2108
+
2109
+ Parameters
2110
+ ----------
2111
+ inp_file : `str`
2112
+ rpt_file : `str`
2113
+ out_file : `str`
2114
+ """
2115
+ return self._process_result(epanet.MSXENopen(inp_file, rpt_file, out_file), msx_call=True)
2116
+
2117
+ def MSXopen(self, fname: str):
2118
+ """
2119
+ MSXopen
2120
+
2121
+ Parameters
2122
+ ----------
2123
+ fname : `str`
2124
+ """
2125
+ return self._process_result(epanet.MSXopen(fname), msx_call=True)
2126
+
2127
+ def MSXsolveH(self):
2128
+ """
2129
+ MSXsolveH
2130
+ """
2131
+ return self._process_result(epanet.MSXsolveH(), msx_call=True)
2132
+
2133
+ def MSXusehydfile(self, fname: str):
2134
+ """
2135
+ MSXusehydfile
2136
+
2137
+ Parameters
2138
+ ----------
2139
+ fname : `str`
2140
+ """
2141
+ return self._process_result(epanet.MSXusehydfile(fname), msx_call=True)
2142
+
2143
+ def MSXsolveQ(self):
2144
+ """
2145
+ MSXsolveQ
2146
+ """
2147
+ return self._process_result(epanet.MSXsolveQ(), msx_call=True)
2148
+
2149
+ def MSXinit(self, save_flag: int):
2150
+ """
2151
+ MSXinit
2152
+
2153
+ Parameters
2154
+ ----------
2155
+ save_flag : `int`
2156
+ """
2157
+ return self._process_result(epanet.MSXinit(save_flag), msx_call=True)
2158
+
2159
+ def MSXstep(self):
2160
+ """
2161
+ MSXstep
2162
+ """
2163
+ return self._process_result(epanet.MSXstep(), msx_call=True)
2164
+
2165
+ def MSXsaveoutfile(self, fname: str):
2166
+ """
2167
+ MSXsaveoutfile
2168
+
2169
+ Parameters
2170
+ ----------
2171
+ fname : `str`
2172
+ """
2173
+ return self._process_result(epanet.MSXsaveoutfile(fname), msx_call=True)
2174
+
2175
+ def MSXsavemsxfile(self, fname: str):
2176
+ """
2177
+ MSXsavemsxfile
2178
+
2179
+ Parameters
2180
+ ----------
2181
+ fname : `str`
2182
+ """
2183
+ return self._process_result(epanet.MSXsavemsxfile(fname), msx_call=True)
2184
+
2185
+ def MSXreport(self):
2186
+ """
2187
+ MSXreport
2188
+ """
2189
+ return self._process_result(epanet.MSXreport(), msx_call=True)
2190
+
2191
+ def MSXclose(self):
2192
+ """
2193
+ MSXclose
2194
+ """
2195
+ return self._process_result(epanet.MSXclose(), msx_call=True)
2196
+
2197
+ def MSXENclose(self):
2198
+ """
2199
+ MSXENclose
2200
+ """
2201
+ return self._process_result(epanet.MSXENclose(), msx_call=True)
2202
+
2203
+ def MSXgetindex(self, item_type: int, id: str):
2204
+ """
2205
+ MSXgetindex
2206
+
2207
+ Parameters
2208
+ ----------
2209
+ item_type : `int`
2210
+ id : `str`
2211
+ """
2212
+ return self._process_result(epanet.MSXgetindex(item_type, id), msx_call=True)
2213
+
2214
+ def MSXgetIDlen(self, item_type: int, index: int):
2215
+ """
2216
+ MSXgetIDlen
2217
+
2218
+ Parameters
2219
+ ----------
2220
+ item_type : `int`
2221
+ index : `int`
2222
+ """
2223
+ return self._process_result(epanet.MSXgetIDlen(item_type, index), msx_call=True)
2224
+
2225
+ def MSXgetID(self, item_type: int, index: int):
2226
+ """
2227
+ MSXgetID
2228
+
2229
+ Parameters
2230
+ ----------
2231
+ item_type : `int`
2232
+ index : `int`
2233
+ """
2234
+ return self._process_result(epanet.MSXgetID(item_type, index), msx_call=True)
2235
+
2236
+ def MSXgetcount(self, item_type: int):
2237
+ """
2238
+ MSXgetcount
2239
+
2240
+ Parameters
2241
+ ----------
2242
+ item_type : `int`
2243
+ """
2244
+ return self._process_result(epanet.MSXgetcount(item_type), msx_call=True)
2245
+
2246
+ def MSXgetspecies(self, index: int):
2247
+ """
2248
+ MSXgetspecies
2249
+
2250
+ Parameters
2251
+ ----------
2252
+ index : `int`
2253
+ """
2254
+ return self._process_result(epanet.MSXgetspecies(index), msx_call=True)
2255
+
2256
+ def MSXgetconstant(self, index: int):
2257
+ """
2258
+ MSXgetconstant
2259
+
2260
+ Parameters
2261
+ ----------
2262
+ index : `int`
2263
+ """
2264
+ return self._process_result(epanet.MSXgetconstant(index), msx_call=True)
2265
+
2266
+ def MSXgetparameter(self, item_type: int, index: int, param: int):
2267
+ """
2268
+ MSXgetparameter
2269
+
2270
+ Parameters
2271
+ ----------
2272
+ item_type : `int`
2273
+ index : `int`
2274
+ param : `int`
2275
+ """
2276
+ return self._process_result(epanet.MSXgetparameter(item_type, index, param), msx_call=True)
2277
+
2278
+ def MSXgetsource(self, node: int, species: int):
2279
+ """
2280
+ MSXgetsource
2281
+
2282
+ Parameters
2283
+ ----------
2284
+ node : `int`
2285
+ species : `int`
2286
+ """
2287
+ return self._process_result(epanet.MSXgetsource(node, species), msx_call=True)
2288
+
2289
+ def MSXgetpatternlen(self, pat: int):
2290
+ """
2291
+ MSXgetpatternlen
2292
+
2293
+ Parameters
2294
+ ----------
2295
+ pat : `int`
2296
+ """
2297
+ return self._process_result(epanet.MSXgetpatternlen(pat), msx_call=True)
2298
+
2299
+ def MSXgetpatternvalue(self, pat: int, period: int):
2300
+ """
2301
+ MSXgetpatternvalue
2302
+
2303
+ Parameters
2304
+ ----------
2305
+ pat : `int`
2306
+ period : `int`
2307
+ """
2308
+ return self._process_result(epanet.MSXgetpatternvalue(pat, period), msx_call=True)
2309
+
2310
+ def MSXgetinitqual(self, item_type: int, index: int, species: int):
2311
+ """
2312
+ MSXgetinitqual
2313
+
2314
+ Parameters
2315
+ ----------
2316
+ item_type : `int`
2317
+ index : `int`
2318
+ species : `int`
2319
+ """
2320
+ return self._process_result(epanet.MSXgetinitqual(item_type, index, species), msx_call=True)
2321
+
2322
+ def MSXgetqual(self, item_type: int, index: int, species: int):
2323
+ """
2324
+ MSXgetqual
2325
+
2326
+ Parameters
2327
+ ----------
2328
+ item_type : `int`
2329
+ index : `int`
2330
+ species : `int`
2331
+ """
2332
+ return self._process_result(epanet.MSXgetqual(item_type, index, species), msx_call=True)
2333
+
2334
+ def MSXgeterror(self, err_code: int):
2335
+ """
2336
+ MSXgeterror
2337
+
2338
+ Parameters
2339
+ ----------
2340
+ err_code : `int`
2341
+ """
2342
+ err, msg = epanet.MSXgeterror(err_code)
2343
+ if err != 0:
2344
+ raise RuntimeError("Failed to get error message")
2345
+ else:
2346
+ return msg
2347
+
2348
+ def MSXsetconstant(self, index: int, value: float):
2349
+ """
2350
+ MSXsetconstant
2351
+
2352
+ Parameters
2353
+ ----------
2354
+ index : `int`
2355
+ value : `float`
2356
+ """
2357
+ return self._process_result(epanet.MSXsetconstant(index, value))
2358
+
2359
+ def MSXsetparameter(self, item_type: int, index: int, param: int, value: float):
2360
+ """
2361
+ MSXsetparameter
2362
+
2363
+ Parameters
2364
+ ----------
2365
+ item_type : `int`
2366
+ index : `int`
2367
+ param : `int`
2368
+ value : `float`
2369
+ """
2370
+ return self._process_result(epanet.MSXsetparameter(item_type, index, param, value),
2371
+ msx_call=True)
2372
+
2373
+ def MSXsetinitqual(self, item_type: int, index: int, species: int, value: float):
2374
+ """
2375
+ MSXsetinitqual
2376
+
2377
+ Parameters
2378
+ ----------
2379
+ item_type : `int`
2380
+ index : `int`
2381
+ species : `int`
2382
+ value : `float`
2383
+ """
2384
+ return self._process_result(epanet.MSXsetinitqual(item_type, index, species, value),
2385
+ msx_call=True)
2386
+
2387
+ def MSXsetsource(self, node: int, species: int, item_type: int, level: float, pat: int):
2388
+ """
2389
+ MSXsetsource
2390
+
2391
+ Parameters
2392
+ ----------
2393
+ node : `int`
2394
+ species : `int`
2395
+ item_type : `int`
2396
+ level : `float`
2397
+ pat : `int`
2398
+ """
2399
+ return self._process_result(epanet.MSXsetsource(node, species, item_type, level, pat),
2400
+ msx_call=True)
2401
+
2402
+ def MSXsetpatternvalue(self, pat: int, period: int, value: float):
2403
+ """
2404
+ MSXsetpatternvalue
2405
+
2406
+ Parameters
2407
+ ----------
2408
+ pat : `int`
2409
+ period : `int`
2410
+ value : `float`
2411
+ """
2412
+ return self._process_result(epanet.MSXsetpatternvalue(pat, period, value), msx_call=True)
2413
+
2414
+ def MSXsetpattern(self, pat: int, mult: list[float], len: int):
2415
+ """
2416
+ MSXsetpattern
2417
+
2418
+ Parameters
2419
+ ----------
2420
+ pat : `int`
2421
+ mult : `list[float]`
2422
+ len : `int`
2423
+ """
2424
+ return self._process_result(epanet.MSXsetpattern(pat, mult, len), msx_call=True)
2425
+
2426
+ def MSXaddpattern(self, id: str):
2427
+ """
2428
+ MSXaddpattern
2429
+
2430
+ Parameters
2431
+ ----------
2432
+ id : `str`
2433
+ """
2434
+ return self._process_result(epanet.MSXaddpattern(id), msx_call=True)