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

fix: support regular_to_jagged in Content._recursively_apply / ak.transform #2048

Merged
merged 4 commits into from
Dec 30, 2022

Conversation

agoose77
Copy link
Collaborator

Fixes #2047

@codecov
Copy link

codecov bot commented Dec 30, 2022

Codecov Report

Merging #2048 (b534427) into main (64377c1) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Additional details and impacted files
Impacted Files Coverage Δ
src/awkward/_do.py 83.72% <ø> (ø)
src/awkward/contents/content.py 73.13% <100.00%> (+0.38%) ⬆️
src/awkward/contents/regulararray.py 88.45% <100.00%> (+0.04%) ⬆️

@agoose77 agoose77 changed the title refactor: add type hints for recursively_apply fix: support regular_to_jagged in Content._recursively_apply Dec 30, 2022
@agoose77 agoose77 changed the title fix: support regular_to_jagged in Content._recursively_apply fix: support regular_to_jagged in Content._recursively_apply / ak.transform Dec 30, 2022
@agoose77 agoose77 temporarily deployed to docs-preview December 30, 2022 18:09 — with GitHub Actions Inactive
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.

This does seem like a good idea. Had it been a broadcast_and_apply argument that wasn't implemented in recursively_apply? If so, this is a good step toward further unification. regular_to_jagged is something one might want to do or not do, independent of whether there's only one array to recurse over or there are several arrays to broadcast together.

@jpivarski
Copy link
Member

And yes, it can be merged.

@agoose77
Copy link
Collaborator Author

Had it been a broadcast_and_apply argument that wasn't implemented in recursively_apply? If so, this is a good step toward further unification.

I think so, at least, that's what it looked like. I didn't dig too deeply into the git blame, but it seems as though the broadcasting logic came directly from the C++, and we know that ak.transform is younger than that.

@agoose77 agoose77 merged commit 31dcf21 into main Dec 30, 2022
@agoose77 agoose77 deleted the agoose77/fix-regular-to-ragged branch December 30, 2022 18:28
@jpivarski
Copy link
Member

I do remember a regular_to_jagged boolean argument, and in this PR, it's pretty obvious that such an argument wasn't in recursively_apply until now, so I guess it must have been in broadcast_and_apply.

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.

ak.transform doesn't respect regular_to_jagged for single argument
2 participants