-
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
feat: add new __list__
parameter for list-based array types
#2549
Conversation
Codecov Report
Additional details and impacted files
|
The addition of the new |
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.
Very nice! I like the new documentation examples, too.
Since this PR is more complicated and you might think of something you need to add at the last minute, I'll let you merge it. I think it's done.
@@ -4,6 +4,8 @@ | |||
|
|||
from awkward._typing import JSONMapping, JSONSerializable | |||
|
|||
TYPE_PARAMETERS = ("__array__", "__list__", "__record__", "__categorical__") |
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.
✔️
Sorry that I missed this question! A
for an array of lists of overloaded bytestrings that are interpreted as PNG images. The Since then, the The bytestring use-case (I can't think of any others, involving So yes, I think it would be a good addition, but it can be applied in the same way that it is for |
This PR adds a new
__list__
nominal type parameter to associate with behaviors. It should only be added to lists. In addition to setting an array-class forListOffsetArray
(et al.) vialayout.parameter("__list__")
, we can also lookup the list in a purelist sense, allowing list-of-type to have an array class too.Setting
__list__
and__record__
an error for non-intended types, but that should be another PR (there are fixes that need to be made to bothvalidity_error
and broadcasting).