mirror of
https://github.com/slsdetectorgroup/aare.git
synced 2026-10-31 11:41:27 +01:00
added template for making views (#377)
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:
1 parent
cbc4864e93
commit
752ec38596
6 files changed
+189
-22
No files matched your search
@@ -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(
|
||||
|
||||
Reference in new issue
Block a user