Skip to content

Commit

Permalink
Support setting null ValidPolygon on ExposureRecord
Browse files Browse the repository at this point in the history
This works around DM-10289.
  • Loading branch information
jdswinbank committed May 16, 2017
1 parent 3deb52d commit 1849a83
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion python/lsst/afw/table/exposure/exposure.cc
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,18 @@ PyExposureRecord declareExposureRecord(py::module &mod) {
cls.def("getApCorrMap", &ExposureRecord::getApCorrMap);
cls.def("setApCorrMap", &ExposureRecord::setApCorrMap, "appCorrMap"_a);
cls.def("getValidPolygon", &ExposureRecord::getValidPolygon);
cls.def("setValidPolygon", &ExposureRecord::setValidPolygon, "polygon"_a);

// Workaround for DM-10289.
cls.def("setValidPolygon",
[](ExposureRecord &self, py::object polygon) {
if (polygon == py::none()) {
self.setValidPolygon(nullptr);
} else {
self.setValidPolygon(py::cast<std::shared_ptr<afw::geom::polygon::Polygon>>(polygon));
}
},
"polygon"_a);

cls.def("getVisitInfo", &ExposureRecord::getVisitInfo);
cls.def("setVisitInfo", &ExposureRecord::setVisitInfo, "visitInfo"_a);
return cls;
Expand Down

0 comments on commit 1849a83

Please sign in to comment.