-
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
Fix: drop parameters for flattened RecordArray #1214
Conversation
Codecov Report
|
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.
That's looking good. The examples I wrote in Gitter could be used as a test.
>>> import awkward as ak
>>> from awkward._v2.tmp_for_testing import v1_to_v2
>>> stuffy = ak.Array([{"x": [[1, 2], []]}, {"x": []}, {"x": [[3]]}], with_name="Stuff")
>>> stuffy
<Array [{x: [[1, 2], []]}, ... {x: [[3]]}] type='3 * Stuff["x": var * var * int64]'>
>>> ak.flatten(stuffy, axis=2)
<Array [{x: [1, 2]}, {x: []}, {x: [3]}] type='3 * {"x": var * int64}'>
>>> stuffy_v2 = ak._v2.highlevel.Array(v1_to_v2(stuffy.layout))
>>> stuffy_v2
<Array [{x: [[1, 2], []]}, {...}, {x: [[3]]}] type='3 * Stuff[x: var * var *...'>
>>> ak._v2.highlevel.Array(stuffy_v2.layout.flatten(axis=2))
<Array [{x: [1, 2]}, {x: []}, {x: [3]}] type='3 * Stuff[x: var * int64]'>
>>> another = ak.Array([[{"x": 1}, {"x": 2}], [], [{"x": 3}]], with_name="Stuff")
>>> another
<Array [[{x: 1}, {x: 2}], [], [{x: 3}]] type='3 * var * Stuff["x": int64]'>
>>> ak.flatten(another, axis=1)
<Array [{x: 1}, {x: 2}, {x: 3}] type='3 * Stuff["x": int64]'>
>>> ak._v2.highlevel.Array(v1_to_v2(another.layout).flatten(axis=1))
<Array [{x: 1}, {x: 2}, {x: 3}] type='3 * Stuff[x: int64]'>
Ha, thanks for the test cases. I only added a tiny test for the draft, this makes things a lot easier. |
It's set to auto-merge. |
No description provided.