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: move responsibility for positional reducers to Reducer.apply #2507

Merged
merged 1 commit into from
Jun 9, 2023

Conversation

agoose77
Copy link
Collaborator

@agoose77 agoose77 commented Jun 7, 2023

This PR moves the responsibility for "fixing" positional reducers into _reducers, such that reducers are self-contained. The same is not done for RecordArray, because this is effectively a separate reduction implementation that happens to use the same kernels.

@agoose77 agoose77 changed the base branch from main to agoose77/refactor-reducer-part-3 June 7, 2023 11:31
@codecov
Copy link

codecov bot commented Jun 7, 2023

Codecov Report

Merging #2507 (3faa298) into main (4a980df) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Additional details and impacted files
Impacted Files Coverage Δ
src/awkward/_connect/jax/reducers.py 86.20% <ø> (ø)
src/awkward/_reducers.py 97.18% <100.00%> (+0.11%) ⬆️
src/awkward/contents/numpyarray.py 90.99% <100.00%> (-0.11%) ⬇️

@agoose77 agoose77 temporarily deployed to docs-preview June 7, 2023 11:42 — with GitHub Actions Inactive
Base automatically changed from agoose77/refactor-reducer-part-3 to main June 7, 2023 20:11
@agoose77 agoose77 force-pushed the agoose77/refactor-positional-reduction-in-reducer branch from d13aa28 to 3faa298 Compare June 9, 2023 12:51
@agoose77 agoose77 temporarily deployed to docs-preview June 9, 2023 13:02 — with GitHub Actions Inactive
@agoose77 agoose77 marked this pull request as ready for review June 9, 2023 15:26
@agoose77 agoose77 requested a review from jpivarski June 9, 2023 15:27
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 makes sense. I had felt that _reduce_next was a reasonable place to put reducer-stuff, and it's only in NumpyArray._reduce_next, but ak._reducers is also a reasonable place and this removes noise from numpyarray.py, which deals with many non-reducer things as well.

@agoose77 agoose77 merged commit 645c817 into main Jun 9, 2023
@agoose77 agoose77 deleted the agoose77/refactor-positional-reduction-in-reducer branch June 9, 2023 23:59
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