Skip to content

Commit

Permalink
Cleanup pybind11
Browse files Browse the repository at this point in the history
  • Loading branch information
Pim Schellart authored and Pim Schellart committed Apr 6, 2017
1 parent f5fae43 commit 0705da3
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 135 deletions.
2 changes: 1 addition & 1 deletion python/lsst/meas/extensions/shapeHSM/SConscript
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# -*- python -*-
from lsst.sconsUtils import scripts
scripts.BasicSConscript.pybind11(['hsmMomentsControl',
'hsmShapeControl',])
'hsmShapeControl',], addUnderscore=False)
6 changes: 4 additions & 2 deletions python/lsst/meas/extensions/shapeHSM/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@

"""lsst.meas.extensions.shapeHSM
"""
from __future__ import absolute_import
from __future__ import absolute_import, division, print_function

from lsst.meas.base import BasePlugin, wrapSimpleAlgorithm

from .hsmLib import *
from .hsmMomentsControl import *
from .hsmShapeControl import *

from .version import *

wrapSimpleAlgorithm(HsmShapeBjAlgorithm, name="ext_shapeHSM_HsmShapeBj",
Expand Down
51 changes: 0 additions & 51 deletions python/lsst/meas/extensions/shapeHSM/hsmAdapter.cc

This file was deleted.

4 changes: 0 additions & 4 deletions python/lsst/meas/extensions/shapeHSM/hsmLib.py

This file was deleted.

23 changes: 11 additions & 12 deletions python/lsst/meas/extensions/shapeHSM/hsmMomentsControl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
* the GNU General Public License along with this program. If not,
* see <https://www.lsstcorp.org/LegalNotices/>.
*/
#include <pybind11/pybind11.h>
//#include <pybind11/stl.h>
#include "pybind11/pybind11.h"

#include "lsst/meas/extensions/shapeHSM/HsmMomentsControl.h"
#include "lsst/pex/config/python.h"
Expand All @@ -33,8 +32,11 @@ namespace meas {
namespace extensions {
namespace shapeHSM {

PYBIND11_PLUGIN(_hsmMomentsControl) {
py::module mod("_hsmMomentsControl", "Python wrapper for _hsmMomentsControl library");
PYBIND11_PLUGIN(hsmMomentsControl) {
py::module::import("lsst.afw.table");
py::module::import("lsst.meas.base");

py::module mod("hsmMomentsControl");

/* Module level */
py::class_<HsmMomentsAlgorithm, std::shared_ptr<HsmMomentsAlgorithm>, base::SimpleAlgorithm>
Expand All @@ -48,8 +50,6 @@ PYBIND11_PLUGIN(_hsmMomentsControl) {
clsHsmPsfMomentsAlgorithm(mod, "HsmPsfMomentsAlgorithm");
py::class_<HsmPsfMomentsControl> clsHsmPsfMomentsControl(mod, "HsmPsfMomentsControl");

/* Member types and enums */

/* Constructors */
clsHsmSourceMomentsAlgorithm.def(
py::init<HsmSourceMomentsAlgorithm::Control const &, std::string const &, afw::table::Schema &>(),
Expand All @@ -61,16 +61,15 @@ PYBIND11_PLUGIN(_hsmMomentsControl) {
"ctrl"_a, "name"_a, "schema"_a);
clsHsmPsfMomentsControl.def(py::init<>());

/* Operators */

/* Members */
LSST_DECLARE_CONTROL_FIELD(clsHsmSourceMomentsControl, HsmSourceMomentsControl, badMaskPlanes);

clsHsmMomentsAlgorithm.def("fail", &HsmMomentsAlgorithm::fail);

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

} // shapeHSM
} // extensions
} // meas
} // lsst
24 changes: 11 additions & 13 deletions python/lsst/meas/extensions/shapeHSM/hsmShapeControl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
* the GNU General Public License along with this program. If not,
* see <https://www.lsstcorp.org/LegalNotices/>.
*/
#include <pybind11/pybind11.h>
//#include <pybind11/stl.h>
#include "pybind11/pybind11.h"

#include "lsst/meas/extensions/shapeHSM/HsmShapeControl.h"
#include "lsst/pex/config/python.h"
Expand All @@ -33,8 +32,11 @@ namespace meas {
namespace extensions {
namespace shapeHSM {

PYBIND11_PLUGIN(_hsmShapeControl) {
py::module mod("_hsmShapeControl", "Python wrapper for _hsmShapeControl library");
PYBIND11_PLUGIN(hsmShapeControl) {
py::module::import("lsst.afw.table");
py::module::import("lsst.meas.base");

py::module mod("hsmShapeControl");

/* Module level */
py::class_<HsmShapeAlgorithm, std::shared_ptr<HsmShapeAlgorithm>, base::SimpleAlgorithm>
Expand All @@ -57,9 +59,6 @@ PYBIND11_PLUGIN(_hsmShapeControl) {
clsHsmShapeRegaussAlgorithm(mod, "HsmShapeRegaussAlgorithm");
py::class_<HsmShapeRegaussControl, HsmShapeControl> clsHsmShapeRegaussControl(mod,
"HsmShapeRegaussControl");

/* Member types and enums */

/* Constructors */
clsHsmShapeBjAlgorithm.def(
py::init<HsmShapeBjAlgorithm::Control const &, std::string const &, afw::table::Schema &>(),
Expand All @@ -81,8 +80,6 @@ PYBIND11_PLUGIN(_hsmShapeControl) {
"ctrl"_a, "name"_a, "schema"_a);
clsHsmShapeRegaussControl.def(py::init<>());

/* Operators */

/* Members */
LSST_DECLARE_CONTROL_FIELD(clsHsmShapeControl, HsmShapeControl, badMaskPlanes);
LSST_DECLARE_CONTROL_FIELD(clsHsmShapeControl, HsmShapeControl, deblendNChild);
Expand All @@ -92,7 +89,8 @@ PYBIND11_PLUGIN(_hsmShapeControl) {

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

} // shapeHSM
} // extensions
} // meas
} // lsst
51 changes: 0 additions & 51 deletions python/lsst/meas/extensions/shapeHSM/psfcorr.cc

This file was deleted.

2 changes: 1 addition & 1 deletion tests/testHsm.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
# the GNU General Public License along with this program. If not,
# see <https://www.lsstcorp.org/LegalNotices/>.
#
from __future__ import print_function
from __future__ import absolute_import, division, print_function
import re
import os
import sys
Expand Down

0 comments on commit 0705da3

Please sign in to comment.