Difference between revisions of "EPANET-Python"
Line 20: | Line 20: | ||
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. | ||
** 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/] | |||
* use the epanettools/dist/epanettools-0.1.win32-py2.7.msi file to install. | * use the epanettools/dist/epanettools-0.1.win32-py2.7.msi file to install. | ||
==Testing== | ==Testing== | ||
* go to netbeans/EPANET/src and run the epanet.py | * go to netbeans/EPANET/src and run the epanet.py |
Revision as of 18:40, 5 April 2012
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 things at the onset of learning itself. 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 File:Swig python epanet toolkit.zip
- Test program without graphics: File:Swig python epanet toolkit pyplot.zip
How to use
Linux
- Make sure python2.7 python2.7-dev, numpy and matplotlib are installed
- Extract File:Swig python epanet toolkit pyplot.zip and go to epanetools directory and run the following command.
python setup.py build 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.
- use the epanettools/dist/epanettools-0.1.win32-py2.7.msi file to install.
Testing
- go to netbeans/EPANET/src and run the epanet.py