Closed r-barnes closed 4 years ago
Despite using pip
I have no familiarity with packaging something for it. Unsure how that all works. Absolutely interested in a template to gauge the feasibility / usefulness of it.
CGAL complicates things as it's a rather heavy dependency. My first question would be whether your CGAL dependency can be replaced by something a little more self-contained. If not, it's probably still possible to make a package work. You can use g++ -H
to identify the headers you're using and strip out the unnecessary ones.
I'm actively building this right now using PyBind11. If you take a glance at the top-level files (anything not in lib/
), I think you'll get the gist of it.
The steps are:
__init__.py
file, use meaningful function names, make some docstrings.src
directory, use PyBind11 to expose C++ to Python.setup.py
to build C++ code.If you decide to explore this, I'm happy to try to provide some guidance.
My first question would be whether your CGAL dependency can be replaced by something a little more self-contained.
Not really, or at least not easily.
There are not a lot of good Delaunay triangulation mesh generators that have user-supplied functions to determine if a triangle should be further refined or accepted. It is this feature that I use to insert the multi-objective refinement code. The hydrological model that I'm developing (it will be open sourced soon -- can take this off github if you'd like more details) is unstructured mesh based and sits on-top of the CGAL library to use CGAL's topology features. Thus, in addition to the convenience afforded by CGAL for the mesh generation, use of CGAL was also a natural choice.
I will take a look at your template and see if I can make something work. Thanks for the details!
pip support has now been added for v1.1 in commit e1edd2c983bff59105b1427605bee9bbd897adae
as detailed here https://mesher-hydro.readthedocs.io/en/latest/installation.html
Have you considered bundling this as a python package? It seems like you're pretty close to having something that would be releasable via pip. I can provide example code to help you move forward with that if you're interested.