Skip to main content

epanet-msx-python

The python wrapper for epanet-msx.

Installation

  • Python version: 3.6+
pip install epanetmsx

Usage

Most of the functions are used in the same fashion as they would be in the C API, however it is not necessary to check the return values for an error code anymore. If an error occurs, an exception will be thrown stating the error code. The only major difference in calling functions using the python wrapper for epanet-msx is the way that values are returned. If a function in the C API took in a pointer as a parameter that was intended to be used as an output, it now will be returned by the function. For example:

// In C
int MSXgetindex(int type, char *id, int *index);
# In Python
index = msx.getindex(type, id)

If there are multiple pointers given that will be used for output. Python handles it like this:

// In C
int MSXgetspecies(int index, int *type, char *units, double *aTol, double *rTol);
# In Python
type, units, aTol, rTol = msx.getspecies(index)

Currently, there is only one function that uses a pointer variable for both input and output and it is the "t" variable in MSXstep. Example usage:

t, tleft = msx.step(t)

Check out this example for more details.

Development

Prerequisites

  • Install Cmake
  • Install Swig
  • pip install scikit-build

Ensure the epanet-msx subproject is initialized by running git submodule update --init. Then run and running the following commands (only run clean if you can run bash scripts). The following method uses scikit-build to invoke cmake for compiling and linking the shared libaries, and builds a python wheel.

