-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Convert remaining code to pybind11 #28856
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
0688bb3
to
1a9b601
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to get this in for 3.10, so if we could get a second review, that would be great
This was previously checked by using an `array_view<type, ndim>`, but moving to pybind11 we won't have that until cast to `unchecked`.
They need only be the same number of dimensions, as sometimes code does `np.atleast_3d(array)` on something empty, which inserts the 0-dimension in a spot that messes with the expected trailing shape.
Now that everything else is using pybind11, this works without issue.
Since we're using pybind11 everywhere, it should be fine now to access it in any header, and putting the type caster there is clearer. We don't need the weird macro checks to conditionally define them either.
Co-authored-by: Antony Lee <[email protected]>
1a9b601
to
37206c2
Compare
This looks like some of the grayscale have picked up a off-by-one rounding issue. Seeing this on other PRs as well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not an expert on the pybind11 changes, but I did peruse this and it all looks reasonable to a non-expert. I reran the failing 313t tests and those now pass. I believe the other failures in Azure are unrelated and failing on other tests too.
I believe that it will be easier to review incremental updates after this is in if there is anything else to follow up on.
Great work on this @QuLogic! This was no small feat.
PR summary
Now that we are building with pybind11 in all extensions, we can drop/convert several items that were used across extensions. Namely, everything in
py_adaptors
(which was shared between_path
and_backend_agg
) can now get a type caster, all the remainingarray_view
can be moved topy::array_t
, and theClipPath
converter issue from #27011 has been fixed.Additionally, I moved the pybind11 type casters from
py_converters_11.h
to the files that define the related types. This keeps things a bit more consolidated, and avoids the weird#ifdef
macro magic that was needed before.PR checklist