Repository navigation
Conversation
# Conflicts: # src/_path.h
…pybind-mplarray # Conflicts: # lib/matplotlib/transforms.py # src/_path.h # src/_path_wrapper.cpp
This branch has not been deployed
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.
PR summary
Important
This PR depends on #32536 and will appear larger than it really is until #32536 is merged. To view the actual changes in this PR, compare pybind-mplarray → pybind-mplconvert.
As mentioned in #32532 and in the nanobind Porting Guide, type casters may not raise exceptions:
Since we used exceptions for error messages, I introduced
mpl::deferto defer array creation until after a bound function was called. This PR extendsmpl::deferto other types using a newmpl::convertfunction.mpl::converthas the following signature:Each type caster is replaced by a
mpl::convertoverload:mpl::deferwill will automatically use the appropriateconvert()function whenvalue()is called. This allows us to do the following:Additional Changes
mpl::PathIteratorandmpl::PathGeneratorare no longer in themplnamespace. This matches other classes likeGCAggor the path converters.template <class PathIterator>) and replaced with the actual class (PathIterator).inlinein "py_converters.h".AI Disclosure
mpl::convertand hooking it up tompl::defer. I used a variation of one of these approaches and wrote the code myself.PR quality check