Skip to content

pybind: Add R2 bindings#546

Draft
deustis wants to merge 5 commits intogoogle:masterfrom
deustis:deustis/r2_bindings
Draft

pybind: Add R2 bindings#546
deustis wants to merge 5 commits intogoogle:masterfrom
deustis:deustis/r2_bindings

Conversation

@deustis
Copy link
Contributor

@deustis deustis commented Feb 22, 2026

Add pybind11 bindings for R1Interval, R2Point, and R2Rect

(Part of a series of addressing #524)

@deustis deustis changed the title pybind: Add S1Interval bindings pybind: Add R2 bindings Feb 22, 2026
@deustis deustis marked this pull request as draft February 22, 2026 19:29
@deustis
Copy link
Contributor Author

deustis commented Feb 22, 2026

This is a child of PR #534. Diffs are showing both PRs... not sure how to set the upstream to my fork. Leaving this in draft until we land the upstream.

if (x_empty != y_empty) {
throw py::value_error(
"Invalid R2Rect: x and y intervals must be both empty or both "
"non-empty");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

more info here

Copy link
Member

@jmr jmr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm also not sure about the "expose all the things" approach. We've never exposed R2* in the old SWIG or new google3 bindings and no one complained.

Maybe you want to do a useful subset / the SWIG subset first.

"order.\n\n"
"Vertex 0 is in the lower-left corner. The argument is reduced "
"modulo 4.")
.def("vertex_ij",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A single overloaded vertex might make sense. I'm not sure and don't have strong feelings.

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