Skip to content

Commit 297bfce

Browse files
author
Sam Hatchett
committed
updates epanet submodule, clarifies running tests
1 parent b552db1 commit 297bfce

3 files changed

Lines changed: 8 additions & 6 deletions

File tree

owa-epanet/EPANET

owa-epanet/README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,24 @@
11
# epanet python package
22

3-
A slender, auto-generated python wrapper around owa:epanet hydraulic network analysis toolkit. This package uses SWIG and scikit-build to generate python bindings into the C library. The goal 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.
3+
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.
44

55
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.
66

77

88
## Building the libraries
99

10-
Ensure the EPANET subproject is populated 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.
10+
__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.
1111

1212
```
1313
./scripts/clean.sh
1414
python3 setup.py sdist bdist_wheel
1515
```
1616
Test your builds using the following commands.
1717
```
18-
cd test && pipenv install ../dist/*.whl && pipenv run python -c 'from epanet import toolkit; print(toolkit.__dict__)'
19-
18+
cd test && \
19+
pipenv install ../dist/*.whl && \
20+
pipenv install pytest && \
21+
pipenv run pytest
2022
```
2123

2224
This python library was packaged in the following way:

owa-epanet/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
setup(
88
name = "owa-epanet",
9-
version = "2.2",
9+
version = "2.2.1",
1010
author = "Sam Hatchett",
1111
author_email = "samhatchett@gmail.com",
1212
description = "a thin wrapper for epanet hydraulic toolkit",

0 commit comments

Comments
 (0)