OpenWaterAnalytics / epanet-python

python wrapper for epanet library
76 stars 40 forks source link

what is the purpose of epanet_python? #50

Closed samhatchett closed 5 years ago

samhatchett commented 5 years ago

sorry for the uber-general issue title, but I can find no other way to express the root question I have.

In the other repo, it looks like epanet_py.c directly wraps and exposes most of the EPANET API, with the addition of an error manager layer. This file is an intermediate API that unpacks error conditions, and then the swig-generated toolkit_wrap.c / toolkit.py paired functions (in this repo) take care of appropriate type conversions and warning/exception throwing.

So the first question is about the interdependencies. In the EPANET repo:

... these are not needed for the EPANET toolkit/cli compilation or anything, so I'm confused as to where they really belong.

Now the real questions is - is all this necessary? I realize that this is the product of much effort, so I assume that much thought went into this structure. I'm looking for some written history of the events leading up to this, and I'm just not able to string together the narrative from issue-threads and commit messages.

I was under the impression that a major advantage of using SWIG is to automatically handle much of what is being done via these mechanisms by crafting a concise interface file. Does this not pan out in practice? I'm grateful for any background info, links, blogs, or otherwise.

samhatchett commented 5 years ago

this issue is adequately answered in the /owa-epanet/ directory