Skip to content

fix: handle union array simplification returning back indexed arrays in ak.almost_equal#3909

Merged
ianna merged 1 commit into
scikit-hep:mainfrom
ikrommyd:fix-almost-equal
Mar 12, 2026
Merged

fix: handle union array simplification returning back indexed arrays in ak.almost_equal#3909
ianna merged 1 commit into
scikit-hep:mainfrom
ikrommyd:fix-almost-equal

Conversation

@ikrommyd

@ikrommyd ikrommyd commented Mar 12, 2026

Copy link
Copy Markdown
Member

Closes #3888,
Following #3889, this tackles bug 2 of #3888
Equality can now properly be asserted in the property based testing so we remove the second test that didn't check for equality.

@codecov

codecov Bot commented Mar 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.70%. Comparing base (95fa2ff) to head (fa641f4).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
Files with missing lines Coverage Δ
src/awkward/operations/ak_almost_equal.py 98.18% <100.00%> (+0.06%) ⬆️

... and 3 files with indirect coverage changes

@github-actions

Copy link
Copy Markdown

The documentation preview is ready to be viewed at http://preview.awkward-array.org.s3-website.us-east-1.amazonaws.com/PR3909

@ianna ianna left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ikrommyd - Great! By calling .project(), you resolve the index and create a fresh, contiguous version of the data. This ensures the visitor function is looking at the actual values in their logical order. Not sure about deleting the test though...

Comment thread tests/properties/operations/test_to_from_buffers.py
@ikrommyd

ikrommyd commented Mar 12, 2026

Copy link
Copy Markdown
Member Author

@ikrommyd - Great! By calling .project(), you resolve the index and create a fresh, contiguous version of the data. This ensures the visitor function is looking at the actual values in their logical order. Not sure about deleting the test though...

Oh the test is not being deleted, it's just being all in one test now. We don't need two tests. The second test was just to test the union array case where assert_equal wouldn't work. It's now being properly tested in the first test with assert_equal which doesn't have allow_union=False now. Which is why I also do 1000 samples now in a test instead of 500x2.

@ianna
ianna merged commit efc4e29 into scikit-hep:main Mar 12, 2026
42 checks passed
@ikrommyd
ikrommyd deleted the fix-almost-equal branch March 12, 2026 18:48
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.array_equal() fails on virtual arrays and returns wrong result for empty unions

3 participants