Difference between revisions of "EPANET-Python"
(20 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
[[file:QT4Agg_Epanet_pressure.png| | [[file:QT4Agg_Epanet_pressure.png|700px|right|thumb|EPANET-Python can combine EPANET tools with sophisticated Python capabilities like this Matplotlib graph]] | ||
When I started teaching programming for water professionals at UNESCO-IHE, I was compelled to use C/C++ as the language. This is due to the fact that | When I started teaching programming for water professionals at UNESCO-IHE, I was compelled to use C/C++ as the language. This is due to the fact that EPANET2.0 and EPA-SWMM5.0 (Two main programes, students in my department had to learn) were written in C language. However, C/C++ is a horrible first language. Students have to cover at least three days of learning of arcane syntax and rules before they begin to write some semi-useful code. On the other hand, if I could conduct the classes in Python, they will see the `light' within a few hours! They can start doing interesting and useful things from the very beginning of the study. What a way to stimulate learning! | ||
I wanted to make it possible to call EPANET2 and EPA-SWMM5.0 procedures from python. Following is the first attempt: | I wanted to make it possible to call EPANET2 and EPA-SWMM5.0 procedures from python. Following is the first attempt: | ||
Line 6: | Line 6: | ||
==Download== | ==Download== | ||
* [[ | * Test program with graphics using Matplotlib [[media:swig_python_epanet_toolkit.zip|swig_python_epanet_toolkit.zip]] | ||
* [[ | <!---/** Test program without graphics: [[media:swig_python_epanet_toolkit_pyplot.zip|swig_python_epanet_toolkit_pyplot.zip]] */--> | ||
==How to use== | ==How to use== | ||
===Linux=== | ===Linux=== | ||
Just use | |||
pip install epanettools | |||
or download from http://pypi.python.org/pypi/EPANETTOOLS | |||
python setup.py | and run as root | ||
[sudo] python setup.py install | |||
==OS-X== | ===OS-X=== | ||
Should work similar to Linux, but I don't have a Mac to test on :-) | Should work similar to Linux, but I don't have a Mac to test on :-) | ||
===Windows=== | ===Windows=== | ||
* Install a python stack with numpy and matplotlib | * Install a python stack with numpy and matplotlib. | ||
* use | ** Can use: Python 2.7 [http://www.python.org/getit/], numpy [http://sourceforge.net/projects/numpy/files/NumPy/1.6.1/] and Matplotlib [http://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-1.1.0/] | ||
* Download the windows installer from http://pypi.python.org/pypi/EPANETTOOLS and run. | |||
==Testing== | |||
* go to examples. | |||
==Hosted At== | |||
* http://pypi.python.org/pypi/EPANETTOOLS | |||
* Repository: http://code.google.com/p/epanettools/ | |||
== | ==See Also== | ||
* | * EPANET-Emitter [[EPANET]] | ||
[[category:Computing]][[category:Unix]][[Category:Hydrology-Meteorology]] |
Latest revision as of 23:31, 7 January 2013
When I started teaching programming for water professionals at UNESCO-IHE, I was compelled to use C/C++ as the language. This is due to the fact that EPANET2.0 and EPA-SWMM5.0 (Two main programes, students in my department had to learn) were written in C language. However, C/C++ is a horrible first language. Students have to cover at least three days of learning of arcane syntax and rules before they begin to write some semi-useful code. On the other hand, if I could conduct the classes in Python, they will see the `light' within a few hours! They can start doing interesting and useful things from the very beginning of the study. What a way to stimulate learning!
I wanted to make it possible to call EPANET2 and EPA-SWMM5.0 procedures from python. Following is the first attempt:
Download
- Test program with graphics using Matplotlib swig_python_epanet_toolkit.zip
How to use
Linux
Just use
pip install epanettools
or download from http://pypi.python.org/pypi/EPANETTOOLS and run as root
[sudo] python setup.py install
OS-X
Should work similar to Linux, but I don't have a Mac to test on :-)
Windows
- Install a python stack with numpy and matplotlib.
- Download the windows installer from http://pypi.python.org/pypi/EPANETTOOLS and run.
Testing
- go to examples.
Hosted At
See Also
- EPANET-Emitter EPANET