Skip to content

Commit c4e09e2

Browse files
dbhartkaklisekbonney
authored
Add EPANETMSX support to WNTR (#462)
* initial creation of MSX reaction object The class will be similar to the WaterNetworkModel in terms of its structure and options. * update requirements so that reactions test with sympy * Importing module before it existed, oops * Documentation updates * Code updates for MSX utilities * Forgot some files * Updated code structure checkin * Update to core reactions model codes * Updates to read things in - there are bugs * Updates to documentation and completing the I/O * Completed MSX-input file IO * Citations update * Adding a (very basic) citations class * Update documentation * Updates after internal discussion * Update to read/write citations on the WaterNetworkModel * Documentation updates * Update to add basic citation class * Getting rid of merge conflict * Exceptions (#133) * Update to exception documentation * Update documentation for EN errors * Update to sphinx config (#134) * Updates to toolkit * Rebase library * Updates to documentation, organization, and utilities * Rename * Typo * Updates to tests and organization * Updates for testing and documentation * Update to documentation and library functionality * Updates pulling MSX into the WaterNetworkModel * Added as a part of the WaterNetworkModel named "msx" * Made names consistent with wntr.network namings * Stashing * Update to package structure * Tests still broken, but now fully running MSX * Renaming to conform to other wntr styles * Updates to naming, documentation * Delete test file * Add test file * Updates to documentation for MSX * Update to example files and tests * Test updates * Fix tolerances * MSX documentation update * minor updates * MSX docs update (#135) * Add scheduled testing to workflow * MSX documentation update * minor updates --------- Co-authored-by: Kirk Bonney <[email protected]> * API docs update, removed excess imports, removed cite_msx * API docs update, removed excess imports, removed cite_msx (#136) * Add scheduled testing to workflow * MSX documentation update * minor updates * API docs update, removed excess imports, removed cite_msx --------- Co-authored-by: Kirk Bonney <[email protected]> * Docs update * Fix changed name * Update to correct the exceptions listings * fix exceptions * Updates to address comments in PR. Tests forthcoming * Added the tests for exceptions * Get rid of apidoc to match docs-theme * Exceptions/docs-theme merges * Final conflict * Updates to msx docs * Fixing typos * Adding MSX binary files and updating .gitignore * Update dll paths * Updating tests...ish * MSX binaries update * Updates to documentation configuration * Fix toolkit problems. * Updated MSX binaries, PR issued to EPANETMSX main * Updated toolkit to match modified code in MSX DLL * Fixed an error in the filename encoding * Updates to fix the wn.msx variable assignment * JSON schema commit * Update to MSX examples and bug fix * Update to MSX demo * Update to the MSX demo jupyter notebook. * Update to demo * MSX updates * Move library to new directory * Updates to documentation * New ipynb demo * various bug fixes * Reverting * add msx simulation test * Revert documentation config changes * Revert conf.py * Finish revert erroneous commits * CrowdStrike mess backup * This addresses comments made regarding the msx model files. Documentation is not pulled in this commit * Update the epanetmsx binary builds from the USEPA official branch * tests: correct filename in demo file, clean binary objects out of ipynb * Updates to MSX documentation * build: Update binaries with structure condusive to multi-platform Darwin builds * chore: Load libraries in a different manner * fix: misspelling in library name * fix: misspelling in library name in regular wntr too * fix: Update DLLs for EPANET * debug: mark threaded test as skip temporarily. All os/version combos are failing in the threading test, including using the old binaries. Trying to turn off the test first to see if it can get past this test. * fix: found bug with v2.2 threading * fix: updated the initial_quality to valid gis name * Test build script update * build: add libomp brew formula * fix: missing comma breaking demos. * docs: Update msx-library and string outputs in documentation * fix: skip doctest ordered list * test: Skip v2.0 on ARM processor * test: missed one test that needs to be skipped on arm processor * ci: Remove doctests for arm processor * ci: update release to proper macos names * test: remove spurrious print statement * Rename/move the brew formula for EPANETMSX compatibility. Also adds the ruby brew formula to the manifest for source distributions. * Remove duplicated MSX example file. --------- Co-authored-by: Katherine Klise <[email protected]> Co-authored-by: Kirk Bonney <[email protected]> Co-authored-by: kbonney <[email protected]>
1 parent 0badb0b commit c4e09e2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+8459
-590
lines changed

.github/workflows/build_tests.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
strategy:
1919
matrix:
2020
python-version: ['3.9', '3.10', '3.11', '3.12']
21-
os: [windows-latest, macOS-13, ubuntu-latest]
21+
os: [windows-latest, macOS-13, macos-latest, ubuntu-latest]
2222
fail-fast: false
2323
steps:
2424
- uses: actions/checkout@v4
@@ -48,7 +48,7 @@ jobs:
4848
strategy:
4949
matrix:
5050
python-version: ['3.9', '3.10', '3.11', '3.12']
51-
os: [windows-latest, macOS-13, ubuntu-latest]
51+
os: [windows-latest, macOS-13, macos-latest, ubuntu-latest]
5252
fail-fast: false
5353
steps:
5454
- name: Set up Python
@@ -73,27 +73,39 @@ jobs:
7373
strategy:
7474
matrix:
7575
python-version: ['3.9', '3.10', '3.11', '3.12']
76-
os: [windows-latest, macOS-13, ubuntu-latest]
76+
os: [windows-latest, macOS-13, ubuntu-latest, macos-latest]
7777
fail-fast: false
7878
steps:
7979
- uses: actions/checkout@v4
8080
- name: Set up Python ${{ matrix.python-version }}
8181
uses: actions/setup-python@v5
8282
with:
8383
python-version: ${{ matrix.python-version }}
84+
- if: ${{ matrix.os == 'macos-latest' || matrix.os == 'macOS-13'}}
85+
run: |
86+
brew reinstall --build-from-source --formula wntr/epanet/libepanet/darwin-formula/libomp.rb
8487
- name: Install dependencies
8588
run: |
8689
python --version
8790
python -m pip install --upgrade pip
8891
pip install -r requirements.txt
8992
python -m pip install -e .
9093
- name: Run Tests
94+
if: ${{ matrix.os != 'macos-latest' }}
9195
run: |
9296
coverage erase
9397
coverage run --context=${{ matrix.os }}.py${{ matrix.python-version }} --source=wntr --omit="*/tests/*","*/sim/network_isolation/network_isolation.py","*/sim/aml/evaluator.py" -m pytest --doctest-modules --doctest-glob="*.rst" wntr
9498
coverage run --context=${{ matrix.os }}.py${{ matrix.python-version }} --source=wntr --omit="*/tests/*","*/sim/network_isolation/network_isolation.py","*/sim/aml/evaluator.py" --append -m pytest --doctest-glob="*.rst" documentation
9599
env:
96100
COVERAGE_FILE: .coverage.${{ matrix.python-version }}.${{ matrix.os }}
101+
- name: Run Tests (ARM-processor)
102+
if: ${{ matrix.os == 'macos-latest'}}
103+
# doctests are not flexible enough to skip EPANET=v2.0 errors on ARM processor, so do not run doctests on ARM system
104+
run: |
105+
coverage erase
106+
coverage run --context=${{ matrix.os }}.py${{ matrix.python-version }} --source=wntr --omit="*/tests/*","*/sim/network_isolation/network_isolation.py","*/sim/aml/evaluator.py" -m pytest --doctest-modules --doctest-glob="*.rst" wntr
107+
env:
108+
COVERAGE_FILE: .coverage.${{ matrix.python-version }}.${{ matrix.os }}
97109
- name: Save coverage
98110
uses: actions/upload-artifact@v4
99111
with:

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
runs-on: ${{ matrix.os }}
1515
strategy:
1616
matrix:
17-
os: [windows-latest, macOS-13, macos-13, ubuntu-latest]
17+
os: [windows-latest, macos-latest, macos-13, ubuntu-latest]
1818
steps:
1919
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
2020
- name: Build wheels

.gitignore

Lines changed: 78 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,98 @@
1+
# Developer IDE directories
12
/.project
2-
/.spyproject
3-
_build/
3+
4+
# Spyder project settings
5+
.spyderproject
6+
.spyproject
7+
8+
# Rope project settings
9+
.ropeproject
10+
11+
# VS Code project settings
12+
*.code-workspace
13+
/.vscode
14+
15+
# IPython
16+
profile_default/
17+
ipython_config.py
18+
19+
# pyenv
20+
.python-version
21+
22+
# Environments
23+
.env
24+
.venv
25+
env/
26+
venv/
27+
ENV/
28+
env.bak/
29+
venv.bak/
30+
31+
# Distribution / packaging
32+
.Python
433
build/
5-
wntr.egg-info/
34+
develop-eggs/
635
dist/
36+
downloads/
37+
eggs/
38+
.eggs/
39+
lib/
40+
lib64/
41+
parts/
42+
sdist/
43+
var/
44+
wheels/
45+
share/python-wheels/
46+
*.egg-info/
47+
.installed.cfg
48+
*.egg
749
docker/
850
/.vscode
951

52+
# Byte-compiled / optimized / DLL files
53+
__pycache__/
54+
*.py[cod]
55+
*$py.class
56+
57+
# Unit test / coverage reports
58+
htmlcov/
59+
.tox/
60+
.nox/
61+
.coverage
62+
.coverage.*
63+
.cache
64+
nosetests.xml
65+
coverage.xml
66+
*.cover
67+
.hypothesis/
68+
.pytest_cache/
69+
70+
# Mac cleanup
71+
**/.DS_Store
72+
73+
# Other items / test output
74+
temp*
1075
*.pyd
1176
*.pyc
1277
*.egg
13-
*.coverage
1478
*.ipynb
1579
*.html
1680
*.pickle
1781
*.xlsx
1882

19-
temp*
20-
2183
examples/*.inp
2284
wntr/tests/*.png
2385
wntr/tests/*.tif
2486

87+
# Documentation build files
88+
documentation/_build
2589
documentation/_local
2690
documentation/apidoc
91+
92+
# WNTR specific
93+
wntr/sim/aml/*.so
94+
wntr/sim/aml/*.dll
95+
wntr/sim/aml/*.dylib
96+
wntr/sim/network_isolation/*.so
97+
wntr/sim/network_isolation/*.dll
98+
wntr/sim/network_isolation/*.dylib

MANIFEST.in

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,7 @@ include wntr/sim/aml/evaluator*
77
include wntr/sim/aml/numpy.i
88
include wntr/sim/network_isolation/network_isolation*
99
include wntr/sim/network_isolation/numpy.i
10-
include wntr/tests/networks_for_testing/*.inp
10+
include wntr/tests/networks_for_testing/*.inp
11+
include wntr/library/msx/*.json
12+
include wntr/library/msx/*.msx
13+
include wntr/epanet/libepanet/darwin-formula/libomp.rb

0 commit comments

Comments
 (0)