Skip to content

point_in_objectp working#54

Closed
ChristopherHogan wants to merge 3 commits intoNanoComp:masterfrom
ChristopherHogan:chogan/pnt_in_obj
Closed

point_in_objectp working#54
ChristopherHogan wants to merge 3 commits intoNanoComp:masterfrom
ChristopherHogan:chogan/pnt_in_obj

Conversation

@ChristopherHogan
Copy link
Contributor

This PR isn't to merge, but to request feedback for the path I'm taking. I can successfully write

some_point in some_sphere

in python and it will call point_in_objectp(some_point, some_object), returning the correct result, but something seems off about this approach. Does it make sense to build up a pure python Sphere just to tear it apart in the typemap? It seems like we should just wrap ctlgeom-types.h and then do something like

point_in_objectp(meep.vector3(0, 0, 0), meep.sphere(center=meep.vector3(0, 0, 0), radius=2))

Then we wouldn't even need a typemap because the python objects would be SWIG proxy objects with types that correspond to the C types. I think I'm still unclear on exactly which header files we want to create python wrappers for.

@stevengj @HomerReid @oskooi

@stevengj
Copy link
Collaborator

My concern is that SWIG wouldn't create nice Python proxy objects for the C types in ctlgeom-types.h, so we won't have a nice Python API unless we make our "proxy objects" manually as you are doing here.

@ChristopherHogan
Copy link
Contributor Author

Okay. I'll continue with this approach. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants