Skip to content

Commit

Permalink
Merge pull request #56 from lsst/tickets/DM-14828
Browse files Browse the repository at this point in the history
DM-14828: Update pybind11 wrappers for 2.2
  • Loading branch information
r-owen committed Jul 21, 2018
2 parents 150e024 + 63f0e52 commit 4dc7b79
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
_build.*
.cache
.pytest_cache
pytest_session.txt
.coverage
*.o
*.pyc
*.so
Expand Down
9 changes: 2 additions & 7 deletions python/lsst/meas/deblender/baselineUtils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,8 @@ void declareBaselineUtils(py::module& mod, const std::string& suffix) {
using ImagePtrT = std::shared_ptr<lsst::afw::image::Image<ImagePixelT>>;
using FootprintPtrT = std::shared_ptr<lsst::afw::detection::Footprint>;
using Class = BaselineUtils<ImagePixelT, MaskPixelT, VariancePixelT>;
using PyClass = py::class_<Class, std::shared_ptr<Class>>;

py::class_<Class> cls(mod, ("BaselineUtils" + suffix).c_str());
py::class_<Class, std::shared_ptr<Class>> cls(mod, ("BaselineUtils" + suffix).c_str());
cls.def_static("symmetrizeFootprint", &Class::symmetrizeFootprint, "foot"_a, "cx"_a, "cy"_a);
// The C++ function returns a std::pair return value but also takes a referenced boolean
// (patchedEdges) that is modified by the function and used by the python API,
Expand Down Expand Up @@ -105,15 +104,11 @@ void declareBaselineUtils(py::module& mod, const std::string& suffix) {

} // <anonymous>

PYBIND11_PLUGIN(baselineUtils) {
PYBIND11_MODULE(baselineUtils, mod) {
py::module::import("lsst.afw.image");
py::module::import("lsst.afw.detection");

py::module mod("baselineUtils");

declareBaselineUtils<float>(mod, "F");

return mod.ptr();
}

} // deblender
Expand Down
2 changes: 1 addition & 1 deletion python/lsst/meas/deblender/deblend.py
Original file line number Diff line number Diff line change
Expand Up @@ -1175,7 +1175,7 @@ def skipParent(self, source, masks):
----------
source: `lsst.afw.table.source.source.SourceRecord`
The source to flag as skipped
masks: list of `lsst.afw.image.mask.mask.MaskX`
masks: list of `lsst.afw.image.MaskX`
The mask in each band to update with the non-detection
"""
fp = source.getFootprint()
Expand Down

0 comments on commit 4dc7b79

Please sign in to comment.