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

refactor: drop use of behavior in recursively_apply #2805

Merged
merged 3 commits into from
Nov 7, 2023

Conversation

agoose77
Copy link
Collaborator

@agoose77 agoose77 commented Nov 7, 2023

This prepares the way to drop this argument in recursively_apply

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.

When string-broadcasting was hard-coded, no longer derived from a behavior, we no longer needed to pass behaviors into broadcast_and_apply, and I suppose it was being passed into recursively_apply for symmetry.

If the tests pass after simply removing it like this, then I suppose nothing was using it. I would have expected it to be passed to the action function, but apparently it's not.

Actually, why are these changes only in ak.operations.str.*? We use recursively_apply in a lot of places, not just here. Why don't they all have behavior=behavior push-downs to remove? Was this never really a part of the recursively_apply interface and their use in string functions was a mistake?

Anyway, I'm in favor of removing behavior from recursively_apply. It doesn't even mean we can't use it in recursively_apply's action functions, since the action function can be defined in such a way as to close over that variable. So, please do make the end-state of this to be such that behavior is removed from the recursively_apply interface, whether that involves changes beyond ak.operations.str.* or not.

Copy link

codecov bot commented Nov 7, 2023

Codecov Report

Merging #2805 (ff3ef68) into main (aafd2b4) will decrease coverage by 0.01%.
The diff coverage is 96.61%.

Additional details and impacted files
Files Coverage Δ
src/awkward/_do.py 83.43% <ø> (ø)
src/awkward/contents/bitmaskedarray.py 69.57% <100.00%> (ø)
src/awkward/contents/bytemaskedarray.py 89.10% <100.00%> (ø)
src/awkward/contents/emptyarray.py 75.24% <100.00%> (ø)
src/awkward/contents/indexedarray.py 79.04% <100.00%> (ø)
src/awkward/contents/indexedoptionarray.py 88.52% <100.00%> (ø)
src/awkward/contents/listarray.py 88.40% <100.00%> (ø)
src/awkward/contents/listoffsetarray.py 82.80% <100.00%> (ø)
src/awkward/contents/numpyarray.py 91.23% <100.00%> (ø)
src/awkward/contents/recordarray.py 84.58% <100.00%> (ø)
... and 73 more

@agoose77
Copy link
Collaborator Author

agoose77 commented Nov 7, 2023

Actually, why are these changes only in ak.operations.str.*? We use recursively_apply in a lot of places, not just here. Why don't they all have behavior=behavior push-downs to remove? Was this never really a part of the recursively_apply interface and their use in string functions was a mistake?

I was originally going to just start with ak.str, and follow up, as this PR was cherry-picked from another. However, let's just do it all together.

@agoose77 agoose77 force-pushed the agoose77/refactor-no-behavior branch from 0ba4f3f to ff3ef68 Compare November 7, 2023 19:07
@agoose77 agoose77 enabled auto-merge (squash) November 7, 2023 19:07
@agoose77 agoose77 merged commit a4ebc3b into main Nov 7, 2023
36 checks passed
@agoose77 agoose77 deleted the agoose77/refactor-no-behavior branch November 7, 2023 19:18
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