mirror of
https://github.com/slsdetectorgroup/aare.git
synced 2026-02-19 16:48:42 +01:00
added docstrings wrap struct into tuple
This commit is contained in:
@@ -62,7 +62,13 @@ void define_Cluster(py::module &m, const std::string &typestr) {
|
||||
|
||||
.def(
|
||||
"max_sum_2x2",
|
||||
&Cluster<Type, ClusterSizeX, ClusterSizeY, CoordType>::max_sum_2x2);
|
||||
[](Cluster<Type, ClusterSizeX, ClusterSizeY, CoordType> &self) {
|
||||
auto max_sum = self.max_sum_2x2();
|
||||
return py::make_tuple(max_sum.sum,
|
||||
static_cast<int>(max_sum.index));
|
||||
},
|
||||
R"(calculates sum of 2x2 subcluster with highest energy and index relative to cluster center 0: top_left, 1: top_right, 2: bottom_left, 3: bottom_right
|
||||
)");
|
||||
}
|
||||
|
||||
template <typename T, uint8_t ClusterSizeX, uint8_t ClusterSizeY,
|
||||
|
||||
@@ -44,13 +44,16 @@ void define_ClusterVector(py::module &m, const std::string &typestr) {
|
||||
auto *vec = new std::vector<Type>(self.sum());
|
||||
return return_vector(vec);
|
||||
})
|
||||
.def("sum_2x2",
|
||||
[](ClusterVector<ClusterType> &self) {
|
||||
auto *vec = new std::vector<Sum_index_pair<Type, corner>>(
|
||||
self.sum_2x2());
|
||||
.def(
|
||||
"sum_2x2",
|
||||
[](ClusterVector<ClusterType> &self) {
|
||||
auto *vec = new std::vector<Sum_index_pair<Type, corner>>(
|
||||
self.sum_2x2());
|
||||
|
||||
return return_vector(vec);
|
||||
})
|
||||
return return_vector(vec);
|
||||
},
|
||||
R"(calculates sum of 2x2 subcluster with highest energy and index relative to cluster center 0: top_left, 1: top_right, 2: bottom_left, 3: bottom_right
|
||||
)")
|
||||
.def_property_readonly("size", &ClusterVector<ClusterType>::size)
|
||||
.def("item_size", &ClusterVector<ClusterType>::item_size)
|
||||
.def_property_readonly("fmt",
|
||||
|
||||
Reference in New Issue
Block a user