epanet-plus 0.2.1__cp311-cp311-macosx_11_0_arm64.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-311-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 +2833 -0
  85. epanet_plus/epanet_wrapper.py +2434 -0
  86. epanet_plus/include/epanet_plus.h +9 -0
  87. epanet_plus-0.2.1.dist-info/METADATA +157 -0
  88. epanet_plus-0.2.1.dist-info/RECORD +106 -0
  89. epanet_plus-0.2.1.dist-info/WHEEL +6 -0
  90. epanet_plus-0.2.1.dist-info/licenses/LICENSE +21 -0
  91. epanet_plus-0.2.1.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 +2771 -0
  96. python-extension/pyepanet.h +144 -0
  97. python-extension/pyepanet2.c +2453 -0
  98. python-extension/pyepanet2.h +142 -0
  99. python-extension/pyepanet_plus.c +43 -0
  100. python-extension/pyepanet_plus.h +4 -0
  101. python-extension/pyepanetmsx.c +524 -0
  102. python-extension/pyepanetmsx.h +35 -0
  103. tests/test_epanet.py +18 -0
  104. tests/test_epanetmsx.py +38 -0
  105. tests/test_epyt.py +115 -0
  106. tests/test_load_inp_from_buffer.py +59 -0
@@ -0,0 +1,9 @@
1
+ #ifndef EPANETPLUS_H
2
+ #define EPANETPLUS_H
3
+
4
+ #include "epanet2_2.h"
5
+
6
+ int DLLEXPORT ENopenfrombuffer(const char *inpBuffer, const char *inpFile, const char *rptFile, const char *outFile);
7
+ int DLLEXPORT EN_openfrombuffer(EN_Project p, const char *inpBuffer, const char *inpFile, const char *rptFile, const char *outFile);
8
+
9
+ #endif //EPANETPLUS_H
@@ -0,0 +1,157 @@
1
+ Metadata-Version: 2.4
2
+ Name: epanet-plus
3
+ Version: 0.2.1
4
+ Summary: Python interface for EPANET-PLUS (incl. EPANET and EPANET-MSX)
5
+ Author-email: André Artelt <aartelt@techfak.uni-bielefeld.de>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/WaterFutures/EPANET-PLUS
8
+ Project-URL: Documentation, https://epanet-plus.readthedocs.io/en/stable/
9
+ Project-URL: Repository, https://github.com/WaterFutures/EPANET-PLUS.git
10
+ Project-URL: Issues, https://github.com/WaterFutures/EPANET-PLUS/issues
11
+ Keywords: epanet,water,networks,hydraulics,quality,simulations
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Intended Audience :: Science/Research
14
+ Classifier: Operating System :: Microsoft :: Windows
15
+ Classifier: Operating System :: MacOS
16
+ Classifier: Operating System :: POSIX :: Linux
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3.10
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Programming Language :: Python :: 3.13
22
+ Classifier: Programming Language :: Python :: 3.14
23
+ Requires-Python: >=3.10
24
+ Description-Content-Type: text/markdown
25
+ License-File: LICENSE
26
+ Dynamic: license-file
27
+
28
+ [![pypi](https://img.shields.io/pypi/v/epanet-plus.svg)](https://pypi.org/project/epanet-plus/)
29
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
30
+ ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/epanet-plus)
31
+ [![Build + Test](https://github.com/WaterFutures/EPANET-PLUS/actions/workflows/build_test.yml/badge.svg)](https://github.com/WaterFutures/EPANET-PLUS/actions/workflows/build_test.yml)
32
+ [![Documentation Status](https://readthedocs.org/projects/epanet-plus/badge/?version=stable)](https://epanet-plus.readthedocs.io/en/stable/?badge=stable)
33
+ [![Downloads](https://static.pepy.tech/badge/epanet-plus)](https://pepy.tech/project/epanet-plus)
34
+ [![Downloads](https://static.pepy.tech/badge/epanet-plus/month)](https://pepy.tech/project/epanet-plus)
35
+
36
+ # EPANET-PLUS
37
+
38
+ EPANET-PLUS is a C library that merges [EPANET](https://github.com/OpenWaterAnalytics/EPANET)
39
+ and [EPANET-MSX](https://github.com/OpenWaterAnalytics/epanet-msx) into a single library.
40
+ Most importantly, it also provides a Python package with a high-performance interface
41
+ (i.e., C extension) to the C library, together with additional helper functions for an easier
42
+ use of EPANET and EPANET-MSX.
43
+
44
+ If you are interested in creating and simulating complex scenarios, we recommend to take a look
45
+ at [EPyT-Flow](https://github.com/WaterFutures/EPyT-Flow), which builds upon EPANET-PLUS.
46
+
47
+ ## Unique Features
48
+
49
+ Unique features of EPANET-PLUS that make it superior to other Python interfaces of EPANET are the following:
50
+
51
+ - High-performance (single) interface to the latest version of EPANET and EPANET-MSX
52
+ - Additional C-functions to extend EPANET and EPANET-MSX
53
+ - Python toolkit with handy functions for working with EPANET and EPANET-MSX
54
+
55
+ ## Installation
56
+
57
+ Note that EPANET-PLUS supports Python 3.10 - 3.14.
58
+ The Python package contains the the C library as a C extension and is
59
+ already pre-build for all major platforms.
60
+
61
+ ### PyPI
62
+
63
+ ```
64
+ pip install epanet-plus
65
+ ```
66
+
67
+
68
+ ### Git
69
+
70
+ Download or clone the repository:
71
+
72
+ ```
73
+ git clone https://github.com/WaterFutures/EPANET-PLUS.git
74
+ cd EPANET-PLUS
75
+ ```
76
+
77
+ Install all requirements as listed in [REQUIREMENTS.txt](https://raw.githubusercontent.com/WaterFutures/EPANET-PLUS/main/REQUIREMENTS.txt):
78
+
79
+ ```
80
+ pip install -r REQUIREMENTS.txt
81
+ ```
82
+
83
+ Build and install the package:
84
+
85
+ ```
86
+ pip install .
87
+ ```
88
+
89
+ ## Quick Example
90
+
91
+ ```python
92
+ from epanet_plus import EPyT, EpanetConstants
93
+
94
+ if __name__ == "__main__":
95
+ # Load an .inp file in EPANET using the toolkit class
96
+ epanet_api = EPyT("net2-cl2.inp")
97
+
98
+ # Print some general information
99
+ print(f"All nodes: {epanet_api.get_all_nodes_id()}")
100
+ print(f"All links: {epanet_api.get_all_links_id()}")
101
+
102
+ print(f"Simulation duration in seconds: {epanet_api.get_simulation_duration()}")
103
+ print(f"Hydraulic time step in seconds: {epanet_api.get_hydraulic_time_step()}")
104
+ print(f"Demand model: {epanet_api.get_demand_model()}")
105
+
106
+ # Run hydraulic simulation and output pressure at each node (at every simulation step)
107
+ epanet_api.openH()
108
+ epanet_api.initH(EpanetConstants.EN_NOSAVE)
109
+
110
+ tstep = 1
111
+ while tstep > 0:
112
+ t = epanet_api.runH()
113
+
114
+ print(epanet_api.getnodevalues(EpanetConstants.EN_PRESSURE))
115
+
116
+ tstep = epanet_api.nextH()
117
+
118
+ epanet_api.closeH()
119
+
120
+ # Close EPANET
121
+ epanet_api.close()
122
+ ```
123
+
124
+ ## Documentation
125
+
126
+ Documentation is available on readthedocs: [https://epanet-plus.readthedocs.io/en/latest/](https://epanet-plus.readthedocs.io/en/stable)
127
+
128
+ # License
129
+
130
+ MIT license -- see [LICENSE](LICENSE)
131
+
132
+ ## How to Cite?
133
+
134
+ If you use this software, please cite it as follows:
135
+
136
+ ```bibtex
137
+ @misc{github:epanetplus,
138
+ author = {André Artelt},
139
+ title = {{EPANET-PLUS}},
140
+ year = {2025},
141
+ publisher = {GitHub},
142
+ journal = {GitHub repository},
143
+ howpublished = {https://github.com/WaterFutures/EPANET-PLUS}
144
+ }
145
+ ```
146
+
147
+ ## How to get Support?
148
+
149
+ If you come across any bug or need assistance please feel free to open a new
150
+ [issue](https://github.com/WaterFutures/EPyT-Flow/issues/)
151
+ if non of the existing issues answers your questions.
152
+
153
+ ## How to Contribute?
154
+
155
+ Contributions (e.g. creating issues, pull-requests, etc.) are welcome --
156
+ please make sure to read the [code of conduct](CODE_OF_CONDUCT.md) and
157
+ follow the [developers' guidelines](DEVELOPERS.md).
@@ -0,0 +1,106 @@
1
+ epanet.cpython-311-darwin.so,sha256=Sq7y1rtMh7QOruWGGuTvINdeRdDUYv1OLlUn35AMadE,724944
2
+ python-extension/pyepanetmsx.h,sha256=BXI0jBTl2RzAaogfIeALgv7n1-pizSVtYqUtupEVTkQ,2088
3
+ python-extension/ext.c,sha256=sjDx2HWTY9Ov35rxDH0E6szI249YDCK5DT2EKLFSfVg,38183
4
+ python-extension/pyepanet.h,sha256=RUQ79GAv58Wo_FqFXcUgz4MpPA_t6tWze0P4wjFniJE,9153
5
+ python-extension/pyepanet_plus.c,sha256=ykE1fAvLgs21-zewzW5pq55W-8nD8v-gjY0Po4QcMpk,1034
6
+ python-extension/pyepanet2.h,sha256=tmaekND6Zb00Tl99TAa5M53nQnsoPZ-L0LfM1JKgBsA,9122
7
+ python-extension/pyepanetmsx.c,sha256=UNpTtsvEnYq_DH69c_kOo5a7ZRUyVEiSskn9GqexOmU,11953
8
+ python-extension/pyepanet.c,sha256=GTzk-w2MKBxox_KE1Q6U3fnegPwB2tMZWRYrFjfsyiI,68960
9
+ python-extension/pyepanet_plus.h,sha256=2Pz6cVxJas_nlcYVeYU3xnqXMTcsCJ18P-vnnZa_YAs,156
10
+ python-extension/pyepanet2.c,sha256=RHMod3oxNh5GvBd4__SmpzA2wXjdyWk1SALrfjehYcE,57490
11
+ epanet-msx-src/mathexpr.h,sha256=1nbte9BLbqk8l9Ai2HhY1rqSmEUw0Ex03goUWBaN3QQ,1342
12
+ epanet-msx-src/msxtoolkit.c,sha256=0KgIpPP28-sOCCExBaq1Hh8ib2J-W65kNf0-fR5D5OE,33863
13
+ epanet-msx-src/msxqual.c,sha256=6Aj6Lu9ehnmjp-9AL3kN34aG4NaD8a9I6MQX93IjEpE,57805
14
+ epanet-msx-src/dispersion.h,sha256=qYeHTzI4N2Y2ja0qGkKUBG6aGaD_erNgvHuhGgy0iLM,941
15
+ epanet-msx-src/smatrix.h,sha256=heHTNgQNNDTs_Jx0YBts7_B7dPg8VUF1jgBBmU-qbfc,1567
16
+ epanet-msx-src/msxout.c,sha256=x_gLPmsFfh1Bqb3J9GrPcVKdCpyVB2vNyf2HBf3sBZg,11246
17
+ epanet-msx-src/newton.c,sha256=tgbGLLn_cwbD7zKu5DA1xZfx2h8mKsSIO09vhYiMI-Y,4387
18
+ epanet-msx-src/ros2.c,sha256=ycMgrsopw2yD_nKRfjUaGY-fWibrR124PPugkwcFikg,8542
19
+ epanet-msx-src/msxutils.c,sha256=HLPavITgmlX9-s6mOUkQPt3noQUiv0I1gT_59Q33dfs,12104
20
+ epanet-msx-src/mempool.c,sha256=WR_2IU5YdYD74f-s4gr2ia9AlgNXMMoLCdXxdVbseQM,4283
21
+ epanet-msx-src/rk5.c,sha256=3rCy4ivgbwZXS0DfCckrdO_bpFqhsaFTtFDCA7sC3UA,9778
22
+ epanet-msx-src/msxfuncs.h,sha256=P7BfVu7xrFp7DUfNcO-TuBIITcPEJYmqkKRVdj_k5Qs,1337
23
+ epanet-msx-src/hash.c,sha256=bxilMFOs3t-UuI2ZxJQZrjbUi6sUNMrp6MO0Q5snMmo,2848
24
+ epanet-msx-src/msxchem.c,sha256=CzJoJyAepVAylmKH78uucUKYz3Ng4CkCy2RI2Mv4h-E,35046
25
+ epanet-msx-src/smatrix.c,sha256=l4VVV_44Jm7xAqQ4EEk66JZCyZ0MWOFwm99VAqgq5l4,28375
26
+ epanet-msx-src/msxerr.c,sha256=kFqe96sn-kFjj6PwwLKyJ3fAQ0dslVc8PE-e2AM6fKU,3055
27
+ epanet-msx-src/msxtank.c,sha256=UNeZg9pcBjx8kHiVgDWWAPrfOrUDr3gpEwDO66_bh20,12126
28
+ epanet-msx-src/mathexpr.c,sha256=ZddmJu3NvnmOZwqF58vXcy4x8fijB86DzSi_sr-g8b0,23189
29
+ epanet-msx-src/msxcompiler.c,sha256=mYzjdspLZSZM7L2ECgzmHOk_VoqB_cf0mcbL-oMrG1s,10817
30
+ epanet-msx-src/msxdict.h,sha256=1nAa1vhcJUY8QFgigPXRaZcbNxJwyQ1awpeuD5nmbrQ,2147
31
+ epanet-msx-src/mempool.h,sha256=zErH6G07mEDdrBRe-VoaEzjyuxD8RICxAAv9ROpnkGQ,455
32
+ epanet-msx-src/msxproj.c,sha256=Of2YTh98MXMUv2ZiwNyUcKf7gh2QsYVEMV_yJiQ7bBs,21817
33
+ epanet-msx-src/ros2.h,sha256=Ll-IInq4X1pVGchQH8PRGiPPLhoson7Vt0w3c0_Xx1o,1249
34
+ epanet-msx-src/msxrpt.c,sha256=RW-sD7Q1LaxKLNSBXrxSkEKerGNCMMdA9BkSkJm3Pis,11505
35
+ epanet-msx-src/newton.h,sha256=mkSbH7deDiL83DstIt1xLoC933G0gc16ofc7QL04r5s,1090
36
+ epanet-msx-src/msxutils.h,sha256=R1qNWqw74TcaAErzzeBjXnH6cwDX2NYvQYX-pc4mfMA,1811
37
+ epanet-msx-src/msxdispersion.c,sha256=qsFYBGV1OUkGTnSa6u6gy-qebiV7NqyISZo_MoHBbi0,14274
38
+ epanet-msx-src/msxtypes.h,sha256=0LSgX4yiCxWBuFm0Dt1lD0lryRob5T8x38ukXWg9rSc,24060
39
+ epanet-msx-src/hash.h,sha256=2C4ebltth9ekERJvJy8QI2s-4zpIudpqW5bdy2IIeSA,412
40
+ epanet-msx-src/msxinp.c,sha256=QNrZt2yLo7sXiK4QXgMskDNXYXXmS5iyCZIxkC4WWT0,38985
41
+ epanet-msx-src/rk5.h,sha256=HzbHtGY4vMc16-CtBoM1epjQgt53NJ44asBnIW_3L3c,1280
42
+ epanet-msx-src/msxfuncs.c,sha256=uXdp0LUQapVIgE9Yj0V9qG99SSrvqzIt7olysuRKbJQ,4364
43
+ epanet-msx-src/msxfile.c,sha256=rVG-dKgvfrhaNP-Sy1_4EmTWi8GCwlAqYa0Vbnnk8aY,7068
44
+ epanet-msx-src/include/epanetmsx.h,sha256=P4baHSK7NQzuwYhrWLE0VmieTlXW2XOQF52UgyhZDuk,3456
45
+ epanet-msx-src/include/epanetmsx_export.h,sha256=h5UMaf6pH_0asRJOmhWUGAZhyA180ui2Cz8_y5h1FKw,1054
46
+ epanet_plus/epanet_wrapper.py,sha256=DD_qBcY6HUd3vNwLF7S1o7ADjMQr6bdYF6tSy5L8WN4,73718
47
+ epanet_plus/epanet_toolkit.py,sha256=_0jxyVW0hTnZUL0ir4pHemmHxppe8NKxf4_aEP9DjAo,84800
48
+ epanet_plus/__init__.py,sha256=XorLU8AO-crTDUwlM-EVyrOYynh3FrGkhQuSsWwI9Ls,215
49
+ epanet_plus/VERSION,sha256=GWZm1qfrRYP7nLHhWZcQELLim1t1Kqc_RW4OIGG2Ql8,5
50
+ epanet_plus/epanet_plus.c,sha256=zWfYlLgYdQCQtIkVHNpgEBOBqJefeJX7H3cHZThkxnw,3183
51
+ epanet_plus/include/epanet_plus.h,sha256=z2PEExuz6szxUp1k5vwsMQy2uSRz_X-W9B7xSP2f33s,340
52
+ tests/test_epanetmsx.py,sha256=5bVabKOJY8gsTRJS7gQFXNiQ6RmEdWa5JG35XCuUzDo,1146
53
+ tests/test_epyt.py,sha256=t8HBVtk5dJ3Kud-8NSNP2DFy0ZoWgF_N7OXV6mvfdAA,3773
54
+ tests/test_load_inp_from_buffer.py,sha256=WqeK08YJPEgkHpARzuQKIzL76AYbNRVcSUmIi7PRotU,2001
55
+ tests/test_epanet.py,sha256=cnG-_GHPNcQ5r0AhZCX8CuoHmqyb7hlf0nLFl3l9YBE,539
56
+ docs/conf.py,sha256=xd41cfAn4qscUNt--XoojOmgC9kWUI7ZNfpLjbRPpuU,2132
57
+ epanet-src/inpfile.c,sha256=obYLcr4DikW89h_uBc-LvLViU2m9gJozZa1CsXy19nY,28208
58
+ epanet-src/validate.c,sha256=nT6Xyd2E0ZXVZEZj2Zuo-K_TOBznIGrODUXqXmpMcCI,12117
59
+ epanet-src/input2.c,sha256=qJUHBY-tcmXLriah3VOTNTNnbUvWNtrh_L7gy0ftysA,29542
60
+ epanet-src/errors.dat,sha256=5p-lbCKco6-iNNLVUKohi4eLa3sE1l4_F3BuALmW3WE,3014
61
+ epanet-src/text.h,sha256=sFv5LZQ-7pKRz9xe6NVMT2PeJZzdeuP4jE6CIYXqu9M,17731
62
+ epanet-src/LICENSE,sha256=XrPEC-tu4Ha8AGxwh4uSTgaENMyXGrsTdVOzsFBk8A0,1090
63
+ epanet-src/hydstatus.c,sha256=C7X660ow5T1AmSqIB-EHc7xD5NoF_dGqS9NrufERGi8,13196
64
+ epanet-src/report.c,sha256=AbKWhEj4itrGgSVWgSr2Z6fZcIpBN1qvOA2cV5C0-HM,46033
65
+ epanet-src/types.h,sha256=3y8YCn5xCQgzDB-_2UUH_BRPmLm16-zyUyEaBb6EGG0,33129
66
+ epanet-src/AUTHORS,sha256=8nnSXx3x4js8FtPZrcluaIbwm5vUxxCZlGhAAx2XALc,1916
67
+ epanet-src/rules.c,sha256=OaJIr1WCZ0keJp8mxJs2-S_mE8QB1TVKEeprAfhof5Y,39491
68
+ epanet-src/mempool.c,sha256=3idwF-IfhG4fWZPeESnmG2nWeRpdATaPpiNkPC6wGus,3646
69
+ epanet-src/hydsolver.c,sha256=tO6zfzyzhoDXGjReE0CRn2_EtEYIM9cxO4kp4-VA3_M,25428
70
+ epanet-src/project.c,sha256=Z1K01Of1ga4wB6paXkhklM6Z_ny94IZ6pYINFpHVzHM,51675
71
+ epanet-src/epanet2.def,sha256=5265uHv5EV-GSO5XbdXvod469pencib1LZThMyJ7siM,7782
72
+ epanet-src/input1.c,sha256=W8DJFAaaOwyfiBWei8pVZNAvXyIqlkbxncdliHTLepc,22899
73
+ epanet-src/hash.c,sha256=wY8Rzw-93oNrXUOFsfe4NVRn7NYXhlVHAciQm11goH0,4231
74
+ epanet-src/epanet2.c,sha256=AgRfutfQraTcjrE-IlEbejg_BxuzS_Ly98i6OIW3a80,27910
75
+ epanet-src/leakage.c,sha256=ygnmgJCAZhpzERdM2hQATlOmbNexH2RclXlH3r8x6Zs,16470
76
+ epanet-src/flowbalance.c,sha256=zEFAgmMRtKR9KJkEKb7j3JXui01jsnj1zLJiGI3Y_ik,5661
77
+ epanet-src/smatrix.c,sha256=NNZIRSKTyzfi_fdWyqwcUsqJXRjFC2pnmRZhTrLX3oA,26020
78
+ epanet-src/epanet.c,sha256=3r7smEFzN4Ndt4d8V_YBFaTRqQGg9k2k1B6B2gK5lw4,182356
79
+ epanet-src/hydcoeffs.c,sha256=CP0p6F-8000e_9153T9qruJPPjICL1J6Wd2uxNhi7kc,38589
80
+ epanet-src/qualreact.c,sha256=W2nxecPc3E44EkRUWU_bSFmA_SNYUKMkpIDsVxXSa5E,23731
81
+ epanet-src/genmmd.c,sha256=qM0JX1LbiGTawbANyXs93XK-khVPMyWhiGQRNQ8SSKE,32936
82
+ epanet-src/hydraul.c,sha256=VlAsh6sfSqn-HGwI0LrO0khDP823Rdayc-KUNEl8OfQ,33686
83
+ epanet-src/funcs.h,sha256=bpm0sKJnH9Mydl-HCeLrAZ9kcFn8jZu1a0OMcPYosxQ,7018
84
+ epanet-src/mempool.h,sha256=JKSJX5vBHjhQ3_rme6MtAkXSy2KPbiKu-7-nMRcp5I8,677
85
+ epanet-src/qualroute.c,sha256=nq0DtBsWYukvZxn0yYYdYjiGm7kyiAvhqJXEc0FL8sw,21714
86
+ epanet-src/quality.c,sha256=dbm7zLxaFu-UaUVRf3ZVMg_aYGKOL7gGKMTFxaR28fE,19839
87
+ epanet-src/input3.c,sha256=SZpAWtSus00dd78MrFo5JQW1qXE9P0RD_mRXuoHUqwI,68743
88
+ epanet-src/enumstxt.h,sha256=aJYz_VOnGF4oJ3spdtbHlJq7k3rJSjc0koszg32Y9FI,4974
89
+ epanet-src/output.c,sha256=SuOVWz0ZT3hqxqXKOc2DAt7sg3XKKPhKqel89FR0LKU,26680
90
+ epanet-src/hash.h,sha256=xRyuJSJz6tQB9Jds6FZtE57kIWq3bgJUf-Bis--QcJI,896
91
+ epanet-src/util/filemanager.h,sha256=QM0J6ED52S-LjJIOJ3zYw0KRSGnQ9KCogJtf77kqsb0,1844
92
+ epanet-src/util/errormanager.c,sha256=yvdysNOo6yeoSWWYYGsBn6ywtpTmuV5Qpq4Vy_QIdLs,2058
93
+ epanet-src/util/cstr_helper.h,sha256=2ivKuiOY097jBCFb0hWWoSgZqrxUyo6BVVbdmqkTYlc,727
94
+ epanet-src/util/cstr_helper.c,sha256=qFvFKXV0YLtk_Q79T0ERuXlgvsgznPMQKbpzz40xbkI,1348
95
+ epanet-src/util/errormanager.h,sha256=ghebj0NO_1lvmFncgUt35t9Z9D4zrWwTSnpxzyfahig,982
96
+ epanet-src/util/filemanager.c,sha256=ul4LdINZ8Lb273KPCRWo1KjCLC6dIzhWE62sXJwX5kc,4666
97
+ epanet-src/include/epanet2_enums.h,sha256=vP4c3AhIB6Md2HLS8YaKVXADUqXiuJSu1NmNDl9vhEY,22683
98
+ epanet-src/include/epanet2_2.h,sha256=JAs1spcJixip6zdSd0G-cWG19PGKBR6CKQM5UDGJiJg,77508
99
+ epanet-src/include/epanet2.h,sha256=qggFwluyLeh0ZudO3aCowpq3Bq5da9exd5qhoXDCcEw,15274
100
+ epanet_plus-0.2.1.dist-info/RECORD,,
101
+ epanet_plus-0.2.1.dist-info/WHEEL,sha256=hD43ZIWkM5lzdXKLZVKqywZFoqatzvS9BoYxwqWNkEI,137
102
+ epanet_plus-0.2.1.dist-info/top_level.txt,sha256=igwRsFnggi2fSCG7AHkP3LfOLlgsT2aUu0oa8DpvHDo,103
103
+ epanet_plus-0.2.1.dist-info/METADATA,sha256=JY7qxiTYWtZwTsBm_51rrgSydcpPyr6nrXTxvke-UfI,5541
104
+ epanet_plus-0.2.1.dist-info/licenses/LICENSE,sha256=q5jqVgUtLMJstE7DSa26FnVk3N2yAuQPCW6wCtQm6Eo,1074
105
+ examples/basic_usage.py,sha256=c2PlqGFLPxpoe2f37neEN4T479deTqummNfojumzLUo,1087
106
+ examples/epanet_msx.py,sha256=_aPu9DaXH4H1tC6MEg8s2_8__W7QEhDGRGdprXaYbDY,1220
@@ -0,0 +1,6 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (80.10.2)
3
+ Root-Is-Purelib: false
4
+ Tag: cp311-cp311-macosx_11_0_arm64
5
+ Generator: delocate 0.13.0
6
+
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) EPANET-PLUS Developers
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,11 @@
1
+ build
2
+ docs
3
+ epanet
4
+ epanet-msx-src
5
+ epanet-src
6
+ epanet_plus
7
+ examples
8
+ python-extension
9
+ src
10
+ tests
11
+ wheelhouse
@@ -0,0 +1,35 @@
1
+ """
2
+ Basic example showing how to load an .inp file and run a hydraulic simulation.
3
+ """
4
+ from epanet_plus import EPyT, EpanetConstants
5
+
6
+
7
+ if __name__ == "__main__":
8
+ # Load an .inp file in EPANET using the toolkit class
9
+ epanet_api = EPyT("net2-cl2.inp")
10
+
11
+ # Print some general information
12
+ print(f"All nodes: {epanet_api.get_all_nodes_id()}")
13
+ print(f"All links: {epanet_api.get_all_links_id()}")
14
+
15
+ print(f"Simulation duration in seconds: {epanet_api.get_simulation_duration()}")
16
+ print(f"Hydraulic time step in seconds: {epanet_api.get_hydraulic_time_step()}")
17
+ print(f"Demand model: {epanet_api.get_demand_model()}")
18
+
19
+ # Run hydraulic simulation and output pressure at each node (at every simulation step)
20
+ epanet_api.openH()
21
+ epanet_api.initH(EpanetConstants.EN_NOSAVE)
22
+
23
+ tstep = 1
24
+ r = []
25
+ while tstep > 0:
26
+ t = epanet_api.runH()
27
+
28
+ print(f"Current pressure per node: {epanet_api.getnodevalues(EpanetConstants.EN_PRESSURE)}")
29
+
30
+ tstep = epanet_api.nextH()
31
+
32
+ epanet_api.closeH()
33
+
34
+ # Close EPANET
35
+ epanet_api.close()
examples/epanet_msx.py ADDED
@@ -0,0 +1,35 @@
1
+ """
2
+ Basic example demonstrating how to run an EPANET-MSX simulation.
3
+ """
4
+ from epanet_plus import EPyT, EpanetConstants
5
+
6
+
7
+ if __name__ == "__main__":
8
+ # Load an .inp and .msx file -- recall that for using EPANET-MSX,
9
+ # we have to fall back to EPANET < 2.2 (i.e., use_project=False)
10
+ epanet_api = EPyT("net2-cl2.inp", use_project=False)
11
+ epanet_api.load_msx_file("net2-cl2.msx")
12
+
13
+ print(f"Simulation duration: {epanet_api.gettimeparam(EpanetConstants.EN_DURATION)}")
14
+
15
+ # Solve hydraulics by calling MSXsolveH -- alternatively, the hydraulics can be solved
16
+ # in EPANET once and exported as a .hyd file, which can then be loaded into EPANET-MSX
17
+ epanet_api.MSXsolveH()
18
+
19
+ #epanet_api.solveH() # Only do this once -- you can then just load the .hyd file
20
+ #epanet_api.savehydfile("mySimNet2.hyd")
21
+ #epanet_api.MSXusehydfile("mySimNet2.hyd")
22
+
23
+ # Run EPANET-MSX simulation
24
+ epanet_api.MSXinit(0)
25
+ print(f"Species ID: {epanet_api.MSXgetindex(EpanetConstants.MSX_SPECIES, 'CL2')}")
26
+
27
+ while True:
28
+ t, tleft = epanet_api.MSXstep()
29
+
30
+ print(f"{epanet_api.MSXgetqual(EpanetConstants.MSX_NODE, 2, 1)} mg/L")
31
+
32
+ if tleft == 0:
33
+ break
34
+
35
+ epanet_api.close()