JuliaArrays / OffsetArrays.jl

Fortran-like arrays with arbitrary, zero or negative starting indices.
Other
198 stars 40 forks source link

make explicit that axes comparisons in tests ignore indices #357

Closed matthias314 closed 2 months ago

matthias314 commented 2 months ago

This PR was suggested by @nsajko in JuliaLang/julia#54825. Currently Julia compares ranges only by comparing their values, not their indices, although they should also be taken into account for AbstractVector. The tests in OffsetArrays.jl rely on this special behavior. This PR makes this explicit. It does not fix the broken mapreduce test mentioned in #353.

jishnub commented 2 months ago

We may use no_offset_view here to generate the offset-free axis.

matthias314 commented 2 months ago

Good point. I'm now using no_offset_view, and I've renamed axes_values to no_offset_axes.

If one wanted to have it really fancy, one could define a new operator, for example , that compares ranges and tuples of ranges without looking at the indices. That's not done at present.

codecov[bot] commented 2 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 98.67%. Comparing base (3910605) to head (e821865). Report is 2 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #357 +/- ## ======================================= Coverage 98.67% 98.67% ======================================= Files 6 6 Lines 453 453 ======================================= Hits 447 447 Misses 6 6 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

matthias314 commented 2 months ago

The failing test is the unrelated mapreduce issue JuliaLang/julia#55506.

jishnub commented 2 months ago

It's a different issue related to floating-point precision, but indeed unrelated to this PR.