-
Notifications
You must be signed in to change notification settings - Fork 84
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
refactor: remove to_arraylib
#2128
Conversation
Codecov Report
Additional details and impacted files
|
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.
It's great that the implementations can be unified, but there needs to be a high-level public ak.to_numpy
, if only in name. There will be a lot of users who don't even know (or care) that Awkward runs on non-NumPy backends, and this will make them unlikely to find a function named ak.to_backend_array
.
Nevermind: I see that you're leaving the L1 interface ak.to_numpy
and just removing the L2 Content.to_numpy
interface.
Currently, only NumPy has a way to use allow_missing=True
; CuPy, etc. don't have a ma
submodule or a MaskedArray
equivalent. But in principle, they might someday get such an interface, and we can rename it through nplike if it comes in with a different name.
It's good to have the deprecation message specify version 2.2.0 like this, to always target two minor versions ahead. When this is merged, please add it directly to
https://github.com/scikit-hep/awkward/wiki#api-breaking-changes-after-20
to make sure that this list doesn't get out of date. The warning message is for developers who stumble onto this deprecation by calling Content.to_numpy
, but the wiki is for a more global view: "What are all of the things that will be deprecated in version X?"
This PR
ak._util.to_arraylib
andNumpyArray.to_numpy(allow_missing)
in favour ofNumpyArray.to_backend_array(allow_missing, backend)
UnionArray
into_backend_array()
.to_arraylib()
duplicates much ofto_numpy()
's logic, and we also don't need to enshrine NumPy as more special than the general backend-agnos