-
Notifications
You must be signed in to change notification settings - Fork 89
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
ak.type does not understand numpy.<type>
style dtypes
#1840
Comments
Here's where it can go: in awkward/operations/ak_type.py, there's a case-catcher for awkward/src/awkward/operations/ak_type.py Lines 67 to 73 in c033697
The keys of that dict are actual They can be identified as isinstance(array, type) and issubclass(array, np.generic) |
Wouldn't this be fixed instead by asking for ? |
Thanks for this @lgray. We should be testing the comprehensive |
…rimitive_dict (#1841) * array.dtype.type will never be in ak.types.numpytype._dtype_to_primitive_dict * add in test for #1840 fixed by #1841 * style: pre-commit fixes * Handle np.dtype and NumPy raw types. * fix: support datetime64 * refactor: use existing type-check code * fix: catch missing cases from last commit * fix: support instances of `np.generic` * Revert the `(bool, np.bool_)` in 0fff03e * Complete coverage of the types in NumpyType. Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Jim Pivarski <[email protected]> Co-authored-by: Angus Hollands <[email protected]> Co-authored-by: Jim Pivarski <[email protected]>
Version of Awkward Array
2.0.0rc1
Description and code to reproduce
numpy = 1.23.4
results in:
np.float64
(ornp.<type>
in general) is a fairly common way for folks to denote typing, we should probably support it.The text was updated successfully, but these errors were encountered: