From 925781aa592b7120b749ddc2a7831b1b0758d0fb Mon Sep 17 00:00:00 2001 From: Michael Jackson Date: Wed, 17 Apr 2024 15:39:57 -0400 Subject: [PATCH] ENH: add a 'human_name' and 'name' convenience functions to PipelineFilter. Signed-off-by: Michael Jackson --- src/Plugins/SimplnxCore/wrapping/python/simplnxpy.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Plugins/SimplnxCore/wrapping/python/simplnxpy.cpp b/src/Plugins/SimplnxCore/wrapping/python/simplnxpy.cpp index 48174238a7..f50d29c261 100644 --- a/src/Plugins/SimplnxCore/wrapping/python/simplnxpy.cpp +++ b/src/Plugins/SimplnxCore/wrapping/python/simplnxpy.cpp @@ -838,7 +838,7 @@ PYBIND11_MODULE(simplnx, mod) attributeMatrix.def("tuple_shape", &AttributeMatrix::getShape, "Returns the Tuple dimensions of the AttributeMatrix"); attributeMatrix.def("__len__", &AttributeMatrix::getNumTuples, "Returns the total number of tuples"); attributeMatrix.def_property_readonly("size", &AttributeMatrix::getNumTuples, "Returns the total number of tuples"); - + baseGroup.def("", &BaseGroup::getSize); py::class_> iArray(mod, "IArray"); @@ -1358,6 +1358,10 @@ PYBIND11_MODULE(simplnx, mod) pipelineFilter.def("get_args", [internals](PipelineFilter& self) { return ConvertArgsToDict(*internals, self.getParameters(), self.getArguments()); }); pipelineFilter.def("set_args", [internals](PipelineFilter& self, py::dict& args) { self.setArguments(ConvertDictToArgs(*internals, self.getParameters(), args)); }, "args"_a); pipelineFilter.def("get_filter", [](PipelineFilter& self) { return self.getFilter(); }, py::return_value_policy::reference_internal); + pipelineFilter.def("name", [](PipelineFilter& self) { return self.getFilter()->name(); }, "Returns the C++ name of the filter"); + pipelineFilter.def("human_name", [](PipelineFilter& self) { return self.getFilter()->humanName(); }, "Returns the human facing name of the filter"); + + py::class_ pyFilter(mod, "PyFilter"); pyFilter.def(py::init<>([](py::object object) { return std::make_unique(std::move(object)); }));