WNTR
WNTR copied to clipboard
Please add Python 3.10 support
Please add Python 3.10 support. Thanks.
As reported in #194, it is possible to generate the necessary library for Python 3.10 in the sources of the latest release:
- set
use_swig
andbuild
to True in setup.py - execute the command
python setup.py build_ext --inplace
- use pip to install your local copy of wntr with
pip install --user -e [path to wntr]
As the PR is merged when can we expect a new release? :)
Thanks for inquiring. It took us a while to finalize the new build/release process that works without the precompiled files. I think we have that wrapped up now. I plan to post the release by the end of the week.
WNTR 0.5.0 has been tagged. The release is available through PyPI. We're working on some issues with the conda release.
@kaklise Works for python3.10 on linux.
But I get the same error still if I use it with pyscript, it uses wntr-0.5.0-py3-none-any.whl
.
Is this the conda release issue?
I can also reproduce it:
pip install wntr
wget https://files.pythonhosted.org/packages/12/96/5825a53339046f49ec20f82ff9ef518302322c1accd8becc47c96ab118fc/wntr-0.5.0-py3-none-any.whl
pip install wntr-0.5.0-py3-none-any.whl --force-reinstall
# Execute Python
python
>>> import wntr
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/python/3.10.4/lib/python3.10/site-packages/wntr/__init__.py", line 3, in <module>
from wntr import morph
File "/usr/local/python/3.10.4/lib/python3.10/site-packages/wntr/morph/__init__.py", line 13, in <module>
from wntr.morph.skel import skeletonize
File "/usr/local/python/3.10.4/lib/python3.10/site-packages/wntr/morph/skel.py", line 11, in <module>
from wntr.sim.core import WNTRSimulator
File "/usr/local/python/3.10.4/lib/python3.10/site-packages/wntr/sim/__init__.py", line 5, in <module>
from wntr.sim.core import WaterNetworkSimulator, WNTRSimulator
File "/usr/local/python/3.10.4/lib/python3.10/site-packages/wntr/sim/core.py", line 1, in <module>
import wntr.sim.hydraulics
File "/usr/local/python/3.10.4/lib/python3.10/site-packages/wntr/sim/hydraulics.py", line 13, in <module>
from wntr.sim import aml
File "/usr/local/python/3.10.4/lib/python3.10/site-packages/wntr/sim/aml/__init__.py", line 2, in <module>
from .aml import Model, ParamDict, VarDict, ConstraintDict, Constraint
File "/usr/local/python/3.10.4/lib/python3.10/site-packages/wntr/sim/aml/aml.py", line 3, in <module>
from .evaluator import Evaluator
File "/usr/local/python/3.10.4/lib/python3.10/site-packages/wntr/sim/aml/evaluator.py", line 13, in <module>
from ._evaluator import *
ModuleNotFoundError: No module named 'wntr.sim.aml._evaluator'
I should remove wntr-0.5.0-py3-none-any.whl
, that was uploaded by mistake. It still works, but the code needs to be built by the user. The other wheels that are specific to an operating system and python version (e.g., wntr-0.5.0-cp310-cp310-win_amd64.whl
) should not have this issue.
Alright, please keep us updated when you release a 0.5.1 without the any
wheel. (I have seen that you setup the release process in github-actions, if you need help with that. I am glad to help)
Seems like adding support for wntr running inside the WASM environment of pyscript needs some more work.
The any
wheel has been removed from the 0.5.0 release on PyPI. The github actions should push directly to PyPI on our next release (there was an issue with the token). I'm not familiar with the pyodide package you referenced, I'll take a look.
Thanks! I think you can close this issue then :)
It just crossed my mind that executing WNTR in WASM (in Browser) would enable enabling a faster and up to date version of https://github.com/sdteffen/epanet.js (+ all WNTR specific stuff) (until then https://github.com/modelcreate/epanet-js/ seems more up to date)