Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM-14828: Update pybind11 wrappers for 2.2 #9

Merged
merged 1 commit into from
Jul 21, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 1 addition & 5 deletions python/lsst/geom/affineTransform.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ namespace {

using PyAffineTransform = py::class_<AffineTransform, std::shared_ptr<AffineTransform>>;

PYBIND11_PLUGIN(affineTransform) {
py::module mod("affineTransform");

PYBIND11_MODULE(affineTransform, mod) {
py::module::import("lsst.geom.linearTransform");
py::module::import("lsst.geom.coordinates");

Expand Down Expand Up @@ -110,8 +108,6 @@ PYBIND11_PLUGIN(affineTransform) {

/* Non-members */
mod.def("makeAffineTransformFromTriple", makeAffineTransformFromTriple);

return mod.ptr();
}

} // namespace
Expand Down
6 changes: 1 addition & 5 deletions python/lsst/geom/angle/angle.cc
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,7 @@ void declareAngleComparisonOperators(PyAngle& cls) {
cls.def("__gt__", [](Angle const& self, OtherT const& other) { return self > other; }, py::is_operator());
}

PYBIND11_PLUGIN(angle) {
py::module mod("angle");

PYBIND11_MODULE(angle, mod) {
/* AngleUnit */

PyAngleUnit clsAngleUnit(mod, "AngleUnit");
Expand Down Expand Up @@ -141,8 +139,6 @@ PYBIND11_PLUGIN(angle) {
mod.def("masToRad", masToRad);
mod.def("isAngle", isAngle<Angle>);
mod.def("isAngle", isAngle<double>);

return mod.ptr();
}

} // namespace
Expand Down
6 changes: 1 addition & 5 deletions python/lsst/geom/box.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ namespace {
using PyBox2I = py::class_<Box2I, std::shared_ptr<Box2I>>;
using PyBox2D = py::class_<Box2D, std::shared_ptr<Box2D>>;

PYBIND11_PLUGIN(box) {
py::module mod("box");

PYBIND11_MODULE(box, mod) {
py::object modCoordinates = py::module::import("lsst.geom.coordinates");

/* Box2UI */
Expand Down Expand Up @@ -185,8 +183,6 @@ PYBIND11_PLUGIN(box) {
/* module-level typedefs */
mod.attr("BoxI") = clsBox2I;
mod.attr("BoxD") = clsBox2D;

return mod.ptr();
}

} // namespace
Expand Down
6 changes: 1 addition & 5 deletions python/lsst/geom/coordinates/coordinates.cc
Original file line number Diff line number Diff line change
Expand Up @@ -444,9 +444,7 @@ void declarePointOperators(py::module &mod, PyPoint<int, N> &clsI, PyPoint<doubl
});
}

PYBIND11_PLUGIN(coordinates) {
py::module mod("coordinates");

PYBIND11_MODULE(coordinates, mod) {
// Only the interface-level classes are defined here, and these functions
// call others to define their base classes, since those are never shared.

Expand All @@ -468,8 +466,6 @@ PYBIND11_PLUGIN(coordinates) {
auto clsPoint3I = declarePoint3<int>(mod, "I");
auto clsPoint3D = declarePoint3<double>(mod, "D");
declarePointOperators(mod, clsPoint3I, clsPoint3D);

return mod.ptr();
}

} // namespace
Expand Down
6 changes: 1 addition & 5 deletions python/lsst/geom/linearTransform.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@ namespace {

using PyLinearTransform = py::class_<LinearTransform, std::shared_ptr<LinearTransform>>;

PYBIND11_PLUGIN(linearTransform) {
py::module mod("linearTransform");

PYBIND11_MODULE(linearTransform, mod) {
py::module::import("lsst.geom.coordinates");

PyLinearTransform cls(mod, "LinearTransform");
Expand Down Expand Up @@ -100,8 +98,6 @@ PYBIND11_PLUGIN(linearTransform) {
cls.def("__reduce__", [cls](LinearTransform const &self) {
return py::make_tuple(cls, py::make_tuple(py::cast(self.getMatrix())));
});

return mod.ptr();
}

} // namespace
Expand Down
6 changes: 1 addition & 5 deletions python/lsst/geom/spherePoint/spherePoint.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,7 @@ namespace {

using PySpherePoint = py::class_<SpherePoint, std::shared_ptr<SpherePoint>>;

PYBIND11_PLUGIN(spherePoint) {
py::module mod("spherePoint");

PYBIND11_MODULE(spherePoint, mod) {
py::module::import("lsst.sphgeom");
py::module::import("lsst.geom.angle");
py::module::import("lsst.geom.coordinates");
Expand Down Expand Up @@ -92,8 +90,6 @@ PYBIND11_PLUGIN(spherePoint) {
return py::make_tuple(cls,
py::make_tuple(py::cast(self.getLongitude()), py::cast(self.getLatitude())));
});

return mod.ptr();
}

} // namespace
Expand Down