-
Notifications
You must be signed in to change notification settings - Fork 82
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
fix: add ScalarType
and treat bare strings as char arrays
#2116
Conversation
Ah yes, test are now broken because we don't infer high-level / low-level from the array / layout type. |
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've reviewed it, and it's good to merge once the tests have been updated.
@jpivarski in the test suite, a few places have become high-level tests (i.e., I added I added a test to cover some of the |
@jpivarski btw, I'm maybe yielding on |
It does test |
I never had a strong reason for it—just symmetry with the other |
Sure, I mean simply that if |
Codecov Report
Additional details and impacted files
|
Fixes #2096, closes #2070, and adjusts #2098 to treat strings as character arrays.
The new
ScalarType
object let's us determine whether we haveak.Record
or anak.Array
of records. It is the natural counterpart to the "high-level"ArrayType
. Importantly, Awkward type objects lose information if they're considered at the low-level, i.e. not wrapped byScalarType
orArrayType
; it is not possible to determine whether one has an Array or a Record.Note that this PR does not remove the
__cast__
implementation that converts stringufunc
*args
arguments to character arrays. This seems desirable in the main, unless there are well-known ufuncs that take string arguments?