epanet-plus 0.1.0__cp314-cp314t-musllinux_1_2_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.

Potentially problematic release.


This version of epanet-plus might be problematic. Click here for more details.

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