23 #include "pybind11/pybind11.h" 24 #include "ndarray/pybind11.h" 41 using PySimpleTable = py::class_<SimpleTable, std::shared_ptr<SimpleTable>, BaseTable>;
42 using PySimpleRecord = py::class_<SimpleRecord, std::shared_ptr<SimpleRecord>, BaseRecord>;
44 PySimpleRecord declareSimpleRecord(
py::module &mod) {
45 PySimpleRecord
cls(mod,
"SimpleRecord");
46 cls.def(
"getId", &SimpleRecord::getId);
47 cls.def(
"setId", &SimpleRecord::setId);
48 cls.def(
"getTable", &SimpleRecord::getTable);
49 cls.def_property_readonly(
"table", &SimpleRecord::getTable);
50 cls.def(
"getCoord", &SimpleRecord::getCoord);
51 cls.def(
"setCoord", &SimpleRecord::setCoord);
52 cls.def(
"getRa", &SimpleRecord::getRa);
53 cls.def(
"setRa", &SimpleRecord::setRa);
54 cls.def(
"getDec", &SimpleRecord::getDec);
55 cls.def(
"setDec", &SimpleRecord::setDec);
59 PySimpleTable declareSimpleTable(
py::module &mod) {
60 PySimpleTable
cls(mod,
"SimpleTable");
61 cls.def_static(
"make",
65 cls.def_static(
"makeMinimalSchema", &SimpleTable::makeMinimalSchema);
66 cls.def_static(
"checkSchema", &SimpleTable::checkSchema,
"schema"_a);
67 cls.def_static(
"getIdKey", &SimpleTable::getIdKey);
68 cls.def_static(
"getCoordKey", &SimpleTable::getCoordKey);
71 cls.def(
"setIdFactory", &SimpleTable::setIdFactory,
"idFactory"_a);
73 cls.def(
"makeRecord", &SimpleTable::makeRecord);
79 SimpleTable::copyRecord,
80 "other"_a,
"mapper"_a);
87 py::module::import(
"lsst.afw.coord");
88 py::module::import(
"lsst.afw.table.base");
89 py::module::import(
"lsst.afw.table.idFactory");
91 auto clsSimpleRecord = declareSimpleRecord(mod);
92 auto clsSimpleTable = declareSimpleTable(mod);
93 auto clsSimpleColumnView = table::python::declareColumnView<SimpleRecord>(mod,
"Simple");
94 auto clsSimpleCatalog = table::python::declareSortedCatalog<SimpleRecord>(mod,
"Simple");
96 clsSimpleRecord.attr(
"Table") = clsSimpleTable;
97 clsSimpleRecord.attr(
"ColumnView") = clsSimpleColumnView;
98 clsSimpleRecord.attr(
"Catalog") = clsSimpleCatalog;
99 clsSimpleTable.attr(
"Record") = clsSimpleRecord;
100 clsSimpleTable.attr(
"ColumnView") = clsSimpleColumnView;
101 clsSimpleTable.attr(
"Catalog") = clsSimpleCatalog;
102 clsSimpleCatalog.attr(
"Record") = clsSimpleRecord;
103 clsSimpleCatalog.attr(
"Table") = clsSimpleTable;
104 clsSimpleCatalog.attr(
"ColumnView") = clsSimpleColumnView;
A base class for image defects.
PYBIND11_MODULE(simple, mod)