mirror of
https://github.com/slsdetectorgroup/aare.git
synced 2026-11-10 00:53:54 +01:00
pybind: make Cluster and ClusterVector bindings module-local
- After upgrading to pybind11 3, duplicate registration of cluster-related types across `_aare` and `_aare_cuda` started failing. - Mark the `Cluster` and `ClusterVector` bindings as `py::module_local()` so each extension owns its local registration. Note: cluster objects from CPU and CUDA bindings are now distinct Python types.
This commit is contained in:
1 parent
7c91ce99c2
commit
133cedf755
2 files changed
+3
-2
No files matched your search
@@ -23,7 +23,7 @@ void define_Cluster(py::module &m, const std::string &typestr) {
|
|||||||
auto class_name = fmt::format("Cluster{}", typestr);
|
auto class_name = fmt::format("Cluster{}", typestr);
|
||||||
|
|
||||||
py::class_<Cluster<Type, ClusterSizeX, ClusterSizeY, CoordType>>(
|
py::class_<Cluster<Type, ClusterSizeX, ClusterSizeY, CoordType>>(
|
||||||
m, class_name.c_str(), py::buffer_protocol())
|
m, class_name.c_str(), py::buffer_protocol(), py::module_local())
|
||||||
|
|
||||||
.def(py::init([](CoordType x, CoordType y,
|
.def(py::init([](CoordType x, CoordType y,
|
||||||
py::array_t<Type, py::array::forcecast> data) {
|
py::array_t<Type, py::array::forcecast> data) {
|
||||||
|
|||||||
@@ -31,7 +31,8 @@ void define_ClusterVector(py::module &m, const std::string &typestr) {
|
|||||||
py::class_<ClusterVector<
|
py::class_<ClusterVector<
|
||||||
Cluster<Type, ClusterSizeX, ClusterSizeY, CoordType>, void>>(
|
Cluster<Type, ClusterSizeX, ClusterSizeY, CoordType>, void>>(
|
||||||
m, class_name.c_str(),
|
m, class_name.c_str(),
|
||||||
py::buffer_protocol())
|
py::buffer_protocol(),
|
||||||
|
py::module_local())
|
||||||
|
|
||||||
.def(py::init()) // TODO change!!!
|
.def(py::init()) // TODO change!!!
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user