epanet-plus 0.0.1__cp39-cp39-macosx_10_9_x86_64.whl → 0.1.0__cp39-cp39-macosx_10_9_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.

Binary file
epanet_plus/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.1
1
+ 0.1.0
@@ -237,6 +237,21 @@ class EpanetAPI():
237
237
  else:
238
238
  return self._process_result(epanet.EN_open(self._ph, inpFile, rptFile, outFile))
239
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
+
240
255
  def gettitle(self):
241
256
  """
242
257
  EN_gettitle
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: epanet-plus
3
- Version: 0.0.1
3
+ Version: 0.1.0
4
4
  Summary: Python interface for EPANET-PLUS (incl. EPANET and EPANET-MSX)
5
5
  Author-email: André Artelt <aartelt@techfak.uni-bielefeld.de>
6
6
  License-Expression: MIT
@@ -17,6 +17,7 @@ Classifier: Programming Language :: Python :: 3.10
17
17
  Classifier: Programming Language :: Python :: 3.11
18
18
  Classifier: Programming Language :: Python :: 3.12
19
19
  Classifier: Programming Language :: Python :: 3.13
20
+ Classifier: Programming Language :: Python :: 3.14
20
21
  Requires-Python: >=3.9
21
22
  Description-Content-Type: text/markdown
22
23
  License-File: LICENSE
@@ -25,7 +26,7 @@ Dynamic: license-file
25
26
  [![pypi](https://img.shields.io/pypi/v/epanet-plus.svg)](https://pypi.org/project/epanet-plus/)
26
27
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
27
28
  ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/epanet-plus)
28
- [![build](https://github.com/WaterFutures/EPANET-PLUS/actions/workflows/build.yml/badge.svg)](https://github.com/WaterFutures/EPANET-PLUS/actions/workflows/build.yml)
29
+ [![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)
29
30
  [![Documentation Status](https://readthedocs.org/projects/epanet-plus/badge/?version=stable)](https://epanet-plus.readthedocs.io/en/stable/?badge=stable)
30
31
  [![Downloads](https://static.pepy.tech/badge/epanet-plus)](https://pepy.tech/project/epanet-plus)
31
32
  [![Downloads](https://static.pepy.tech/badge/epanet-plus/month)](https://pepy.tech/project/epanet-plus)
@@ -48,7 +49,7 @@ Unique features of EPANET-PLUS that make it superior to other Python interfaces
48
49
 
49
50
  ## Installation
50
51
 
51
- Note that EPANET-PLUS supports Python 3.9 - 3.13.
52
+ Note that EPANET-PLUS supports Python 3.9 - 3.14.
52
53
  The Python package contains the the C library as a C extension and is
53
54
  already pre-build for all major platforms.
54
55
 
@@ -1,13 +1,13 @@
1
- epanet.cpython-39-darwin.so,sha256=3C0Vi2546NQ5-dNMqTqoJ785QSz_2UKEPmAQ4ak7ANE,703352
1
+ epanet.cpython-39-darwin.so,sha256=AucbSQTcHvUdVn25SFoe94ibRcRae0ZnCHgFbBh6QZw,703568
2
2
  python-extension/pyepanetmsx.h,sha256=BXI0jBTl2RzAaogfIeALgv7n1-pizSVtYqUtupEVTkQ,2088
3
3
  python-extension/ext.c,sha256=sjDx2HWTY9Ov35rxDH0E6szI249YDCK5DT2EKLFSfVg,38183
4
- python-extension/pyepanet.h,sha256=jh7NJrkogyV78BwpVEFpXqxBQiNGLE1f1FaUlOTz-vs,9094
4
+ python-extension/pyepanet.h,sha256=RUQ79GAv58Wo_FqFXcUgz4MpPA_t6tWze0P4wjFniJE,9153
5
5
  python-extension/pyepanet_plus.c,sha256=A_6eN31QeNBw3nfACpblDsvndzvKB1N9Bq4qT6f6UUs,938
6
- python-extension/pyepanet2.h,sha256=fmyrc6py14iiwvd-co_V4bQ_v46gp0hcNDhyKd7PhrQ,9064
6
+ python-extension/pyepanet2.h,sha256=tmaekND6Zb00Tl99TAa5M53nQnsoPZ-L0LfM1JKgBsA,9122
7
7
  python-extension/pyepanetmsx.c,sha256=3uZcfLpyVFhOxzyqk-1iuLV8XRAcprOsKUCkj57JmL4,9282
8
- python-extension/pyepanet.c,sha256=YkhB-Ey_GsaCINczvEIIbZ1oS4DeZItlJUUe6qqa1bs,55640
8
+ python-extension/pyepanet.c,sha256=uc3gVN7uoMLLC3shTRnfAz5RMsK4D9Bt88kAnR0Hmrc,56051
9
9
  python-extension/pyepanet_plus.h,sha256=2Pz6cVxJas_nlcYVeYU3xnqXMTcsCJ18P-vnnZa_YAs,156
10
- python-extension/pyepanet2.c,sha256=h9HJE7B3X7wyXlFagOzN9hRLVqvwcJNc2WN-T3Y4emI,44567
10
+ python-extension/pyepanet2.c,sha256=KfoGO2AJQ4ttoKNpPYo3Z57HmJaR5vVsnlcF7bSi9TY,44875
11
11
  epanet-msx-src/mathexpr.h,sha256=1nbte9BLbqk8l9Ai2HhY1rqSmEUw0Ex03goUWBaN3QQ,1342
12
12
  epanet-msx-src/msxtoolkit.c,sha256=0KgIpPP28-sOCCExBaq1Hh8ib2J-W65kNf0-fR5D5OE,33863
13
13
  epanet-msx-src/msxqual.c,sha256=6Aj6Lu9ehnmjp-9AL3kN34aG4NaD8a9I6MQX93IjEpE,57805
@@ -43,17 +43,12 @@ epanet-msx-src/msxfuncs.c,sha256=uXdp0LUQapVIgE9Yj0V9qG99SSrvqzIt7olysuRKbJQ,436
43
43
  epanet-msx-src/msxfile.c,sha256=rVG-dKgvfrhaNP-Sy1_4EmTWi8GCwlAqYa0Vbnnk8aY,7068
44
44
  epanet-msx-src/include/epanetmsx.h,sha256=P4baHSK7NQzuwYhrWLE0VmieTlXW2XOQF52UgyhZDuk,3456
45
45
  epanet-msx-src/include/epanetmsx_export.h,sha256=h5UMaf6pH_0asRJOmhWUGAZhyA180ui2Cz8_y5h1FKw,1054
46
- epanet_plus/epanet_wrapper.py,sha256=YQggdIm7IBPd7sPzBSqgWCnFTNL6XCnnRu63LQJ4_-s,73126
46
+ epanet_plus/epanet_wrapper.py,sha256=e0DkZhO3wwi8Sp2d7ft1tE2OLNkn0twGGHaq_ltz-eY,73572
47
47
  epanet_plus/epanet_toolkit.py,sha256=VNAV_oqIWvuvuK7EvfV8DAc-3v94GIAeJvx1oUIVgEM,80937
48
48
  epanet_plus/__init__.py,sha256=XorLU8AO-crTDUwlM-EVyrOYynh3FrGkhQuSsWwI9Ls,215
49
- epanet_plus/VERSION,sha256=axN4nkPlSFY0Uz3hamXYup00xMl1hYi2ZYBUNfgOsRU,5
49
+ epanet_plus/VERSION,sha256=atlhOkVXmNbZLl9fOQq0uqcFlryGntaxf1zdKyhjXwY,5
50
50
  epanet_plus/epanet_plus.c,sha256=zWfYlLgYdQCQtIkVHNpgEBOBqJefeJX7H3cHZThkxnw,3183
51
51
  epanet_plus/include/epanet_plus.h,sha256=z2PEExuz6szxUp1k5vwsMQy2uSRz_X-W9B7xSP2f33s,340
52
- epanet_plus-0.0.1.dist-info/RECORD,,
53
- epanet_plus-0.0.1.dist-info/WHEEL,sha256=Prymy4iewnr2C3GLPmIomJyLIRtmCgaf6MSAdd7b500,135
54
- epanet_plus-0.0.1.dist-info/top_level.txt,sha256=IkN0NUJqQt4PPucWMqE1vZB7g2hodjY1A1iBTqsMtgs,97
55
- epanet_plus-0.0.1.dist-info/METADATA,sha256=NCBbW5G9wreRT6-ftlK69Tt_O89E7RyBfSH8_PXEZl4,5207
56
- epanet_plus-0.0.1.dist-info/licenses/LICENSE,sha256=q5jqVgUtLMJstE7DSa26FnVk3N2yAuQPCW6wCtQm6Eo,1074
57
52
  tests/test_epanetmsx.py,sha256=mAKTEscKVcZG_RKZg7fco7G6CQmLNK0XKnPJpT0EeFs,996
58
53
  tests/test_epyt.py,sha256=ZTIi5f4gfTPFCjIvpnGopcf5s8tAEDsAcha7QJUIxtc,3533
59
54
  tests/test_load_inp_from_buffer.py,sha256=-EqeKqI_-FNcARpe1SPrBs7lSNtMvfw6oUKyDPhIabo,543
@@ -103,3 +98,9 @@ epanet-src/include/epanet2_enums.h,sha256=vP4c3AhIB6Md2HLS8YaKVXADUqXiuJSu1NmNDl
103
98
  epanet-src/include/epanet2_2.h,sha256=JAs1spcJixip6zdSd0G-cWG19PGKBR6CKQM5UDGJiJg,77508
104
99
  epanet-src/include/epanet2.h,sha256=qggFwluyLeh0ZudO3aCowpq3Bq5da9exd5qhoXDCcEw,15274
105
100
  examples/basic_usage.py,sha256=c2PlqGFLPxpoe2f37neEN4T479deTqummNfojumzLUo,1087
101
+ examples/epanet_msx.py,sha256=_aPu9DaXH4H1tC6MEg8s2_8__W7QEhDGRGdprXaYbDY,1220
102
+ epanet_plus-0.1.0.dist-info/RECORD,,
103
+ epanet_plus-0.1.0.dist-info/WHEEL,sha256=Prymy4iewnr2C3GLPmIomJyLIRtmCgaf6MSAdd7b500,135
104
+ epanet_plus-0.1.0.dist-info/top_level.txt,sha256=IkN0NUJqQt4PPucWMqE1vZB7g2hodjY1A1iBTqsMtgs,97
105
+ epanet_plus-0.1.0.dist-info/METADATA,sha256=N_Go9IvqsySan_q-JBbGvUXX44ACz-3_Fl0-ssm0Evk,5275
106
+ epanet_plus-0.1.0.dist-info/licenses/LICENSE,sha256=q5jqVgUtLMJstE7DSa26FnVk3N2yAuQPCW6wCtQm6Eo,1074
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()
@@ -61,6 +61,23 @@ PyObject* method_EN_open(PyObject* self, PyObject* args)
61
61
  return PyTuple_Pack(1, PyLong_FromLong(err));
62
62
  }
63
63
 
64
+ PyObject* method_EN_openX(PyObject* self, PyObject* args)
65
+ {
66
+ uintptr_t ptr;
67
+ char* inpFile = NULL;
68
+ char* rptFile = NULL;
69
+ char* outFile = NULL;
70
+
71
+ if(!PyArg_ParseTuple(args, "Ksss", &ptr, &inpFile, &rptFile, &outFile)) {
72
+ return NULL;
73
+ }
74
+ EN_Project ph = (EN_Project) ptr;
75
+
76
+ int err = EN_openX(ph, inpFile, rptFile, outFile);
77
+
78
+ return PyTuple_Pack(1, PyLong_FromLong(err));
79
+ }
80
+
64
81
  PyObject* method_EN_gettitle(PyObject* self, PyObject* args)
65
82
  {
66
83
  uintptr_t ptr;
@@ -5,6 +5,7 @@ PyObject* method_EN_createproject(PyObject* self, PyObject* Py_UNUSED(args));
5
5
  PyObject* method_EN_deleteproject(PyObject* self, PyObject* args);
6
6
  PyObject* method_EN_init(PyObject* self, PyObject* args);
7
7
  PyObject* method_EN_open(PyObject* self, PyObject* args);
8
+ PyObject* method_EN_openX(PyObject* self, PyObject* args);
8
9
  PyObject* method_EN_gettitle(PyObject* self, PyObject* args);
9
10
  PyObject* method_EN_settitle(PyObject* self, PyObject* args);
10
11
  PyObject* method_EN_getcomment(PyObject* self, PyObject* args);
@@ -16,6 +16,18 @@ PyObject* method_ENopen(PyObject* self, PyObject* args)
16
16
  return PyTuple_Pack(1, PyLong_FromLong(err));
17
17
  }
18
18
 
19
+ PyObject* method_ENopenX(PyObject* self, PyObject* args)
20
+ {
21
+ char *inpFile, *rptFile, *outFile = NULL;
22
+
23
+ if(!PyArg_ParseTuple(args, "sss", &inpFile, &rptFile, &outFile)) {
24
+ return NULL;
25
+ }
26
+
27
+ int err = ENopenX(inpFile, rptFile, outFile);
28
+
29
+ return PyTuple_Pack(1, PyLong_FromLong(err));
30
+ }
19
31
 
20
32
  PyObject* method_ENclose(PyObject* self, PyObject* Py_UNUSED(args))
21
33
  {
@@ -2,6 +2,7 @@
2
2
 
3
3
 
4
4
  PyObject* method_ENopen(PyObject* self, PyObject* args);
5
+ PyObject* method_ENopenX(PyObject* self, PyObject* args);
5
6
  PyObject* method_ENclose(PyObject* self, PyObject* Py_UNUSED(args));
6
7
  PyObject* method_ENaddcontrol(PyObject* self, PyObject* args);
7
8
  PyObject* method_ENaddcurve(PyObject* self, PyObject* args);