Skip to content

Commit

Permalink
Merge pull request #18 from lsst/tickets/DM-9190
Browse files Browse the repository at this point in the history
DM-9190: Cleanup pybind11 remaining code
  • Loading branch information
Pim Schellart committed Apr 6, 2017
2 parents 93529f0 + ecb8d17 commit e460333
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 24 deletions.
2 changes: 1 addition & 1 deletion python/lsst/meas/extensions/photometryKron/SConscript
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# -*- python -*-
from lsst.sconsUtils import scripts
scripts.BasicSConscript.pybind11(["photometryKron"])
scripts.BasicSConscript.pybind11(["photometryKron"], addUnderscore=False)
17 changes: 16 additions & 1 deletion python/lsst/meas/extensions/photometryKron/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,20 @@
# see <http://www.lsstcorp.org/LegalNotices/>.
#

from .kronLib import *
from __future__ import absolute_import, division, print_function

from lsst.meas.base import BasePlugin, wrapSimpleAlgorithm
from .photometryKron import KronFluxAlgorithm, KronFluxControl, KronAperture

__all__ = ["KronFluxAlgorithm", "KronFluxControl", "KronAperture", "KronFluxPlugin", "KronFluxForcedPlugin"]

KronFluxPlugin, KronFluxForcedPlugin = wrapSimpleAlgorithm(
KronFluxAlgorithm,
name = "ext_photometryKron_KronFlux",
Control = KronFluxControl,
executionOrder = BasePlugin.FLUX_ORDER,
shouldApCorr = True,
needsMetadata = True,
)

from .version import *
15 changes: 0 additions & 15 deletions python/lsst/meas/extensions/photometryKron/kronLib.py

This file was deleted.

20 changes: 13 additions & 7 deletions python/lsst/meas/extensions/photometryKron/photometryKron.cc
Original file line number Diff line number Diff line change
Expand Up @@ -127,18 +127,24 @@ void declareKronAperture(py::module &mod) {
declareKronApertureTemplatedMethods<afw::image::MaskedImage<float>>(cls);
}

} // namespace lsst::meas::extensions::<anonymous>
} // <anonymous>

PYBIND11_PLUGIN(_photometryKron) {
py::module mod("_photometryKron", "Python wrapper for PhotometryKroh.h");
PYBIND11_PLUGIN(photometryKron) {
py::module::import("lsst.afw.geom");
py::module::import("lsst.afw.image");
py::module::import("lsst.afw.table");
py::module::import("lsst.daf.base");

py::module mod("photometryKron");

declareKronFluxControl(mod);
declareKronFluxAlgorithm(mod);
declareKronAperture(mod);

return mod.ptr();
}
}
}
}
} // namespace lsst::meas::extensions::photometryKron

} // photometryKron
} // extensions
} // meas
} // lsst

0 comments on commit e460333

Please sign in to comment.