-
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
Simplify & unify ak.type()
#2096
Comments
@jpivarski I started working on this, but realised we should discuss. |
Okay. |
As a result of this conversation, we settled on:
In Awkward, strings are not fundamentally scalars. They have some scalar-like behaviors that we add in by hand. |
To add — what we're demonstrating with |
As discussed in #2070,
ak.type
would benefit from accepting ahighlevel
andbehavior
argument to control whether a composableak.types.Type
is returned in favour of the outerak.types.ArrayType
.I also think we should simplify
ak.type
to deal exclusively with array-like objects. #1840 added support for some more scalars, but now that I think about it, we don't have any way of expressing these at the Awkward level; you can't have a bare scalar in an Awkward type, only a length-1 array. I thinkak.type
should just deal with arrays / array-like objects, and conventionalisinstance()
etc can be used for other types.We can make changes to
ak.type
non-breaking usingak._util.deprecate
and requiring users to explicitly passhighlevel=True/False
. Or, we can just declare it in the wiki, and write it in the changelog so that users don't need to writeak.type(..., highlevel=True)
.The text was updated successfully, but these errors were encountered: