22 #include "pybind11/pybind11.h"
31 using namespace pybind11::literals;
38 py::module::import(
"lsst.sphgeom.normalizedAngle");
40 py::class_<NormalizedAngleInterval,
42 cls(mod,
"NormalizedAngleInterval");
44 python::defineInterval<decltype(
cls), NormalizedAngleInterval,
45 NormalizedAngle>(
cls);
47 cls.def_static(
"fromDegrees", &NormalizedAngleInterval::fromDegrees,
"x"_a,
49 cls.def_static(
"fromRadians", &NormalizedAngleInterval::fromRadians,
"x"_a,
51 cls.def_static(
"empty", &NormalizedAngleInterval::empty);
52 cls.def_static(
"full", &NormalizedAngleInterval::full);
54 cls.def(py::init<>());
55 cls.def(py::init<Angle>(),
"x"_a);
56 cls.def(py::init<NormalizedAngle>(),
"x"_a);
57 cls.def(py::init<Angle, Angle>(),
"x"_a,
"y"_a);
58 cls.def(py::init<NormalizedAngle, NormalizedAngle>(),
"x"_a,
"y"_a);
59 cls.def(py::init<NormalizedAngleInterval const &>(),
"angleInterval"_a);
61 cls.def(
"isEmpty", &NormalizedAngleInterval::isEmpty);
62 cls.def(
"isFull", &NormalizedAngleInterval::isFull);
63 cls.def(
"wraps", &NormalizedAngleInterval::wraps);
65 cls.def(
"__str__", [](NormalizedAngleInterval
const &
self) {
66 return py::str(
"[{!s}, {!s}]")
67 .format(
self.getA().asRadians(),
self.getB().asRadians());
69 cls.def(
"__repr__", [](NormalizedAngleInterval
const &
self) {
70 return py::str(
"NormalizedAngleInterval.fromRadians({!r},"
72 .format(
self.getA().asRadians(),
self.getB().asRadians());