22 #include "pybind11/pybind11.h"
27 using namespace pybind11::literals;
34 py::module::import(
"lsst.sphgeom.pixelization");
35 py::module::import(
"lsst.sphgeom.region");
37 py::class_<HtmPixelization, Pixelization>
cls(mod,
"HtmPixelization");
39 cls.attr(
"MAX_LEVEL") = py::int_(HtmPixelization::MAX_LEVEL);
41 cls.def_static(
"level", &HtmPixelization::level,
"i"_a);
42 cls.def_static(
"triangle", &HtmPixelization::triangle,
"i"_a);
43 cls.def_static(
"asString", &HtmPixelization::asString,
"i"_a);
45 cls.def(py::init<int>(),
"level"_a);
46 cls.def(py::init<HtmPixelization const &>(),
"htmPixelization"_a);
51 [](HtmPixelization
const &
self, HtmPixelization
const &
other) {
52 return self.getLevel() ==
other.getLevel();
55 [](HtmPixelization
const &
self, HtmPixelization
const &
other) {
56 return self.getLevel() !=
other.getLevel();
58 cls.def(
"__repr__", [](HtmPixelization
const &
self) {
59 return py::str(
"HtmPixelization({!s})").format(
self.
getLevel());
61 cls.def(
"__reduce__", [
cls](HtmPixelization
const &
self) {
62 return py::make_tuple(
cls, py::make_tuple(
self.
getLevel()));