-
Notifications
You must be signed in to change notification settings - Fork 1
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
Are Numpy API functions for creating legacy dtypes still necessary? #14
Comments
@seberg thoughts? As far as I remember, those interfaces are user-facing, even after the dtype refactor. |
Is the need for |
They are something in between. I would expect just failing for them is fine mostly, except for user defined dtypes (which are not super large as a user-base) in the case of That said, For
I would think/hope this helps for DType classes, but I guess we may need to adapt NumPy for that? |
Thanks @seberg for the explanation and suggestions.
Yes, sounds good. I'll do that.
Agreed. I will change the signature. I do also not see how we could patch an existing legacy dtype in a proper HPy way. |
I think it should work, but you need to create the instance for the user (and throw away what they gave). Right now, you could try to do that (copy everything) but update the |
I currently try to get rid of
HPy_SetType
in branch graal-team/hpy . We used it (as a replacement forPy_SET_TYPE
) in functiondtypemeta_wrap_legacy_descriptor
. I was able to refactor the creation of(_hpy)_builtin_descrs
(see https://github.com/hpyproject/numpy-hpy/blob/graal-team/hpy/numpy/core/src/multiarray/arraytypes.c.src#L4842). I did so by first creating the new dtype and then instantiating the singleton. However, it is not that simple for Numpy API(H)PyArray_RegisterDataType
because the descriptor to register is provided as argument (e.g. sometimes created with(H)PyArray_DescrNew
).My question is: are
(H)PyArray_DescrNew
and(H)PyArray_RegisterDataType
legacy APIs that have some replacement and could we just drop them in Numpy/HPy?Or is there some other way to solve this?
The text was updated successfully, but these errors were encountered: