24 #include "pybind11/pybind11.h"
25 #include "pybind11/eigen.h"
32 using namespace pybind11::literals;
38 using utils::python::WrapperCollection;
43 using PySlotDefinition = py::class_<SlotDefinition>;
45 void declareSlotDefinition(WrapperCollection &wrappers) {
46 wrappers.wrapType(PySlotDefinition(wrappers.module,
"SlotDefinition"), [](
auto &mod,
auto &
cls) {
47 cls.def(
"getName", &SlotDefinition::getName);
48 cls.def(
"getAlias", &SlotDefinition::getAlias);
55 template <
typename Class>
56 void declareSlotDefinitionSubclass(WrapperCollection &wrappers,
std::string const &
name) {
57 wrappers.wrapType(py::class_<Class, SlotDefinition>(wrappers.module,
name.c_str()),
58 [](
auto &mod,
auto &
cls) {
59 cls.def(py::init<std::string const &>(),
"name"_a);
60 cls.def(
"isValid", &Class::isValid);
61 cls.def(
"getMeasKey", &Class::getMeasKey);
62 cls.def(
"getErrKey", &Class::getErrKey);
63 cls.def(
"getFlagKey", &Class::getFlagKey);
64 cls.def(
"setKeys", &Class::setKeys,
"alias"_a,
"schema"_a);
74 declareSlotDefinition(wrappers);
75 declareSlotDefinitionSubclass<FluxSlotDefinition>(wrappers,
"Flux");
76 declareSlotDefinitionSubclass<CentroidSlotDefinition>(wrappers,
"Centroid");
77 declareSlotDefinitionSubclass<ShapeSlotDefinition>(wrappers,
"Shape");