-
Notifications
You must be signed in to change notification settings - Fork 25
Closed
Milestone
Description
@HDembinski suggested exposing the C++ wrapper objects as the cpp backend. That has possible pros and cons:
Cons:
- Directly exposes more of the C++ backend, which needs to be recompiled to be changed
- Requires "nice" API, such as named/optional arguments, in the PyBind layer. If something like FASTCALL is supported in the future, it may limit our option to use it.
- Readthedocs will not pick up the C++ docstrings (not that the
cppmodule is all that well documented now) - Improvements to the Python layer (like Pandas (and other array package) improved compatibility #380) will not be available to
cpp, like data conversions, indexing, and such. - Things hidden in Python, like the fact that each set of axis options is a different axis class, and there is a histogram class per storage, will not be hidden in
cppanymore - You won't be able to cast back and forth between Python and
cppobjects (but more on that later) - We can't protect against arbitrary Python objects being passed in, so some errors and even segfaults might not be avoidable (passing in an object with a broken repr segfaults PyBind11, for example, IIRC)
Pros:
- Simpler to maintain - learning the cpp interface will also be the bound interface (though not all workarounds for Python magically go away)
- Might simplify the casting structure. It is critical that all objects be subclassable for use by dependent projects (such as Hist), but the mapping process might get easier, as the common point could be the internal
cppobject. We need to keep good tests for this behavior if we remove the cpp family. - Less repetitive, more DRY
- Might get rid of the bindings being
_coreand become a publiccpp(basically both a pro and con - simpler but now public instead of private)
I think it boils down to the cpp interface - if is okay to be made less user friendly, dropping the extra layering should make maintenance simpler in the long run. @HDembinski, you are probably the heaviest user of cpp. I think it's very low priority - user-facing items like #380 are much more important. Maybe we should add a warning when cpp is imported that it is not considered a stable API?
Metadata
Metadata
Assignees
Labels
No labels