Difference between revisions of "EPANET-Python"

From assela Pathirana
Jump to navigationJump to search
Line 1: Line 1:
[[file:QT4Agg_Epanet_pressure.png|500px|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 the main modeling tools students in my department were using (EPANET2.0 and EPA-SWMM5.0) 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!  
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 the main modeling tools students in my department were using (EPANET2.0 and EPA-SWMM5.0) 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!  



Revision as of 18:24, 5 April 2012

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 the main modeling tools students in my department were using (EPANET2.0 and EPA-SWMM5.0) 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

How to use

Linux

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