epanet-plus 0.0.1__cp310-cp310-musllinux_1_2_x86_64.whl → 0.1.0__cp310-cp310-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.

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,4 +1,4 @@
1
- epanet.cpython-310-x86_64-linux-gnu.so,sha256=VNk4izoX6SvqZHI4P-0KHX_UgsF1f3KGkfHkDD8drcI,1972584
1
+ epanet.cpython-310-x86_64-linux-gnu.so,sha256=yT3MH7BPcCeGmQAwsGwgySsbCDQ3ocMiNNYPGGc0Fco,1973600
2
2
  docs/conf.py,sha256=xd41cfAn4qscUNt--XoojOmgC9kWUI7ZNfpLjbRPpuU,2132
3
3
  epanet-msx-src/dispersion.h,sha256=qYeHTzI4N2Y2ja0qGkKUBG6aGaD_erNgvHuhGgy0iLM,941
4
4
  epanet-msx-src/hash.c,sha256=bxilMFOs3t-UuI2ZxJQZrjbUi6sUNMrp6MO0Q5snMmo,2848
@@ -78,18 +78,19 @@ epanet-src/util/errormanager.c,sha256=yvdysNOo6yeoSWWYYGsBn6ywtpTmuV5Qpq4Vy_QIdL
78
78
  epanet-src/util/errormanager.h,sha256=ghebj0NO_1lvmFncgUt35t9Z9D4zrWwTSnpxzyfahig,982
79
79
  epanet-src/util/filemanager.c,sha256=ul4LdINZ8Lb273KPCRWo1KjCLC6dIzhWE62sXJwX5kc,4666
80
80
  epanet-src/util/filemanager.h,sha256=QM0J6ED52S-LjJIOJ3zYw0KRSGnQ9KCogJtf77kqsb0,1844
81
- epanet_plus/VERSION,sha256=axN4nkPlSFY0Uz3hamXYup00xMl1hYi2ZYBUNfgOsRU,5
81
+ epanet_plus/VERSION,sha256=atlhOkVXmNbZLl9fOQq0uqcFlryGntaxf1zdKyhjXwY,5
82
82
  epanet_plus/__init__.py,sha256=XorLU8AO-crTDUwlM-EVyrOYynh3FrGkhQuSsWwI9Ls,215
83
83
  epanet_plus/epanet_plus.c,sha256=zWfYlLgYdQCQtIkVHNpgEBOBqJefeJX7H3cHZThkxnw,3183
84
84
  epanet_plus/epanet_toolkit.py,sha256=VNAV_oqIWvuvuK7EvfV8DAc-3v94GIAeJvx1oUIVgEM,80937
85
- epanet_plus/epanet_wrapper.py,sha256=YQggdIm7IBPd7sPzBSqgWCnFTNL6XCnnRu63LQJ4_-s,73126
85
+ epanet_plus/epanet_wrapper.py,sha256=e0DkZhO3wwi8Sp2d7ft1tE2OLNkn0twGGHaq_ltz-eY,73572
86
86
  epanet_plus/include/epanet_plus.h,sha256=z2PEExuz6szxUp1k5vwsMQy2uSRz_X-W9B7xSP2f33s,340
87
87
  examples/basic_usage.py,sha256=c2PlqGFLPxpoe2f37neEN4T479deTqummNfojumzLUo,1087
88
+ examples/epanet_msx.py,sha256=_aPu9DaXH4H1tC6MEg8s2_8__W7QEhDGRGdprXaYbDY,1220
88
89
  python-extension/ext.c,sha256=sjDx2HWTY9Ov35rxDH0E6szI249YDCK5DT2EKLFSfVg,38183
89
- python-extension/pyepanet.c,sha256=YkhB-Ey_GsaCINczvEIIbZ1oS4DeZItlJUUe6qqa1bs,55640
90
- python-extension/pyepanet.h,sha256=jh7NJrkogyV78BwpVEFpXqxBQiNGLE1f1FaUlOTz-vs,9094
91
- python-extension/pyepanet2.c,sha256=h9HJE7B3X7wyXlFagOzN9hRLVqvwcJNc2WN-T3Y4emI,44567
92
- python-extension/pyepanet2.h,sha256=fmyrc6py14iiwvd-co_V4bQ_v46gp0hcNDhyKd7PhrQ,9064
90
+ python-extension/pyepanet.c,sha256=uc3gVN7uoMLLC3shTRnfAz5RMsK4D9Bt88kAnR0Hmrc,56051
91
+ python-extension/pyepanet.h,sha256=RUQ79GAv58Wo_FqFXcUgz4MpPA_t6tWze0P4wjFniJE,9153
92
+ python-extension/pyepanet2.c,sha256=KfoGO2AJQ4ttoKNpPYo3Z57HmJaR5vVsnlcF7bSi9TY,44875
93
+ python-extension/pyepanet2.h,sha256=tmaekND6Zb00Tl99TAa5M53nQnsoPZ-L0LfM1JKgBsA,9122
93
94
  python-extension/pyepanet_plus.c,sha256=A_6eN31QeNBw3nfACpblDsvndzvKB1N9Bq4qT6f6UUs,938
94
95
  python-extension/pyepanet_plus.h,sha256=2Pz6cVxJas_nlcYVeYU3xnqXMTcsCJ18P-vnnZa_YAs,156
95
96
  python-extension/pyepanetmsx.c,sha256=3uZcfLpyVFhOxzyqk-1iuLV8XRAcprOsKUCkj57JmL4,9282
@@ -98,8 +99,8 @@ tests/test_epanet.py,sha256=jgiqFiHZ3UB7on6WzbWKS6D0aXxIUTBCexDGoSmLitQ,463
98
99
  tests/test_epanetmsx.py,sha256=mAKTEscKVcZG_RKZg7fco7G6CQmLNK0XKnPJpT0EeFs,996
99
100
  tests/test_epyt.py,sha256=ZTIi5f4gfTPFCjIvpnGopcf5s8tAEDsAcha7QJUIxtc,3533
100
101
  tests/test_load_inp_from_buffer.py,sha256=-EqeKqI_-FNcARpe1SPrBs7lSNtMvfw6oUKyDPhIabo,543
101
- epanet_plus-0.0.1.dist-info/METADATA,sha256=NCBbW5G9wreRT6-ftlK69Tt_O89E7RyBfSH8_PXEZl4,5207
102
- epanet_plus-0.0.1.dist-info/WHEEL,sha256=YJPq7zroHSsdctrb_KymZ4ss41PkmaA9SD9TZzqKSX8,112
103
- epanet_plus-0.0.1.dist-info/top_level.txt,sha256=igwRsFnggi2fSCG7AHkP3LfOLlgsT2aUu0oa8DpvHDo,103
104
- epanet_plus-0.0.1.dist-info/RECORD,,
105
- epanet_plus-0.0.1.dist-info/licenses/LICENSE,sha256=q5jqVgUtLMJstE7DSa26FnVk3N2yAuQPCW6wCtQm6Eo,1074
102
+ epanet_plus-0.1.0.dist-info/METADATA,sha256=N_Go9IvqsySan_q-JBbGvUXX44ACz-3_Fl0-ssm0Evk,5275
103
+ epanet_plus-0.1.0.dist-info/WHEEL,sha256=YJPq7zroHSsdctrb_KymZ4ss41PkmaA9SD9TZzqKSX8,112
104
+ epanet_plus-0.1.0.dist-info/top_level.txt,sha256=igwRsFnggi2fSCG7AHkP3LfOLlgsT2aUu0oa8DpvHDo,103
105
+ epanet_plus-0.1.0.dist-info/RECORD,,
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);