meggart / DiskArrays.jl

Other
72 stars 13 forks source link

Fix a case of wrong aliasing for setindex #164

Closed meggart closed 4 months ago

meggart commented 4 months ago

This occured in setindex! cases where source and destination shape were not the same, e.g.

a[1:10,2:2] = 1:10

A test was added for this in setindex tests.

meggart commented 4 months ago

For reference: This is the failing PR over at Zarr.jl https://github.com/JuliaIO/Zarr.jl/pull/140

meggart commented 4 months ago

And in general, I think it would be good to increase the number of unit tests for setindex!. A lot of work has gone into thorough testing of getindex operations and the resolution of indices goes through the same machinery for both, but some case are different, especially since the user supplies 2 arrays instead of one some rules need to be obeyed, so there are numerous combinations of additional or missing trailing indices of singleton dimensions to test, both for the array to be written to and for the array containing the data to write.