Open
Conversation
Contributor
Author
|
@jmr, ready for you review. Not sure why the CI is failing |
jmr
requested changes
Apr 10, 2026
src/s2/s1angle.h
Outdated
|
|
||
| // Returns true if the angle is in the normalized range (-180, 180] | ||
| // degrees, which is the valid input range for e5(), e6(), and e7(). | ||
| bool IsNormalizedAngle() const; |
Member
There was a problem hiding this comment.
I think "Angle" is implied based on the type. Why not call this IsNormalized and move it to just before the Normalized() declaration/definition?
src/python/s1angle_bindings.cc
Outdated
| .def("abs", &S1Angle::abs, "Return the absolute value of the angle") | ||
| .def("normalized", &S1Angle::Normalized, | ||
| "Return the angle normalized to the range (-180, 180] degrees") | ||
| .def("sin_cos", [](const S1Angle& self) { |
Member
There was a problem hiding this comment.
It's Python. Are we really worried about this?
Contributor
Author
There was a problem hiding this comment.
Dropped sin_cos()
src/python/s1angle_bindings.cc
Outdated
| "Return the E7 representation (degrees * 1e7, rounded).\n\n" | ||
| "The angle must be in the normalized range (-180, 180] degrees.\n" | ||
| "Raises ValueError if out of range.") | ||
| .def("abs", &S1Angle::abs, "Return the absolute value of the angle") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add pybind11 bindings for S1Angle.
Also add S1Angle::IsNormalizedAngle() to s1angle.h for pre-validating
E5/E6/E7 conversions.
Supports downstream PRs for S2LatLng (deustis#2) and
S2CellId (deustis#3).
(Part of a series of addressing #524)