-
Notifications
You must be signed in to change notification settings - Fork 2
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: All of the Awkward layout types. #13
Conversation
) where {INDEX<:IndexBig} where {CONTENT<:Content} = | ||
ListArray(INDEX([]), INDEX([]), CONTENT(), parameters = parameters, behavior = behavior) | ||
|
||
function copy( |
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.
is this suppose to be Base.copy
? I guess there's also Base.deepcopy()
so it's one of them probably
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.
It's supposed to be distinct from Base.copy
. Layout nodes in Awkward each have a constructor named copy
that shallow-copies every argument that is not named: it's a great way to get "a struct exactly like this_one
but with this_field
and that_field
replaced."
Before the final version of this package, the name might change to something that doesn't sound like it's supposed to be Base.copy
. Or if there's a Julia way of doing this, it would be replaced by that. (Note that this copy
can change type parameters as well as values.)
Is there a conceptual or application-wise difference between |
In Awkward, So I'll just ignore |
Some of the arguments for But even if I switch all of the The reason is completely analogous to why these methods in Python have |
test/runtests.jl
Outdated
# this is the tricky part: users have to add dummy values to records | ||
# with Bit/ByteMaskedArray and *not* with IndexedOptionArray | ||
AwkwardArray.push!(a_layout, 7) | ||
AwkwardArray.push!(b_layout, 7.7) | ||
AwkwardArray.push_null!(layout) | ||
@test length(layout) == 7 | ||
@test ismissing(layout[7]) |
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.
Note to self: if all Content
subclasses implement zero
, then it would be possible to auto-fill records and not require users to do something different when push_null!
on option-type of record. That would be a good thing to do and this should become an issue.
Congrats!! that was unbelievably fast |
Thanks! Some things will be easier to apply, now that all of the node types exist. |
LeafType
)LeafType
)ListType
)ListType
)ListType
)OptionType
)OptionType
)OptionType
)OptionType
)AwkwardArray.Record
AwkwardArray.Tuple