-
Notifications
You must be signed in to change notification settings - Fork 53
Allow to implement Python bindings with pybind11 (start with mixture module) #1091
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
base: main
Are you sure you want to change the base?
Allow to implement Python bindings with pybind11 (start with mixture module) #1091
Conversation
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.
Pull Request Overview
This PR introduces Python bindings infrastructure for the 4C multiphysics library using pybind11, starting with the mixture module. The implementation creates a foundation for exposing C++ classes and functionality to Python through automatically generated bindings.
Key changes include:
- Implementation of a submodule registry system for organizing Python bindings
- Python bindings for mixture module fiber materials and remodel implementations
- CMake infrastructure for automatically generating pybind11 modules
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
pybind11/setup.py.in |
Template for Python package setup configuration |
pybind11/mixture/CMakeLists.txt |
CMake configuration for mixture module bindings |
pybind11/mixture/4C_mixture.cpp |
Python bindings implementation for mixture fiber classes |
pybind11/config/CMakeLists.txt |
CMake configuration for pybind11 config library |
pybind11/config/4C_config_submodule_registry.hpp |
Header defining submodule registry system |
pybind11/__init__.py.in |
Template for Python package initialization |
pybind11/CMakeLists.txt |
Main CMake configuration for Python bindings |
pybind11/4C_main.cpp |
Main module definition and submodule initialization |
cmake/functions/four_c_auto_define_pybind11_module.cmake |
CMake function for automatic module definition |
CMakeLists.txt |
Root CMake file with pybind11 subdirectory inclusion |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
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.
Looks interesting!
e3a7fd3 to
9a681f8
Compare
9a681f8 to
d75ffa1
Compare
d75ffa1 to
1037a79
Compare
This PR adds to possibility to add python bindings to 4C (similar to unit- or benchmark tests).
Draft for not since we need to figure out how we want to structure the directories. Where should we put the bindings (and the respective tests?)
Maybe something like this (once we have #81):
For our legacy modules, we need a top-level directory for all python bindings (I currently call it
pybind11)