asselapathirana / epanettools Goto Github PK
View Code? Open in Web Editor NEWEPANET calling API for python.
License: Other
EPANET calling API for python.
License: Other
I'm learning to match EPANET and PYTHON 3.9, so I need to install EPANETTOOLS module. I use pip install epanettools
as PyPI says, but I can't get it.
PyPI page: https://pypi.org/project/EPANETTOOLS/
The first line on my cmd response is: Building wheel for epanettools (setup.py) ... error
Then it says: ERROR: Command errored out with exit status 1
And it gets a numerous lines of red code.
How can I fix it?
I have try to install Epanet Tools in a virtual enviroment and it gives an error:
...
creating build/temp.linux-x86_64-3.7/src/epanettools/epanet
creating build/temp.linux-x86_64-3.7/src/epanettools/pdd
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Isrc/epanettools/adf -Isrc/epanettools/epanet -Isrc/epanettools/pdd -I/usr/include/python3.7m -I/home/pc/Downloads/odoya/venv/include/python3.7m -c src/epanettools/epanet/epanet.c -o build/temp.linux-x86_64-3.7/src/epanettools/epanet/epanet.o -Wno-format -O0
cc1: error: -Wformat-security ignored without -Wformat [-Werror=format-security]
cc1: some warnings being treated as errors
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Command "/home/pc/Downloads/odoya/venv/bin/python3.7 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-uzu2bnrs/EPANETTOOLS/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-tqpf78gl/install-record.txt --single-version-externally-managed --compile --install-headers /home/pc/Downloads/odoya/venv/include/site/python3.7/EPANETTOOLS" failed with error code 1 in /tmp/pip-install-uzu2bnrs/EPANETTOOLS/
Reading this looks like the problem is related to some argument format...
Hi,
Has anyone managed to retrieve pipe descriptions using the getlinkvalue function?
Thank you.
when use the codes of usage :
import os, pprint
pp=pprint.PrettyPrinter() # we'll use this later.
from epanettools.epanettools import EPANetSimulation, Node, Link, Network, Nodes,
... Links, Patterns, Pattern, Controls, Control # import all elements needed
from epanettools.examples import simple # this is just to get the path of standard examples
file = os.path.join(os.path.dirname(simple.file),'Net3.inp') # open an example
es=EPANetSimulation(file)
it shows that error 302. Could you help me to deal with this? Thank you.
P.S. I'm using python 3.7 with windows 10.
Hi Assela,
I failed to pip install the epanettools package. It said Failed building wheel for epanettools.....Command... failed with error code 1. I think the problem is I used Python3.5 and there's no wheel file for it. Could you please upload the .whl file for 3.5 version?
Thanks in advance.
Hello, good afternoon,
I have used example3 for this test. After running the code (below), I am comparing the graphs on node pressure from EPANET and Python, to check that they match. I am getting one different value on pressure (also on demand), for all nodes (as said, just for one specific hour, the other values seem to be all ok/shifted after the wrong value).
Do you know what the error could be?
Thank you
Best regards
CODE:
import os, pprint
pp=pprint.PrettyPrinter() # we'll use this later.
from epanettools.epanettools import EPANetSimulation, Node, Link, Network, Nodes, Links, Patterns, Pattern, Controls, Control # import all elements needed
from epanettools.examples import simple # this is just to get the path of standard examples
import matplotlib.pyplot as plt
file = os.path.join(os.path.dirname(simple.file),'Net3.inp') # open an example
es=EPANetSimulation(file)
hours=range(0,25)
n=es.network.nodes
m=es.network.links
n_id=(es.network.nodes[x].id for x in n)
m_id=(es.network.links[x].id for x in m)
es.run()
p=Node.value_type['EN_PRESSURE']
d=Node.value_type['EN_DEMAND']
p1=[]
for i in range(0,25):
p1.append(n[57].results[p][i] )
#d1.append(n[70].results[d][i] )
plt.plot(hours,p1)
plt.xticks(range(0,25))
plt.grid(True)
plt.show()
Thanks to your package,
I am trying to change the value of demand of a node but receive the error code 251. It works perfectly for other attributes such as elevation but not for demand. Can you please inform me about the issue?
Hello @asselapathirana, great work with this wrapper! I've been running some water quality analyses and just recently I tried to save a report directly from a run. Looking through the documentation, I saw that I can do the following to save a hydraulic analysis.
es.ENsaveH();
/* Define contents of the report */
es.ENresetreport()
es.ENsetreport("FILE myfile.rpt")
es.ENsetreport("NODES ALL")
es.ENsetreport("PRESSURE PRECISION 1")
es.ENsetreport("PRESSURE ABOVE 20")
/* Write the report to file */
es.ENreport()
However, with the quality analysis I noticed that it was somewhat different.
EninitQ()
takes in either 0 if nothing is to be saved to a file or 1 if data is supposed to be saved to a file, but whenever I run es.ENinitQ(1)
, my kernel crashes from what I assume to be a segfault.
Have you experienced this issue before? Should I do something differently to produce a water quality report?
Please let me know if I need to provide any other information.
Hello, I'm a student of electrical Engineering and I'm making a algorithm of optimization for calibration of a WDS. However,
I am not able to do iterates, it always gives the error 305. It's like he can only a few of iterates. How Can i solve this problem?
Hello,
While trying to do multiple simulations, i found out that if the number of simulations exceed 169 python raises the following error message :
File "C:############.py", line 118, in MyFunction
es.run()
File "C:\Python34\lib\site-packages\epanettools\epanettools.py", line 429, in run
Error(self.pd.ENsavehydfile(self.hydraulicfile))
File "C:\Python34\lib\site-packages\epanettools\epanettools.py", line 22, in Error
e, pdd_wrapper_class.ENgeterror(e, 500)[1])
AttributeError: type object 'pdd_wrapper_class' has no attribute 'ENgeterror'
I tried to catch the source of the problem in the epanettools library but in vain, it seems the function EN_Close() and EN_HClose aren't working properly.
Here are the things i tried :
***Changing the Temp files directory to my RAMDISK -> Didn't change a thing.
***Changing the os.remove() to shutil.rmtree(). in the close() reset() functions in epanettools.py file -> Nthing.
***Turning SaveFile to False -> Now it gets stuck at 250 Simulations and raises another error, if i remember it's about the SavHydFile function.
If you don't have time to fix the issue, is it possible to give a hint on the origin of the problem ?
Btw, I tried other Epanet Libraries for python, did a timing test on the simulation function on each of them found out this library is 10 times faster than the others. So basically there is no other other choice than to fix it !
Thank you.
Hello! In my code, I've done some iterations with the Epanet simulation, using epanettools and at the end of each iteration I've programmed to save all the new data in the same inp file, just changing it. If I ask for less than 70 iterations, the code run with no problems, but if I ask for more than 70 iterations, this Error 302 appears. Can someone explain why this error is occurring and how to solve it? I need more than 70 iterations in the code.
Thank you!
In version 1.0.0 I noticed the following:
If you run a number of simulations in a loop. after about 100 runs, the library returns errors. This is a minimal example. When range(1000,50,-10)
is modifed to say range(1000,50,-1)
so that the loop runs more than 100 times, it stop at 100.
Error: self.pd.ENsavehydfile(self.hydraulicfile)
fails and return code 305.
When you set the pattern, the demand will change across the 24 hours. How can I check the pressure whenever the multiplier changes every hour? Also, how can I set the pattern time step and the total duration?
epanettools fails to install on windows 10. I have used both a conda environment and a python windows version with a C compiler. This is the error:
cl : Command line error D8021 : invalid numeric argument '/Wno-format' error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\VC\\Tools\\MSVC\\14.13.26128\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
Hi,
I could use the PDD analysis using epanettools and pinpoint important pipes in water distribution systems.
For further analysis, I want to change PDD parameters such as threshold pressures and allowable convergence error.
How can I change these parameters in epanettools?
Thank you
Through testing with larger models (9000+ nodes and 10000+) I have found 2 issues with efficiency:
First of all it seems like .run() and .runq() are doing essentially the same thing twice.. they both take almost exactly the same amount of time to run which leads me to think if you could somehow combine the run and the runq into one it would really speed up run time. With the large models I described above, es.run() takes about 8 minutes and then right after that es.runq() takes another 8 minutes. I have a suspicion that combining the two would not take 16 mins to run.
Secondly, once the model has run (by this point 16 minutes have now elapsed) looping through and getting the results of each node and link takes about double that time! I'm not sure if the inefficiency is on my end of the wrapper's but it doesn't seem right that getting the results should take double the time it takes the model to run.
Here is my code for getting the node results (I get the results for links in a similar way):
node_list = es.network.nodes
nodes = {}
for node in node_list:
node = node + 1
node_id = node_list[node].id
nodes[node_id] = {}
nodes[node_id]["EN_QUALITY"] = node_list[node_id].results[12]
nodes[node_id]["EN_PRESSURE"] = node_list[node_id].results[11]
nodes[node_id]["EN_HEAD"] = node_list[node_id].results[10]
nodes[node_id]["EN_DEMAND"] = node_list[node_id].results[9]
If you have any ideas on either of these problems it would be very appreciated!
Thank you.
Hey,
When i'm "pip install epanettools",
I'm getting the following message: "error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools"
Run on Win 10
As of now, it is difficult to test packages before distribution. Following https://blog.ionelmc.ro/2014/05/25/python-packaging/ attempted to restructure. Need to follow it up and get it to compile with the new structure. Use tox for testing. Also need to arrange travis and appveyor CI.
Checked EN_STATUS in valves, pumps and pipes. Should return an array of values for the status, but always returns 0.
In my optimization work, the code is running for specific number of iterations (75) and after that it shows Epanet error 303, which means the code is unable to open report file. I am doing simple DDA and hydraulic simulation. ( no quality or PDA).
I have check my input file and also tried various changes in analysis option but still unable to work with larger iteration number.
EPANET 2.2
Python 3.7 64bit
pip works just find in all versions of python until 3.4. From any version above I get errors.
Collecting epanettools
Cache entry deserialization failed, entry ignored
Downloading https://files.pythonhosted.org/packages/7d/9e/c4af6107874d48a8ac9b94a5652e37106d09edcbd7c2d903e7e4e5e43de1/EPANETTOOLS-0.9.2.tar.gz (300kB)
100% |████████████████████████████████| 307kB 1.3MB/s
Building wheels for collected packages: epanettools
Running setup.py bdist_wheel for epanettools ... error
Complete output from command C:\Users\amin\Anaconda3\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\amin\\AppData\\Local\\Temp\\pip-build-hvax8s6_\\epanettools\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d C:\Users\amin\AppData\Local\Temp\tmph4s7c7sqpip-wheel- --python-tag cp36:
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.6
creating build\lib.win-amd64-3.6\epanettools
copying src\epanettools\adf.py -> build\lib.win-amd64-3.6\epanettools
copying src\epanettools\cli.py -> build\lib.win-amd64-3.6\epanettools
copying src\epanettools\epanet2.py -> build\lib.win-amd64-3.6\epanettools
copying src\epanettools\epanettools.py -> build\lib.win-amd64-3.6\epanettools
copying src\epanettools\pdd.py -> build\lib.win-amd64-3.6\epanettools
copying src\epanettools\pdd_class_wrapper.py -> build\lib.win-amd64-3.6\epanettools
copying src\epanettools\tools.py -> build\lib.win-amd64-3.6\epanettools
copying src\epanettools\__init__.py -> build\lib.win-amd64-3.6\epanettools
copying src\epanettools\__main__.py -> build\lib.win-amd64-3.6\epanettools
running egg_info
writing src\EPANETTOOLS.egg-info\PKG-INFO
writing dependency_links to src\EPANETTOOLS.egg-info\dependency_links.txt
writing entry points to src\EPANETTOOLS.egg-info\entry_points.txt
writing top-level names to src\EPANETTOOLS.egg-info\top_level.txt
reading manifest file 'src\EPANETTOOLS.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no directories found matching 'examples'
warning: no files found matching '.isort.cfg'
warning: no previously-included files found matching 'tests\*.inp'
warning: no previously-included files matching '*.py[cod]' found anywhere in distribution
warning: no previously-included files matching '__pycache__' found anywhere in distribution
warning: no previously-included files matching '*.so' found anywhere in distribution
warning: no previously-included files matching '*.dylib' found anywhere in distribution
writing manifest file 'src\EPANETTOOLS.egg-info\SOURCES.txt'
copying src\epanettools\adf.i -> build\lib.win-amd64-3.6\epanettools
copying src\epanettools\adf_wrap.cxx -> build\lib.win-amd64-3.6\epanettools
copying src\epanettools\epanet2.i -> build\lib.win-amd64-3.6\epanettools
copying src\epanettools\epanet2_wrap.c -> build\lib.win-amd64-3.6\epanettools
copying src\epanettools\patch.c -> build\lib.win-amd64-3.6\epanettools
copying src\epanettools\patch.h -> build\lib.win-amd64-3.6\epanettools
copying src\epanettools\pdd.i -> build\lib.win-amd64-3.6\epanettools
copying src\epanettools\pdd_wrap.cxx -> build\lib.win-amd64-3.6\epanettools
creating build\lib.win-amd64-3.6\epanettools\adf
copying src\epanettools\adf\adfandenergycalc.h -> build\lib.win-amd64-3.6\epanettools\adf
copying src\epanettools\adf\callepanet.cc -> build\lib.win-amd64-3.6\epanettools\adf
copying src\epanettools\adf\callepanet.h -> build\lib.win-amd64-3.6\epanettools\adf
copying src\epanettools\adf\main.cc -> build\lib.win-amd64-3.6\epanettools\adf
creating build\lib.win-amd64-3.6\epanettools\epanet
copying src\epanettools\epanet\enumstxt.h -> build\lib.win-amd64-3.6\epanettools\epanet
copying src\epanettools\epanet\epanet.c -> build\lib.win-amd64-3.6\epanettools\epanet
copying src\epanettools\epanet\epanet2.h -> build\lib.win-amd64-3.6\epanettools\epanet
copying src\epanettools\epanet\funcs.h -> build\lib.win-amd64-3.6\epanettools\epanet
copying src\epanettools\epanet\hash.c -> build\lib.win-amd64-3.6\epanettools\epanet
copying src\epanettools\epanet\hash.h -> build\lib.win-amd64-3.6\epanettools\epanet
copying src\epanettools\epanet\hydraul.c -> build\lib.win-amd64-3.6\epanettools\epanet
copying src\epanettools\epanet\inpfile.c -> build\lib.win-amd64-3.6\epanettools\epanet
copying src\epanettools\epanet\input1.c -> build\lib.win-amd64-3.6\epanettools\epanet
copying src\epanettools\epanet\input2.c -> build\lib.win-amd64-3.6\epanettools\epanet
copying src\epanettools\epanet\input3.c -> build\lib.win-amd64-3.6\epanettools\epanet
copying src\epanettools\epanet\mempool.c -> build\lib.win-amd64-3.6\epanettools\epanet
copying src\epanettools\epanet\mempool.h -> build\lib.win-amd64-3.6\epanettools\epanet
copying src\epanettools\epanet\output.c -> build\lib.win-amd64-3.6\epanettools\epanet
copying src\epanettools\epanet\quality.c -> build\lib.win-amd64-3.6\epanettools\epanet
copying src\epanettools\epanet\report.c -> build\lib.win-amd64-3.6\epanettools\epanet
copying src\epanettools\epanet\rules.c -> build\lib.win-amd64-3.6\epanettools\epanet
copying src\epanettools\epanet\smatrix.c -> build\lib.win-amd64-3.6\epanettools\epanet
copying src\epanettools\epanet\text.h -> build\lib.win-amd64-3.6\epanettools\epanet
copying src\epanettools\epanet\toolkit.h -> build\lib.win-amd64-3.6\epanettools\epanet
copying src\epanettools\epanet\types.h -> build\lib.win-amd64-3.6\epanettools\epanet
copying src\epanettools\epanet\vars.h -> build\lib.win-amd64-3.6\epanettools\epanet
creating build\lib.win-amd64-3.6\epanettools\examples
copying src\epanettools\examples\__init__.py -> build\lib.win-amd64-3.6\epanettools\examples
creating build\lib.win-amd64-3.6\epanettools\examples\simple
copying src\epanettools\examples\simple\Net1.inp -> build\lib.win-amd64-3.6\epanettools\examples\simple
copying src\epanettools\examples\simple\Net2.inp -> build\lib.win-amd64-3.6\epanettools\examples\simple
copying src\epanettools\examples\simple\Net3.inp -> build\lib.win-amd64-3.6\epanettools\examples\simple
copying src\epanettools\examples\simple\__init__.py -> build\lib.win-amd64-3.6\epanettools\examples\simple
copying src\epanettools\examples\simple\epanet2_test.py -> build\lib.win-amd64-3.6\epanettools\examples\simple
creating build\lib.win-amd64-3.6\epanettools\pdd
copying src\epanettools\pdd\README.txt -> build\lib.win-amd64-3.6\epanettools\pdd
copying src\epanettools\pdd\emitter_analysis.cpp -> build\lib.win-amd64-3.6\epanettools\pdd
copying src\epanettools\pdd\include.h -> build\lib.win-amd64-3.6\epanettools\pdd
copying src\epanettools\pdd\mods.cpp -> build\lib.win-amd64-3.6\epanettools\pdd
copying src\epanettools\pdd\wrap.cpp -> build\lib.win-amd64-3.6\epanettools\pdd
copying src\epanettools\pdd\wrapper.h -> build\lib.win-amd64-3.6\epanettools\pdd
running build_ext
building '_epanet2' extension
error: [WinError 3] The system cannot find the path specified: 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\PlatformSDK\\lib'
----------------------------------------
Failed building wheel for epanettools
Running setup.py clean for epanettools
Failed to build epanettools
Installing collected packages: epanettools
Running setup.py install for epanettools ... error
Complete output from command C:\Users\amin\Anaconda3\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\amin\\AppData\\Local\\Temp\\pip-build-hvax8s6_\\epanettools\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\amin\AppData\Local\Temp\pip-mugtf0ls-record\install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.6
creating build\lib.win-amd64-3.6\epanettools
copying src\epanettools\adf.py -> build\lib.win-amd64-3.6\epanettools
copying src\epanettools\cli.py -> build\lib.win-amd64-3.6\epanettools
copying src\epanettools\epanet2.py -> build\lib.win-amd64-3.6\epanettools
copying src\epanettools\epanettools.py -> build\lib.win-amd64-3.6\epanettools
copying src\epanettools\pdd.py -> build\lib.win-amd64-3.6\epanettools
copying src\epanettools\pdd_class_wrapper.py -> build\lib.win-amd64-3.6\epanettools
copying src\epanettools\tools.py -> build\lib.win-amd64-3.6\epanettools
copying src\epanettools\__init__.py -> build\lib.win-amd64-3.6\epanettools
copying src\epanettools\__main__.py -> build\lib.win-amd64-3.6\epanettools
running egg_info
writing src\EPANETTOOLS.egg-info\PKG-INFO
writing dependency_links to src\EPANETTOOLS.egg-info\dependency_links.txt
writing entry points to src\EPANETTOOLS.egg-info\entry_points.txt
writing top-level names to src\EPANETTOOLS.egg-info\top_level.txt
reading manifest file 'src\EPANETTOOLS.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no directories found matching 'examples'
warning: no files found matching '.isort.cfg'
warning: no previously-included files found matching 'tests\*.inp'
warning: no previously-included files matching '*.py[cod]' found anywhere in distribution
warning: no previously-included files matching '__pycache__' found anywhere in distribution
warning: no previously-included files matching '*.so' found anywhere in distribution
warning: no previously-included files matching '*.dylib' found anywhere in distribution
writing manifest file 'src\EPANETTOOLS.egg-info\SOURCES.txt'
copying src\epanettools\adf.i -> build\lib.win-amd64-3.6\epanettools
copying src\epanettools\adf_wrap.cxx -> build\lib.win-amd64-3.6\epanettools
copying src\epanettools\epanet2.i -> build\lib.win-amd64-3.6\epanettools
copying src\epanettools\epanet2_wrap.c -> build\lib.win-amd64-3.6\epanettools
copying src\epanettools\patch.c -> build\lib.win-amd64-3.6\epanettools
copying src\epanettools\patch.h -> build\lib.win-amd64-3.6\epanettools
copying src\epanettools\pdd.i -> build\lib.win-amd64-3.6\epanettools
copying src\epanettools\pdd_wrap.cxx -> build\lib.win-amd64-3.6\epanettools
creating build\lib.win-amd64-3.6\epanettools\adf
copying src\epanettools\adf\adfandenergycalc.h -> build\lib.win-amd64-3.6\epanettools\adf
copying src\epanettools\adf\callepanet.cc -> build\lib.win-amd64-3.6\epanettools\adf
copying src\epanettools\adf\callepanet.h -> build\lib.win-amd64-3.6\epanettools\adf
copying src\epanettools\adf\main.cc -> build\lib.win-amd64-3.6\epanettools\adf
creating build\lib.win-amd64-3.6\epanettools\epanet
copying src\epanettools\epanet\enumstxt.h -> build\lib.win-amd64-3.6\epanettools\epanet
copying src\epanettools\epanet\epanet.c -> build\lib.win-amd64-3.6\epanettools\epanet
copying src\epanettools\epanet\epanet2.h -> build\lib.win-amd64-3.6\epanettools\epanet
copying src\epanettools\epanet\funcs.h -> build\lib.win-amd64-3.6\epanettools\epanet
copying src\epanettools\epanet\hash.c -> build\lib.win-amd64-3.6\epanettools\epanet
copying src\epanettools\epanet\hash.h -> build\lib.win-amd64-3.6\epanettools\epanet
copying src\epanettools\epanet\hydraul.c -> build\lib.win-amd64-3.6\epanettools\epanet
copying src\epanettools\epanet\inpfile.c -> build\lib.win-amd64-3.6\epanettools\epanet
copying src\epanettools\epanet\input1.c -> build\lib.win-amd64-3.6\epanettools\epanet
copying src\epanettools\epanet\input2.c -> build\lib.win-amd64-3.6\epanettools\epanet
copying src\epanettools\epanet\input3.c -> build\lib.win-amd64-3.6\epanettools\epanet
copying src\epanettools\epanet\mempool.c -> build\lib.win-amd64-3.6\epanettools\epanet
copying src\epanettools\epanet\mempool.h -> build\lib.win-amd64-3.6\epanettools\epanet
copying src\epanettools\epanet\output.c -> build\lib.win-amd64-3.6\epanettools\epanet
copying src\epanettools\epanet\quality.c -> build\lib.win-amd64-3.6\epanettools\epanet
copying src\epanettools\epanet\report.c -> build\lib.win-amd64-3.6\epanettools\epanet
copying src\epanettools\epanet\rules.c -> build\lib.win-amd64-3.6\epanettools\epanet
copying src\epanettools\epanet\smatrix.c -> build\lib.win-amd64-3.6\epanettools\epanet
copying src\epanettools\epanet\text.h -> build\lib.win-amd64-3.6\epanettools\epanet
copying src\epanettools\epanet\toolkit.h -> build\lib.win-amd64-3.6\epanettools\epanet
copying src\epanettools\epanet\types.h -> build\lib.win-amd64-3.6\epanettools\epanet
copying src\epanettools\epanet\vars.h -> build\lib.win-amd64-3.6\epanettools\epanet
creating build\lib.win-amd64-3.6\epanettools\examples
copying src\epanettools\examples\__init__.py -> build\lib.win-amd64-3.6\epanettools\examples
creating build\lib.win-amd64-3.6\epanettools\examples\simple
copying src\epanettools\examples\simple\Net1.inp -> build\lib.win-amd64-3.6\epanettools\examples\simple
copying src\epanettools\examples\simple\Net2.inp -> build\lib.win-amd64-3.6\epanettools\examples\simple
copying src\epanettools\examples\simple\Net3.inp -> build\lib.win-amd64-3.6\epanettools\examples\simple
copying src\epanettools\examples\simple\__init__.py -> build\lib.win-amd64-3.6\epanettools\examples\simple
copying src\epanettools\examples\simple\epanet2_test.py -> build\lib.win-amd64-3.6\epanettools\examples\simple
creating build\lib.win-amd64-3.6\epanettools\pdd
copying src\epanettools\pdd\README.txt -> build\lib.win-amd64-3.6\epanettools\pdd
copying src\epanettools\pdd\emitter_analysis.cpp -> build\lib.win-amd64-3.6\epanettools\pdd
copying src\epanettools\pdd\include.h -> build\lib.win-amd64-3.6\epanettools\pdd
copying src\epanettools\pdd\mods.cpp -> build\lib.win-amd64-3.6\epanettools\pdd
copying src\epanettools\pdd\wrap.cpp -> build\lib.win-amd64-3.6\epanettools\pdd
copying src\epanettools\pdd\wrapper.h -> build\lib.win-amd64-3.6\epanettools\pdd
running build_ext
building '_epanet2' extension
error: [WinError 3] The system cannot find the path specified: 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\PlatformSDK\\lib'
----------------------------------------
Command "C:\Users\amin\Anaconda3\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\amin\\AppData\\Local\\Temp\\pip-build-hvax8s6_\\epanettools\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\amin\AppData\Local\Temp\pip-mugtf0ls-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\amin\AppData\Local\Temp\pip-build-hvax8s6_\epanettools\
You are using pip version 9.0.1, however version 10.0.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
C:\Users\amin>python -m pip install --upgrade pip
Collecting pip
Downloading https://files.pythonhosted.org/packages/0f/74/ecd13431bcc456ed390b44c8a6e917c1820365cbebcb6a8974d1cd045ab4/pip-10.0.1-py2.py3-none-any.whl (1.3MB)
100% |████████████████████████████████| 1.3MB 794kB/s
Installing collected packages: pip
Found existing installation: pip 9.0.1
Uninstalling pip-9.0.1:
Successfully uninstalled pip-9.0.1
Successfully installed pip-10.0.1
C:\Users\amin>pip install epanettools
Collecting epanettools
Using cached https://files.pythonhosted.org/packages/7d/9e/c4af6107874d48a8ac9b94a5652e37106d09edcbd7c2d903e7e4e5e43de1/EPANETTOOLS-0.9.2.tar.gz
Building wheels for collected packages: epanettools
Running setup.py bdist_wheel for epanettools ... error
Complete output from command c:\users\amin\anaconda3\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\amin\\AppData\\Local\\Temp\\pip-install-0iex4pkx\\epanettools\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d C:\Users\amin\AppData\Local\Temp\pip-wheel-6yjk0p_1 --python-tag cp36:
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.6
creating build\lib.win-amd64-3.6\epanettools
copying src\epanettools\adf.py -> build\lib.win-amd64-3.6\epanettools
copying src\epanettools\cli.py -> build\lib.win-amd64-3.6\epanettools
copying src\epanettools\epanet2.py -> build\lib.win-amd64-3.6\epanettools
copying src\epanettools\epanettools.py -> build\lib.win-amd64-3.6\epanettools
copying src\epanettools\pdd.py -> build\lib.win-amd64-3.6\epanettools
copying src\epanettools\pdd_class_wrapper.py -> build\lib.win-amd64-3.6\epanettools
copying src\epanettools\tools.py -> build\lib.win-amd64-3.6\epanettools
copying src\epanettools\__init__.py -> build\lib.win-amd64-3.6\epanettools
copying src\epanettools\__main__.py -> build\lib.win-amd64-3.6\epanettools
running egg_info
writing src\EPANETTOOLS.egg-info\PKG-INFO
writing dependency_links to src\EPANETTOOLS.egg-info\dependency_links.txt
writing entry points to src\EPANETTOOLS.egg-info\entry_points.txt
writing top-level names to src\EPANETTOOLS.egg-info\top_level.txt
reading manifest file 'src\EPANETTOOLS.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no directories found matching 'examples'
warning: no files found matching '.isort.cfg'
warning: no previously-included files found matching 'tests\*.inp'
warning: no previously-included files matching '*.py[cod]' found anywhere in distribution
warning: no previously-included files matching '__pycache__' found anywhere in distribution
warning: no previously-included files matching '*.so' found anywhere in distribution
warning: no previously-included files matching '*.dylib' found anywhere in distribution
writing manifest file 'src\EPANETTOOLS.egg-info\SOURCES.txt'
copying src\epanettools\adf.i -> build\lib.win-amd64-3.6\epanettools
copying src\epanettools\adf_wrap.cxx -> build\lib.win-amd64-3.6\epanettools
copying src\epanettools\epanet2.i -> build\lib.win-amd64-3.6\epanettools
copying src\epanettools\epanet2_wrap.c -> build\lib.win-amd64-3.6\epanettools
copying src\epanettools\patch.c -> build\lib.win-amd64-3.6\epanettools
copying src\epanettools\patch.h -> build\lib.win-amd64-3.6\epanettools
copying src\epanettools\pdd.i -> build\lib.win-amd64-3.6\epanettools
copying src\epanettools\pdd_wrap.cxx -> build\lib.win-amd64-3.6\epanettools
creating build\lib.win-amd64-3.6\epanettools\adf
copying src\epanettools\adf\adfandenergycalc.h -> build\lib.win-amd64-3.6\epanettools\adf
copying src\epanettools\adf\callepanet.cc -> build\lib.win-amd64-3.6\epanettools\adf
copying src\epanettools\adf\callepanet.h -> build\lib.win-amd64-3.6\epanettools\adf
copying src\epanettools\adf\main.cc -> build\lib.win-amd64-3.6\epanettools\adf
creating build\lib.win-amd64-3.6\epanettools\epanet
copying src\epanettools\epanet\enumstxt.h -> build\lib.win-amd64-3.6\epanettools\epanet
copying src\epanettools\epanet\epanet.c -> build\lib.win-amd64-3.6\epanettools\epanet
copying src\epanettools\epanet\epanet2.h -> build\lib.win-amd64-3.6\epanettools\epanet
copying src\epanettools\epanet\funcs.h -> build\lib.win-amd64-3.6\epanettools\epanet
copying src\epanettools\epanet\hash.c -> build\lib.win-amd64-3.6\epanettools\epanet
copying src\epanettools\epanet\hash.h -> build\lib.win-amd64-3.6\epanettools\epanet
copying src\epanettools\epanet\hydraul.c -> build\lib.win-amd64-3.6\epanettools\epanet
copying src\epanettools\epanet\inpfile.c -> build\lib.win-amd64-3.6\epanettools\epanet
copying src\epanettools\epanet\input1.c -> build\lib.win-amd64-3.6\epanettools\epanet
copying src\epanettools\epanet\input2.c -> build\lib.win-amd64-3.6\epanettools\epanet
copying src\epanettools\epanet\input3.c -> build\lib.win-amd64-3.6\epanettools\epanet
copying src\epanettools\epanet\mempool.c -> build\lib.win-amd64-3.6\epanettools\epanet
copying src\epanettools\epanet\mempool.h -> build\lib.win-amd64-3.6\epanettools\epanet
copying src\epanettools\epanet\output.c -> build\lib.win-amd64-3.6\epanettools\epanet
copying src\epanettools\epanet\quality.c -> build\lib.win-amd64-3.6\epanettools\epanet
copying src\epanettools\epanet\report.c -> build\lib.win-amd64-3.6\epanettools\epanet
copying src\epanettools\epanet\rules.c -> build\lib.win-amd64-3.6\epanettools\epanet
copying src\epanettools\epanet\smatrix.c -> build\lib.win-amd64-3.6\epanettools\epanet
copying src\epanettools\epanet\text.h -> build\lib.win-amd64-3.6\epanettools\epanet
copying src\epanettools\epanet\toolkit.h -> build\lib.win-amd64-3.6\epanettools\epanet
copying src\epanettools\epanet\types.h -> build\lib.win-amd64-3.6\epanettools\epanet
copying src\epanettools\epanet\vars.h -> build\lib.win-amd64-3.6\epanettools\epanet
creating build\lib.win-amd64-3.6\epanettools\examples
copying src\epanettools\examples\__init__.py -> build\lib.win-amd64-3.6\epanettools\examples
creating build\lib.win-amd64-3.6\epanettools\examples\simple
copying src\epanettools\examples\simple\Net1.inp -> build\lib.win-amd64-3.6\epanettools\examples\simple
copying src\epanettools\examples\simple\Net2.inp -> build\lib.win-amd64-3.6\epanettools\examples\simple
copying src\epanettools\examples\simple\Net3.inp -> build\lib.win-amd64-3.6\epanettools\examples\simple
copying src\epanettools\examples\simple\__init__.py -> build\lib.win-amd64-3.6\epanettools\examples\simple
copying src\epanettools\examples\simple\epanet2_test.py -> build\lib.win-amd64-3.6\epanettools\examples\simple
creating build\lib.win-amd64-3.6\epanettools\pdd
copying src\epanettools\pdd\README.txt -> build\lib.win-amd64-3.6\epanettools\pdd
copying src\epanettools\pdd\emitter_analysis.cpp -> build\lib.win-amd64-3.6\epanettools\pdd
copying src\epanettools\pdd\include.h -> build\lib.win-amd64-3.6\epanettools\pdd
copying src\epanettools\pdd\mods.cpp -> build\lib.win-amd64-3.6\epanettools\pdd
copying src\epanettools\pdd\wrap.cpp -> build\lib.win-amd64-3.6\epanettools\pdd
copying src\epanettools\pdd\wrapper.h -> build\lib.win-amd64-3.6\epanettools\pdd
running build_ext
building '_epanet2' extension
error: [WinError 3] The system cannot find the path specified: 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\PlatformSDK\\lib'
----------------------------------------
Failed building wheel for epanettools
Running setup.py clean for epanettools
Failed to build epanettools
Installing collected packages: epanettools
Running setup.py install for epanettools ... error
Complete output from command c:\users\amin\anaconda3\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\amin\\AppData\\Local\\Temp\\pip-install-0iex4pkx\\epanettools\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\amin\AppData\Local\Temp\pip-record-eqol_t5m\install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.6
creating build\lib.win-amd64-3.6\epanettools
copying src\epanettools\adf.py -> build\lib.win-amd64-3.6\epanettools
copying src\epanettools\cli.py -> build\lib.win-amd64-3.6\epanettools
copying src\epanettools\epanet2.py -> build\lib.win-amd64-3.6\epanettools
copying src\epanettools\epanettools.py -> build\lib.win-amd64-3.6\epanettools
copying src\epanettools\pdd.py -> build\lib.win-amd64-3.6\epanettools
copying src\epanettools\pdd_class_wrapper.py -> build\lib.win-amd64-3.6\epanettools
copying src\epanettools\tools.py -> build\lib.win-amd64-3.6\epanettools
copying src\epanettools\__init__.py -> build\lib.win-amd64-3.6\epanettools
copying src\epanettools\__main__.py -> build\lib.win-amd64-3.6\epanettools
running egg_info
writing src\EPANETTOOLS.egg-info\PKG-INFO
writing dependency_links to src\EPANETTOOLS.egg-info\dependency_links.txt
writing entry points to src\EPANETTOOLS.egg-info\entry_points.txt
writing top-level names to src\EPANETTOOLS.egg-info\top_level.txt
reading manifest file 'src\EPANETTOOLS.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no directories found matching 'examples'
warning: no files found matching '.isort.cfg'
warning: no previously-included files found matching 'tests\*.inp'
warning: no previously-included files matching '*.py[cod]' found anywhere in distribution
warning: no previously-included files matching '__pycache__' found anywhere in distribution
warning: no previously-included files matching '*.so' found anywhere in distribution
warning: no previously-included files matching '*.dylib' found anywhere in distribution
writing manifest file 'src\EPANETTOOLS.egg-info\SOURCES.txt'
copying src\epanettools\adf.i -> build\lib.win-amd64-3.6\epanettools
copying src\epanettools\adf_wrap.cxx -> build\lib.win-amd64-3.6\epanettools
copying src\epanettools\epanet2.i -> build\lib.win-amd64-3.6\epanettools
copying src\epanettools\epanet2_wrap.c -> build\lib.win-amd64-3.6\epanettools
copying src\epanettools\patch.c -> build\lib.win-amd64-3.6\epanettools
copying src\epanettools\patch.h -> build\lib.win-amd64-3.6\epanettools
copying src\epanettools\pdd.i -> build\lib.win-amd64-3.6\epanettools
copying src\epanettools\pdd_wrap.cxx -> build\lib.win-amd64-3.6\epanettools
creating build\lib.win-amd64-3.6\epanettools\adf
copying src\epanettools\adf\adfandenergycalc.h -> build\lib.win-amd64-3.6\epanettools\adf
copying src\epanettools\adf\callepanet.cc -> build\lib.win-amd64-3.6\epanettools\adf
copying src\epanettools\adf\callepanet.h -> build\lib.win-amd64-3.6\epanettools\adf
copying src\epanettools\adf\main.cc -> build\lib.win-amd64-3.6\epanettools\adf
creating build\lib.win-amd64-3.6\epanettools\epanet
copying src\epanettools\epanet\enumstxt.h -> build\lib.win-amd64-3.6\epanettools\epanet
copying src\epanettools\epanet\epanet.c -> build\lib.win-amd64-3.6\epanettools\epanet
copying src\epanettools\epanet\epanet2.h -> build\lib.win-amd64-3.6\epanettools\epanet
copying src\epanettools\epanet\funcs.h -> build\lib.win-amd64-3.6\epanettools\epanet
copying src\epanettools\epanet\hash.c -> build\lib.win-amd64-3.6\epanettools\epanet
copying src\epanettools\epanet\hash.h -> build\lib.win-amd64-3.6\epanettools\epanet
copying src\epanettools\epanet\hydraul.c -> build\lib.win-amd64-3.6\epanettools\epanet
copying src\epanettools\epanet\inpfile.c -> build\lib.win-amd64-3.6\epanettools\epanet
copying src\epanettools\epanet\input1.c -> build\lib.win-amd64-3.6\epanettools\epanet
copying src\epanettools\epanet\input2.c -> build\lib.win-amd64-3.6\epanettools\epanet
copying src\epanettools\epanet\input3.c -> build\lib.win-amd64-3.6\epanettools\epanet
copying src\epanettools\epanet\mempool.c -> build\lib.win-amd64-3.6\epanettools\epanet
copying src\epanettools\epanet\mempool.h -> build\lib.win-amd64-3.6\epanettools\epanet
copying src\epanettools\epanet\output.c -> build\lib.win-amd64-3.6\epanettools\epanet
copying src\epanettools\epanet\quality.c -> build\lib.win-amd64-3.6\epanettools\epanet
copying src\epanettools\epanet\report.c -> build\lib.win-amd64-3.6\epanettools\epanet
copying src\epanettools\epanet\rules.c -> build\lib.win-amd64-3.6\epanettools\epanet
copying src\epanettools\epanet\smatrix.c -> build\lib.win-amd64-3.6\epanettools\epanet
copying src\epanettools\epanet\text.h -> build\lib.win-amd64-3.6\epanettools\epanet
copying src\epanettools\epanet\toolkit.h -> build\lib.win-amd64-3.6\epanettools\epanet
copying src\epanettools\epanet\types.h -> build\lib.win-amd64-3.6\epanettools\epanet
copying src\epanettools\epanet\vars.h -> build\lib.win-amd64-3.6\epanettools\epanet
creating build\lib.win-amd64-3.6\epanettools\examples
copying src\epanettools\examples\__init__.py -> build\lib.win-amd64-3.6\epanettools\examples
creating build\lib.win-amd64-3.6\epanettools\examples\simple
copying src\epanettools\examples\simple\Net1.inp -> build\lib.win-amd64-3.6\epanettools\examples\simple
copying src\epanettools\examples\simple\Net2.inp -> build\lib.win-amd64-3.6\epanettools\examples\simple
copying src\epanettools\examples\simple\Net3.inp -> build\lib.win-amd64-3.6\epanettools\examples\simple
copying src\epanettools\examples\simple\__init__.py -> build\lib.win-amd64-3.6\epanettools\examples\simple
copying src\epanettools\examples\simple\epanet2_test.py -> build\lib.win-amd64-3.6\epanettools\examples\simple
creating build\lib.win-amd64-3.6\epanettools\pdd
copying src\epanettools\pdd\README.txt -> build\lib.win-amd64-3.6\epanettools\pdd
copying src\epanettools\pdd\emitter_analysis.cpp -> build\lib.win-amd64-3.6\epanettools\pdd
copying src\epanettools\pdd\include.h -> build\lib.win-amd64-3.6\epanettools\pdd
copying src\epanettools\pdd\mods.cpp -> build\lib.win-amd64-3.6\epanettools\pdd
copying src\epanettools\pdd\wrap.cpp -> build\lib.win-amd64-3.6\epanettools\pdd
copying src\epanettools\pdd\wrapper.h -> build\lib.win-amd64-3.6\epanettools\pdd
running build_ext
building '_epanet2' extension
error: [WinError 3] The system cannot find the path specified: 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\PlatformSDK\\lib'
----------------------------------------
Command "c:\users\amin\anaconda3\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\amin\\AppData\\Local\\Temp\\pip-install-0iex4pkx\\epanettools\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\amin\AppData\Local\Temp\pip-record-eqol_t5m\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\amin\AppData\Local\Temp\pip-install-0iex4pkx\epanettools\
Hello,
I'm having issues trying to install the package. I've tried a few different methods of installation (pip, direct download from PyPi, and cloning Github repository) but still receive the same error upon using the pip
command or python setup.py install
command.
src/epanettools/epanet/epanet.c:135:10: fatal error: 'malloc.h' file not found
#include <malloc.h>
^
1 error generated.
error: command 'gcc' failed with exit status 1
Running the command using sudo
also did not help. Any ideas on what this malloc.h
file is?
Thanks.
To be done in the next cycle.
Hi,
I am working on Hydraulic Optimization using your epanet Simulation tool.
I was wondering if the Python implementation support pump curve manipulation. I would like to add a new PumpCurve and set the added Curve to a Link?
Thank you.
Hi,
I'm working with your toolkit for analyzing different configurations within an existing hydraulic network. I generate different scenarios, model them in sequence, and then perform some analysis around the results from EPANET. However, I'm running into an issue with all the temporary files that must be created if a change is made to the network.
I am using the function ENsaveinpfile to save the changes I've made to an open network (I make all changes on this same open network), and then have to open the new file to run the simulation. - I follow the network change example you provide (thank you for the detail!)
However, since I run multiple scenarios, I end up generating many temporary files, and cannot continue beyond ~50 simulations as there are too many files open (I know I can increase the space allocated to temporary files, but this isn't a reasonable solution as I'll need to run 1000+ simulations).
I've taken a look at the source code, epanettools.py at the _close() function and see that you've noted there is a bug. I've also tried to manually force a file close or remove (see list below), but get Windows 32 error (file cannot be accessed because it's being used by another process).
new_solver._close()
new_solver.ENclose()
os.remove(new_solver.rptfile)
Is this a bug that you will be working to address soon (I'm nearing the end of my project timeline and I would need this bug fixed), or have you been able to find a workaround that doesn't involve excessive memory allocation?
Is there any way to use the wrapper to get the global options/time options/report options of the .inp file?
We can release after merging the pdd branch. However, there are some improvements needed before that:
Hello
I want to know how can I query node base demand from EPANET to python?
I have read 'Some advanced result queries' in https://pypi.org/project/EPANETTOOLS/ . It only shows a max flow node id which above 4500 unit flow. But I want list of nodes which base demand above 0 and other results like table in EPANET.
my codes
`#%%1
n=es.network.nodes
num=0
for i in n:
if Node.value_type['EN_BASEDEMAND']<10:
num=num+1
print(num)
#No error but it counts all of my nodes and I don't know why..
#%%2
NodeID=[n[x].id for x in list(n)]
sorted([y.NodeID for x,y in range(0,len(n)) if ((y.results[d])>0 and y.node_type==j)])
#TypeError: cannot unpack non-iterable int object`
PLEASE HELP ME ..
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.