OpenWaterAnalytics / epanet-python

python wrapper for epanet library
76 stars 40 forks source link

How to use SWIG wrapper createproject method? #18

Closed AbelHeinsbroek closed 5 years ago

AbelHeinsbroek commented 5 years ago

Could you give an example on the correct way to use the toolkit.createproject method? It does not seem to take arguments or return a project handler

michaeltryby commented 5 years ago

I will add some build instructions and tests to get you started.

michaeltryby commented 5 years ago

@AbelHeinsbroek you can find some rough build notes here. I am heading home for the evening. I will add some tests tomorrow.

michaeltryby commented 5 years ago

@AbelHeinsbroek I just merged a PR with a few tests to get you started. Let me know if you have any questions.

michaeltryby commented 5 years ago

@AbelHeinsbroek It's been awhile since I worked on this package. Looping back around I have realized that it isn't a drop in replacement for your ctypes wrapper just yet. There is more work required.

You can see from my merged PR's the type of work I'm talking about -- modifying the function declarations in toolkit.i to reference the typemaps and adding tests to make sure things are working as expected.

michaeltryby commented 5 years ago

@AbelHeinsbroek have you tried building the package?

AbelHeinsbroek commented 5 years ago

I did, it seems to work ok. For now I've made a quick update to the ctypes wrapper my project epynet is using to support the new thread-safe functions. I'll switch to the SWIG wrapper when toolkit version 2.2 is finalized.

michaeltryby commented 5 years ago

@AbelHeinsbroek I just finished up some work on epanet-python. I've got it to the point where it builds and tests automatically and can be packaged as a wheel. These packages could serve as replacements for the ctypes based epanet wrapper in your epynet package. Have a look and let me know what you think!