Skip to content
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

Enable ak.singletons #1444

Merged
merged 2 commits into from
Apr 28, 2022
Merged

Enable ak.singletons #1444

merged 2 commits into from
Apr 28, 2022

Conversation

ioanaif
Copy link
Collaborator

@ioanaif ioanaif commented Apr 26, 2022

No description provided.

@codecov
Copy link

codecov bot commented Apr 26, 2022

Codecov Report

Merging #1444 (51b6cc7) into main (edfce38) will decrease coverage by 0.02%.
The diff coverage is 61.83%.

Impacted Files Coverage Δ
src/awkward/_v2/_connect/cuda/__init__.py 0.00% <0.00%> (ø)
src/awkward/_v2/_connect/jax/__init__.py 0.00% <0.00%> (ø)
src/awkward/_v2/contents/recordarray.py 82.26% <ø> (+0.76%) ⬆️
src/awkward/_v2/contents/unionarray.py 86.50% <ø> (ø)
src/awkward/_v2/operations/convert/ak_from_cupy.py 50.00% <0.00%> (+23.33%) ⬆️
src/awkward/_v2/operations/convert/ak_from_iter.py 93.75% <ø> (ø)
src/awkward/_v2/operations/convert/ak_from_jax.py 50.00% <0.00%> (-25.00%) ⬇️
...wkward/_v2/operations/convert/ak_to_arrow_table.py 100.00% <ø> (ø)
src/awkward/_v2/operations/convert/ak_to_cupy.py 33.33% <0.00%> (+23.95%) ⬆️
src/awkward/_v2/operations/convert/ak_to_jax.py 33.33% <0.00%> (-41.67%) ⬇️
... and 74 more

@jpivarski
Copy link
Member

To implement an axis, maybe use :, :, :, np.newaxis (if nonnegative) or ..., np.newaxis, :, :, : (if negative) and then drop_none?

As for whether singletons should include Nones, I think it shouldn't, because otherwise it would be completely identical to the above slide (and it wouldn't be doing what singletons was invented to do: to switch between a token-based and a 0/1-length list-based representation of missing data).

@jpivarski
Copy link
Member

drop_none is #832.

Copy link
Member

@jpivarski jpivarski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving, but there needs to be another PR that adds an axis parameter to the new singletons. That can be implemented another PR, especially if you're going the route of doing it through drop_none.

@jpivarski jpivarski merged commit b20fd73 into main Apr 28, 2022
@jpivarski jpivarski deleted the ioanaif/ak.singletons branch April 28, 2022 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants