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: string broadcasting #2552

Merged
merged 11 commits into from
Jun 30, 2023
Merged

fix: string broadcasting #2552

merged 11 commits into from
Jun 30, 2023

Conversation

agoose77
Copy link
Collaborator

@agoose77 agoose77 commented Jun 30, 2023

There are still some outstanding problems with string broadcasting, that pertain to parameter replacement in broadcast_and_apply.

The main cases are covered in the tests as xfail.

This PR fixes the broadcasting rules for parameters, with the following changes:

  1. New list-types are not included in the parameter broadcasting, using a sentinel "NO_PARAMETERS" token
  2. Record and union broadcasting considers only the parameters of the record/union layouts respectively; the non-record/non-union contents are nested in the records/unions that are build.

@agoose77
Copy link
Collaborator Author

This PR is done! We will possibly need to revisit this again in future; broadcasting is a fiddly thing, but it's definitely an improvement, and removes some xfails!

@agoose77 agoose77 requested a review from jpivarski June 30, 2023 13:46
@agoose77 agoose77 temporarily deployed to docs-preview June 30, 2023 13:54 — 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.

These are the right tests to make work. I had some comments on the implementation until I noticed that I was wrong, and deleted them.

It all looks good! Go ahead and merge when you're ready.

@codecov
Copy link

codecov bot commented Jun 30, 2023

Codecov Report

Merging #2552 (83f9273) into main (228577b) will decrease coverage by 0.10%.
The diff coverage is 93.58%.

Additional details and impacted files
Impacted Files Coverage Δ
src/awkward/contents/indexedarray.py 78.99% <ø> (ø)
src/awkward/_broadcasting.py 93.02% <92.45%> (-0.58%) ⬇️
src/awkward/_parameters.py 82.22% <95.65%> (-0.74%) ⬇️
src/awkward/_connect/numpy.py 91.86% <100.00%> (ø)

... and 5 files with indirect coverage changes

@agoose77 agoose77 enabled auto-merge (squash) June 30, 2023 16:08
@agoose77 agoose77 temporarily deployed to docs-preview June 30, 2023 16:08 — with GitHub Actions Inactive
@agoose77 agoose77 merged commit 002a3af into main Jun 30, 2023
36 checks passed
@agoose77 agoose77 deleted the agoose77/fix-string-broadcasting branch June 30, 2023 16:13
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.

None yet

2 participants