Skip to content

Commit 6f52382

Browse files
author
Matthias Wittgen
committed
Use classh for all python classes
1 parent 92cfa05 commit 6f52382

23 files changed

+51
-51
lines changed

python/lsst/sphgeom/_angle.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ namespace lsst {
4040
namespace sphgeom {
4141

4242
template <>
43-
void defineClass(py::class_<Angle> &cls) {
43+
void defineClass(py::classh<Angle> &cls) {
4444
cls.def_static("nan", &Angle::nan);
4545
cls.def_static("fromDegrees", &Angle::fromDegrees);
4646
cls.def_static("fromRadians", &Angle::fromRadians);

python/lsst/sphgeom/_angleInterval.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ namespace sphgeom {
4141

4242
template <>
4343
void defineClass(
44-
py::class_<AngleInterval> &cls) {
44+
py::classh<AngleInterval> &cls) {
4545
python::defineInterval<decltype(cls), AngleInterval, Angle>(cls);
4646

4747
cls.def_static("fromDegrees", &AngleInterval::fromDegrees, "x"_a, "y"_a);

python/lsst/sphgeom/_box.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ namespace lsst {
5252
namespace sphgeom {
5353

5454
template <>
55-
void defineClass(py::class_<Box, Region> &cls) {
55+
void defineClass(py::classh<Box, Region> &cls) {
5656
cls.attr("TYPE_CODE") = py::int_(Box::TYPE_CODE);
5757

5858
cls.def_static("fromDegrees", &Box::fromDegrees, "lon1"_a, "lat1"_a,

python/lsst/sphgeom/_box3d.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ namespace lsst {
4242
namespace sphgeom {
4343

4444
template <>
45-
void defineClass(py::class_<Box3d> &cls) {
45+
void defineClass(py::classh<Box3d> &cls) {
4646
cls.def_static("empty", &Box3d::empty);
4747
cls.def_static("full", &Box3d::full);
4848
cls.def_static("aroundUnitSphere", &Box3d::aroundUnitSphere);

python/lsst/sphgeom/_chunker.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ py::str toString(Chunker const &self) {
4747
}
4848

4949
template <>
50-
void defineClass(py::class_<Chunker> &cls) {
50+
void defineClass(py::classh<Chunker> &cls) {
5151
cls.def(py::init<int32_t, int32_t>(), "numStripes"_a,
5252
"numSubStripesPerStripe"_a);
5353

python/lsst/sphgeom/_circle.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ namespace lsst {
4848
namespace sphgeom {
4949

5050
template <>
51-
void defineClass(py::class_<Circle, Region> &cls) {
51+
void defineClass(py::classh<Circle, Region> &cls) {
5252
cls.attr("TYPE_CODE") = py::int_(Circle::TYPE_CODE);
5353

5454
cls.def_static("empty", &Circle::empty);

python/lsst/sphgeom/_compoundRegion.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ class CompoundIterator {
9191
} // namespace
9292

9393
template <>
94-
void defineClass(py::class_<CompoundRegion, Region> &cls) {
94+
void defineClass(py::classh<CompoundRegion, Region> &cls) {
9595
cls.def("nOperands", &CompoundRegion::nOperands);
9696
cls.def("__len__", &CompoundRegion::nOperands);
9797
cls.def(
@@ -113,15 +113,15 @@ void defineClass(py::class_<CompoundRegion, Region> &cls) {
113113
}
114114

115115
template <>
116-
void defineClass(py::class_<UnionRegion, CompoundRegion> &cls) {
116+
void defineClass(py::classh<UnionRegion, CompoundRegion> &cls) {
117117
cls.attr("TYPE_CODE") = py::int_(UnionRegion::TYPE_CODE);
118118
cls.def(py::init(&_args_factory<UnionRegion>));
119119
cls.def(py::pickle(&python::encode, &python::decode<UnionRegion>));
120120
cls.def("__repr__", [](CompoundRegion const &self) { return _repr("UnionRegion", self); });
121121
}
122122

123123
template <>
124-
void defineClass(py::class_<IntersectionRegion, CompoundRegion> &cls) {
124+
void defineClass(py::classh<IntersectionRegion, CompoundRegion> &cls) {
125125
cls.attr("TYPE_CODE") = py::int_(IntersectionRegion::TYPE_CODE);
126126
cls.def(py::init(&_args_factory<IntersectionRegion>));
127127
cls.def(py::pickle(&python::encode, &python::decode<IntersectionRegion>));

python/lsst/sphgeom/_convexPolygon.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ namespace lsst {
4949
namespace sphgeom {
5050

5151
template <>
52-
void defineClass(py::class_<ConvexPolygon, Region> &cls) {
52+
void defineClass(py::classh<ConvexPolygon, Region> &cls) {
5353
cls.attr("TYPE_CODE") = py::int_(ConvexPolygon::TYPE_CODE);
5454

5555
cls.def_static("convexHull", &ConvexPolygon::convexHull, "points"_a);

python/lsst/sphgeom/_ellipse.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ namespace lsst {
4848
namespace sphgeom {
4949

5050
template <>
51-
void defineClass(py::class_<Ellipse, Region> &cls) {
51+
void defineClass(py::classh<Ellipse, Region> &cls) {
5252
cls.attr("TYPE_CODE") = py::int_(Ellipse::TYPE_CODE);
5353

5454
cls.def_static("empty", &Ellipse::empty);

python/lsst/sphgeom/_htmPixelization.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ namespace lsst {
3939
namespace sphgeom {
4040

4141
template <>
42-
void defineClass(py::class_<HtmPixelization, Pixelization> &cls) {
42+
void defineClass(py::classh<HtmPixelization, Pixelization> &cls) {
4343
cls.attr("MAX_LEVEL") = py::int_(HtmPixelization::MAX_LEVEL);
4444

4545
cls.def_static("level", &HtmPixelization::level, "i"_a);

0 commit comments

Comments
 (0)