added template for making views (#377)
Build on RHEL9 / build (push) Successful in 3m4s
Build on RHEL8 / build (push) Successful in 3m32s
Run tests using data on local RHEL8 / build (push) Successful in 4m25s
Build on local RHEL8 / build (push) Successful in 3m8s

Cleaned up the helper functions by: 
- Added template for make_view (and new make_const_view) instead of the
copy paste implementation
- checks c_style and dimensions inside make_view
- test binding to be able to probe the checks in make_view

Call sites can be reviewed in a second PR since usage of const or
strictness of conversion depends...
This commit is contained in:
Erik Fröjdh authored and GitHub committed 2026-09-22 09:25:42 +02:00
1 parent cbc4864e93
commit 752ec38596
6 files changed
+189 -22

No files matched your search

-3
View File
@@ -48,9 +48,6 @@ void define_ClusterVector(py::module &m, const std::string &typestr) {
"__call__",
[](ClusterVector<ClusterType> &self,
py::array_t<bool, py::array::c_style> mask) {
if (mask.ndim() != 1) {
throw py::value_error("Mask must be one-dimensional");
}
return self(make_view_1d(mask));
},
py::arg("mask").noconvert(), R"doc(