24 #include "pybind11/pybind11.h"
25 #include "pybind11/stl.h"
36 using namespace pybind11::literals;
42 using utils::python::WrapperCollection;
43 using PySchemaMapper = py::class_<SchemaMapper, std::shared_ptr<SchemaMapper>>;
57 cls.def(py::init<>());
58 cls.def(py::init<Schema const &, Schema const &>());
59 cls.def(py::init<Schema const &, bool>(),
"input"_a,
"shareAliasMap"_a = false);
61 cls.def(
"getInputSchema", &SchemaMapper::getInputSchema);
62 cls.def(
"getOutputSchema", &SchemaMapper::getOutputSchema);
63 cls.def(
"editOutputSchema", &SchemaMapper::editOutputSchema,
64 py::return_value_policy::reference_internal);
65 cls.def(
"addMinimalSchema", &SchemaMapper::addMinimalSchema,
"minimal"_a,
"doMap"_a = true);
66 cls.def_static(
"removeMinimalSchema", &SchemaMapper::removeMinimalSchema);
67 cls.def_static(
"join", &SchemaMapper::join,
"inputs"_a,
"prefixes"_a = std::vector<std::string>());
69 declareSchemaMapperOverloads<std::uint8_t>(cls,
"B");
70 declareSchemaMapperOverloads<std::uint16_t>(cls,
"U");
71 declareSchemaMapperOverloads<std::int32_t>(cls,
"I");
72 declareSchemaMapperOverloads<std::int64_t>(cls,
"L");
73 declareSchemaMapperOverloads<float>(cls,
"F");
74 declareSchemaMapperOverloads<double>(cls,
"D");
75 declareSchemaMapperOverloads<std::string>(cls,
"String");
76 declareSchemaMapperOverloads<lsst::geom::Angle>(cls,
"Angle");
77 declareSchemaMapperOverloads<lsst::afw::table::Flag>(cls,
"Flag");
78 declareSchemaMapperOverloads<lsst::afw::table::Array<std::uint8_t>>(cls,
"ArrayB");
79 declareSchemaMapperOverloads<lsst::afw::table::Array<std::uint16_t>>(cls,
"ArrayU");
80 declareSchemaMapperOverloads<lsst::afw::table::Array<int>>(cls,
"ArrayI");
81 declareSchemaMapperOverloads<lsst::afw::table::Array<float>>(cls,
"ArrayF");
82 declareSchemaMapperOverloads<lsst::afw::table::Array<double>>(cls,
"ArrayD");