Skip to content

pybind: Add S1Interval bindings (#524)#534

Merged
jmr merged 6 commits intogoogle:masterfrom
deustis:deustis/s1interval_bindings
Mar 3, 2026
Merged

pybind: Add S1Interval bindings (#524)#534
jmr merged 6 commits intogoogle:masterfrom
deustis:deustis/s1interval_bindings

Conversation

@deustis
Copy link
Contributor

@deustis deustis commented Jan 28, 2026

Add pybind11 bindings for S1Interval.

Also add interface notes to the python README

(Part of a series of addressing #524)

@deustis deustis force-pushed the deustis/s1interval_bindings branch 4 times, most recently from 596f5f6 to 85ae427 Compare January 28, 2026 00:42
Add pybind11 bindings for S1Interval.

Also add interface notes to the python README
@deustis deustis force-pushed the deustis/s1interval_bindings branch from 85ae427 to 5bb24fa Compare January 28, 2026 00:49
@deustis
Copy link
Contributor Author

deustis commented Jan 28, 2026

@jmr, next installment here. I've added some updates to the README that explain some of the user-facing interface choices for the python bindings. That might be a good place to start for the review. Feel free to suggest any changes.

@deustis deustis changed the title pybind: Add S2Interval bindings (#524) pybind: Add S1Interval bindings (#524) Jan 28, 2026
@deustis
Copy link
Contributor Author

deustis commented Jan 28, 2026

@jmr, thanks for the detailed comments. I think once we iron out some of these interface choices it will be smooth sailing. Definitely worth spending the time up-front to ensure consistency/correctness.

I've addressed most of your comments. The main open question is about how to handle the debug assertions. Let me know your thoughts there and I'll make those changes.

@jmr
Copy link
Member

jmr commented Jan 30, 2026

Is there a reason you picked S1Interval? Seems obscure and low level.

@deustis
Copy link
Contributor Author

deustis commented Feb 9, 2026

Hi there, just a quick note -- I was traveling last week and working against some deadlines this week but still intending to circle back on this!

Is there a reason you picked S1Interval? Seems obscure and low level.

No particular reason... starting with the lowest level primitives and working my way up to S2Cell.

@deustis
Copy link
Contributor Author

deustis commented Feb 21, 2026

@jmr, apologies for the delay. I'm back and have updated the the PR as discussed.

The python interface will now raise value errors for invalid inputs to avoid any possibility of triggering the DCHECKS. In the case of S1Angle this basically means ensuring all of the points are within +/- pi. I've added a static helper to the C++ code to make this easier so we aren't having to do any math in the bindings themselves.

@deustis deustis mentioned this pull request Feb 22, 2026
@deustis
Copy link
Contributor Author

deustis commented Feb 25, 2026

@jmr, friendly ping on this PR? I believe I've addressed your earlier comments.

@jmr
Copy link
Member

jmr commented Feb 25, 2026

I will take a closer look at this tomorrow.

@deustis deustis force-pushed the deustis/s1interval_bindings branch from 52fb522 to 3137a7d Compare February 26, 2026 16:49
@deustis deustis requested a review from jmr February 27, 2026 16:36
@jmr jmr merged commit 7fe8e6c into google:master Mar 3, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants