Skip to main content

a thin wrapper for epanet hydraulic toolkit

Project description

epanet python package

A slender, auto-generated python wrapper around the owa:epanet hydraulic network analysis toolkit. This package uses SWIG and scikit-build to generate python bindings into the C library. The objective of this package is to establish basic python support for the toolkit, rather than present a "pythonic" interface. More abstractions can be built atop this package to further abstract the API, but the set of functions here is meant to (as closely as practical) mirror the well-known and established C API.

Where possible, SWIG has been configured to throw warnings/exceptions instead of using the customary EPANET return integer value for success-checking. Also any output (pointer) parameters from the C API have been re-routed to return values. In these cases, the return tuple from the Python API will contain the values desired.

Installation

To install with pip:

pip install owa-epanet

Wheels are now provided for most installations, some extra work will be needed if installing from source.

Building the libraries

Ensure the EPANET subproject is initialized by running git submodule update --init (if necessary) and running the following commands (on Windows skip the line ./script/clean.sh). The following method uses scikit-build to invoke cmake for compiling and linking the shared libaries, and builds a python wheel.

./scripts/clean.sh
python3 setup.py sdist bdist_wheel

Test your builds using the following commands.

cd test && \
pipenv install ../dist/*.whl && \
pipenv install pytest && \
pipenv run pytest

This python library was packaged in the following way:

python3 setup.py sdist bdist_wheel
python3 -m twine upload dist/*

Versioning

This package loosely follows EPANET's release version numbers. Its major and minor numbers will correspond to the given EPANET version, but the patch number is independent. This system might change in the future.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

owa-epanet-2.2.4.tar.gz (797.3 kB view hashes)

Uploaded Source

Built Distributions

owa_epanet-2.2.4-cp310-cp310-win_amd64.whl (288.8 kB view hashes)

Uploaded CPython 3.10 Windows x86-64

owa_epanet-2.2.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (216.4 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

owa_epanet-2.2.4-cp310-cp310-macosx_10_9_x86_64.whl (186.2 kB view hashes)

Uploaded CPython 3.10 macOS 10.9+ x86-64

owa_epanet-2.2.4-cp39-cp39-win_amd64.whl (261.9 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

owa_epanet-2.2.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (216.4 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

owa_epanet-2.2.4-cp39-cp39-macosx_10_9_x86_64.whl (186.2 kB view hashes)

Uploaded CPython 3.9 macOS 10.9+ x86-64

owa_epanet-2.2.4-cp38-cp38-win_amd64.whl (288.7 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

owa_epanet-2.2.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (216.3 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

owa_epanet-2.2.4-cp38-cp38-macosx_10_9_x86_64.whl (186.4 kB view hashes)

Uploaded CPython 3.8 macOS 10.9+ x86-64

owa_epanet-2.2.4-cp37-cp37m-win_amd64.whl (261.6 kB view hashes)

Uploaded CPython 3.7m Windows x86-64

owa_epanet-2.2.4-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (215.9 kB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64

owa_epanet-2.2.4-cp37-cp37m-macosx_10_9_x86_64.whl (185.2 kB view hashes)

Uploaded CPython 3.7m macOS 10.9+ x86-64

owa_epanet-2.2.4-cp36-cp36m-win_amd64.whl (287.9 kB view hashes)

Uploaded CPython 3.6m Windows x86-64

owa_epanet-2.2.4-cp36-cp36m-win32.whl (261.5 kB view hashes)

Uploaded CPython 3.6m Windows x86

owa_epanet-2.2.4-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (215.9 kB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.17+ x86-64

owa_epanet-2.2.4-cp36-cp36m-macosx_10_9_x86_64.whl (185.2 kB view hashes)

Uploaded CPython 3.6m macOS 10.9+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page