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: improve kernel error handling logic (1 of 3) #2505

Merged
merged 8 commits into from
Jun 7, 2023

Conversation

agoose77
Copy link
Collaborator

@agoose77 agoose77 commented Jun 7, 2023

For a while I've been intending upon refactoring the error handling logic for kernels, so that it's not associated with Content.

This PR does two things:

  • Moves _selfless_handle_error from Content to Backend.maybe_kernel_error
  • Simplifies _handle_error and renames to Content._maybe_index_error (name TBD)

@agoose77 agoose77 force-pushed the agoose77/refactor-reducer-part-2 branch from c2db368 to 2b8ca64 Compare June 7, 2023 01:25
@agoose77 agoose77 changed the title refactor: move responsibility for positional reducers to Reducer refactor: improve kernel error handling logic Jun 7, 2023
@agoose77 agoose77 temporarily deployed to docs-preview June 7, 2023 01:34 — with GitHub Actions Inactive
@agoose77 agoose77 marked this pull request as ready for review June 7, 2023 01:36
@codecov
Copy link

codecov bot commented Jun 7, 2023

Codecov Report

Merging #2505 (35fb169) into main (7342b79) will increase coverage by 0.08%.
The diff coverage is 92.03%.

Additional details and impacted files
Impacted Files Coverage Δ
src/awkward/contents/indexedarray.py 78.65% <73.33%> (ø)
src/awkward/contents/listoffsetarray.py 80.90% <76.47%> (ø)
src/awkward/_backends/backend.py 88.37% <87.50%> (-0.92%) ⬇️
src/awkward/contents/recordarray.py 85.09% <87.50%> (+0.02%) ⬆️
src/awkward/contents/indexedoptionarray.py 88.59% <93.10%> (ø)
src/awkward/contents/bytemaskedarray.py 89.07% <93.33%> (ø)
src/awkward/contents/numpyarray.py 91.09% <95.45%> (ø)
src/awkward/_reducers.py 94.20% <97.50%> (+5.43%) ⬆️
src/awkward/contents/bitmaskedarray.py 68.93% <100.00%> (ø)
src/awkward/contents/content.py 76.03% <100.00%> (+1.32%) ⬆️
... and 4 more

@agoose77 agoose77 temporarily deployed to docs-preview June 7, 2023 02:05 — with GitHub Actions Inactive
@agoose77 agoose77 changed the title refactor: improve kernel error handling logic refactor: improve kernel error handling logic (1 of 3) Jun 7, 2023
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 is a much-needed refactoring. The kernel-error handling was getting pretty crusty.

Although it touches a lot of files, most of them are just swapping names (and making the error-handling call "selfless"). It looks straightforward enough to me that I can just merge it.

@jpivarski jpivarski merged commit 33750f3 into main Jun 7, 2023
@jpivarski jpivarski deleted the agoose77/refactor-reducer-part-2 branch June 7, 2023 19:45
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