./scripts/clean.sh
python setup.py sdist bdist_wheel
pip install dist/*.whl

There is also a script called build that will run the three commands from above. (build.sh should be called from the root)

./scripts/build.sh

Tests

There is a tests directory with a file that can be run using pytest for unit tests. All of the tests that are currently available are very basic, and mainly only test functions that are not utilized in either of the examples. Both of the examples are working, and therefore all of the critical functions that those use are working. It is more important that the example functions are running properly than the tests passing since the examples use more critical functions. To run the tests:

pytest tests/test_msx.py

Metadata

Release files for epanetmsx 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for epanetmsx 2.0.0
File Size Uploaded Provenance
epanetmsx-2.0.0.tar.gz 192.2 kB Without provenance Details

Built distributions (wheels)

Table of built distributions (wheels) for epanetmsx 2.0.0
File
epanetmsx-2.0.0-cp39-cp39-win_amd64.whl CPython 3.9 CPython 3.9 Windows x86-64 Details
epanetmsx-2.0.0-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.12+ x86-64 Details
epanetmsx-2.0.0-cp39-cp39-macosx_10_9_x86_64.whl CPython 3.9 CPython 3.9 macOS 10.9+ x86-64 Details
epanetmsx-2.0.0-cp38-cp38-win_amd64.whl CPython 3.8 CPython 3.8 Windows x86-64 Details
epanetmsx-2.0.0-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl CPython 3.8 CPython 3.8 Linux glibc 2.12+ x86-64 Details
epanetmsx-2.0.0-cp38-cp38-macosx_10_9_x86_64.whl CPython 3.8 CPython 3.8 macOS 10.9+ x86-64 Details
epanetmsx-2.0.0-cp37-cp37m-win_amd64.whl CPython 3.7 CPython 3.7 pymalloc Windows x86-64 Details
epanetmsx-2.0.0-cp37-cp37m-win32.whl CPython 3.7 CPython 3.7 pymalloc Windows x86-32 Details
epanetmsx-2.0.0-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.12+ x86-64 Details
epanetmsx-2.0.0-cp37-cp37m-macosx_10_9_x86_64.whl CPython 3.7 CPython 3.7 pymalloc macOS 10.9+ x86-64 Details
epanetmsx-2.0.0-cp36-cp36m-win_amd64.whl CPython 3.6 CPython 3.6 pymalloc Windows x86-64 Details
epanetmsx-2.0.0-cp36-cp36m-win32.whl CPython 3.6 CPython 3.6 pymalloc Windows x86-32 Details
epanetmsx-2.0.0-cp36-cp36m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.12+ x86-64 Details
epanetmsx-2.0.0-cp36-cp36m-macosx_10_9_x86_64.whl CPython 3.6 CPython 3.6 pymalloc macOS 10.9+ x86-64 Details

Total release size: 3.3 MB

Release files / epanetmsx-2.0.0.tar.gz

Download URL epanetmsx-2.0.0.tar.gz
Size 192.2 kB
Tags Source
SHA-256 checksum
How to use checksums
c2584251cc9ce716524fa120012f039ba562653f30bba0ea3dd76b4393ca797b
BLAKE2b-256 checksum
How to use checksums
368fae08999c9c87509013b452d1cdd6d42a5ba5dd5f9368c2f76c9e39ef05ad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

Release files / epanetmsx-2.0.0-cp39-cp39-win_amd64.whl

Download URL epanetmsx-2.0.0-cp39-cp39-win_amd64.whl
Size 189.4 kB
Tags CPython 3.9 Windows x86-64
SHA-256 checksum
How to use checksums
835f0d2af032dd0e6659272cb1b32a0519ab4ae63cf3b9d292f6a410f3367068
BLAKE2b-256 checksum
How to use checksums
8f133407b75e508bdb03864d7632e1bdcff612796eef1b88fb0b034cb99da518
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

Release files / epanetmsx-2.0.0-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl

Download URL epanetmsx-2.0.0-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Size 155.0 kB
Tags CPython 3.9 Linux glibc 2.12+ x86-64
SHA-256 checksum
How to use checksums
e8783a3135221c7b3b195f3a96c5169664746eac9e075be3fca1dc6a45b13297
BLAKE2b-256 checksum
How to use checksums
1c6ad812b488b482c28b415a0bbfbddd0e655d51b7826553de5572bd4bcc4062
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

Release files / epanetmsx-2.0.0-cp39-cp39-macosx_10_9_x86_64.whl

Download URL epanetmsx-2.0.0-cp39-cp39-macosx_10_9_x86_64.whl
Size 345.0 kB
Tags CPython 3.9 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
d2eef6f33948a05079bba1ac439505e8951fb73c8f2f64c46a8f8067b4cc8ba7
BLAKE2b-256 checksum
How to use checksums
d39c8d8eb4604d5dd70d367d5a49bf2a4dac98ebb02af3d5fe1f37b4f972fdc1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

Release files / epanetmsx-2.0.0-cp38-cp38-win_amd64.whl

Download URL epanetmsx-2.0.0-cp38-cp38-win_amd64.whl
Size 189.1 kB
Tags CPython 3.8 Windows x86-64
SHA-256 checksum
How to use checksums
d6a2b0b77b7e1bef284870d6ad1e04a57955ac97b33e7e2f311a24d8db428475
BLAKE2b-256 checksum
How to use checksums
70aa4812349997f819b403530add6f79e6785e7c6d54ae3a53d86d1f5b262fe5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

Release files / epanetmsx-2.0.0-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl

Download URL epanetmsx-2.0.0-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Size 155.8 kB
Tags CPython 3.8 Linux glibc 2.12+ x86-64
SHA-256 checksum
How to use checksums
1b6d0c12945d1334c396343bedbb2d86c6a0f9c977af0ce8735be5b29e2b7f84
BLAKE2b-256 checksum
How to use checksums
d993f1367ed6c58e5e7e6b18cb90ccd051f6845f85f32d6fb865334f60a8f039
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

Release files / epanetmsx-2.0.0-cp38-cp38-macosx_10_9_x86_64.whl

Download URL epanetmsx-2.0.0-cp38-cp38-macosx_10_9_x86_64.whl
Size 345.2 kB
Tags CPython 3.8 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
5f8e53f72accc265ecf9aa627fa7f8db3bd534059606736c54b31a11a29d578d
BLAKE2b-256 checksum
How to use checksums
c9ead6e9605a9a4b55759584bfa04ab6868fb9405d4f37e0001789c3b1d113b1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

Release files / epanetmsx-2.0.0-cp37-cp37m-win_amd64.whl

Download URL epanetmsx-2.0.0-cp37-cp37m-win_amd64.whl
Size 193.1 kB
Tags CPython 3.7 CPython 3.7 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
bff56ba4992d6edfb11d4fd01ad063f99a4255dd873794ea233a3a82c6c0f3c8
BLAKE2b-256 checksum
How to use checksums
5f7c275f792e1578efc20b3279f766667ed222f6242981f3c0fc4d956daa014e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

Release files / epanetmsx-2.0.0-cp37-cp37m-win32.whl

Download URL epanetmsx-2.0.0-cp37-cp37m-win32.whl
Size 188.6 kB
Tags CPython 3.7 CPython 3.7 pymalloc Windows x86-32
SHA-256 checksum
How to use checksums
7234896508148ffbce1fed09c0d83d73aa9dc23cb73beb0e50665f86469cd962
BLAKE2b-256 checksum
How to use checksums
add285411db287e414d32a33b02ef9a3a4164cda26c6da11b4f32f2085f6b88b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

Release files / epanetmsx-2.0.0-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl

Download URL epanetmsx-2.0.0-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Size 154.9 kB
Tags CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.12+ x86-64
SHA-256 checksum
How to use checksums
db4c8edecabf5681ad8bf3b09074fc95cce3144e5e9f0092ce043758ae9117d6
BLAKE2b-256 checksum
How to use checksums
1b67a42b96f5b12eba39b0f723916c8617b1277ad2faa1cf6d7a6e957cc576fd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

Release files / epanetmsx-2.0.0-cp37-cp37m-macosx_10_9_x86_64.whl

Download URL epanetmsx-2.0.0-cp37-cp37m-macosx_10_9_x86_64.whl
Size 344.7 kB
Tags CPython 3.7 CPython 3.7 pymalloc macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
3a9aba2d3235d0558f1d65f320116c54ce336e8dd3c58bb1b75fcbc93672a490
BLAKE2b-256 checksum
How to use checksums
a1cf69eec4d9900f71b4a86090ad4452760ccd413611a7f1040a1f22b145411e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

Release files / epanetmsx-2.0.0-cp36-cp36m-win_amd64.whl

Download URL epanetmsx-2.0.0-cp36-cp36m-win_amd64.whl
Size 193.2 kB
Tags CPython 3.6 CPython 3.6 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
f669d932f28f3cc487a1d3f3111647e82b2ade665bb539995049003c9237bf63
BLAKE2b-256 checksum
How to use checksums
11779b29688f51ece52c919a23ad5650bacc9739d5e0a63dc847bc096f117a18
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

Release files / epanetmsx-2.0.0-cp36-cp36m-win32.whl

Download URL epanetmsx-2.0.0-cp36-cp36m-win32.whl
Size 188.7 kB
Tags CPython 3.6 CPython 3.6 pymalloc Windows x86-32
SHA-256 checksum
How to use checksums
4b811d7c21ce283d20b234377c73a1369a416a1401ffcaa0ec08d6441e963065
BLAKE2b-256 checksum
How to use checksums
db76b711308151840c8339cb2d5b0c37827a7455cddb7082e2bb772e4bcb819b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

Release files / epanetmsx-2.0.0-cp36-cp36m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl

Download URL epanetmsx-2.0.0-cp36-cp36m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Size 154.9 kB
Tags CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.12+ x86-64
SHA-256 checksum
How to use checksums
742c8173b9963991d93c8cecf1a2b638ff0569e13b58be1f0f65e70f6aa07fea
BLAKE2b-256 checksum
How to use checksums
67604f442427ce0e2ed09a837a163ca40e8b4eabd88f9db96fd69be6700437dc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

Release files / epanetmsx-2.0.0-cp36-cp36m-macosx_10_9_x86_64.whl

Download URL epanetmsx-2.0.0-cp36-cp36m-macosx_10_9_x86_64.whl
Size 344.7 kB
Tags CPython 3.6 CPython 3.6 pymalloc macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
70fb7bd5c194ceb4ede4021429f1e5f1ade123bc27bd3c617cdb2152b671cf03
BLAKE2b-256 checksum
How to use checksums
9051a24c5cacf73d6548abe5370bd7cdeb4d27a6f2af2635ba13a2a7d0dc1c43
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

Security for epanetmsx 2.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

2.0.0 This release

15 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page