-
Notifications
You must be signed in to change notification settings - Fork 163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ENH: move c++ wrapping from pybind11 to nanobind #621
Conversation
@cookpa All the existing unit tests pass with the new wrapping and it should be good to go. The one thing I'm unsure of is the windows build. Particularly these lines Line 18 in cf801fc
The CMakeLists.txt either needs to have some conditional statement inside it or the ants + itk setup scripts need to be moved to the pyproject.toml file to be run before the cmakelists.txt (like the current setup), again with conditional logic. The third option is to have the OS conditional logic inside the ants + itk setup scripts... that's maybe easiest. |
I think CMake can do it:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Builds on my machine, definitely faster. Many thanks for this huge contribution
Docker builds too on Linux |
Ok great, thanks. I will add that. |
This PR primarily moves the C++ wrapping framework from pybind11 to nanobind. This should improve the project by making the build process faster, the wheels smaller, and the initial "import ants" statement quicker. Moreover, any c++ functions that take in only an ants image are now overloaded so the can be called without appending pixel type + dimension suffixes to the name.
The c++ source code has now been moved outside of the python module folder, as it should be, and the package now relies on a modern pyproject.toml file instead of setup.py.
No user-facing functions have been change and internal python code has been minimally altered.
All tests pass locally on mac and on the github actions. However, I have not tested that a windows build would work because only the ITK and ANTs setup scripts for linux are currently called.