Closed Alexander-Barth closed 11 months ago
Ok that makes sense, it was trying to handle linear indices on a vector. Maybe @meggart knows the background here.
Can you write a test so we dont break this again?
Good idea! Would it be ok to add NetCDF.jl as a test dependency? I am not sure how to create such array using only DiskArrays.
There is a _DiskArray
object defined in the tests that we use. It counts getindex
so you cant test the read pattern (e.g. you want one single read here), see the tests for examples.
OK, I just added the test. Without commit 76152b8cbd96fa07c4761a0dc1e442b7a9df3089, I checked that the test reproduces the failure in the function interpret_indices_disk
which is fixed by this PR.
Looks good! Thanks for adding that.
Would it make sense to explicitly test 2d arrays there too?
Thanks a lot. As you @rafaqz mentioned there was a special method for linear indexing into multidimensional arrays and in this case it was taking over linear indexing into 1D arrays as well. Looks good to me.
OK, I just added a 2d array.
This solves issue https://github.com/meggart/DiskArrays.jl/issues/123 for NetCDF.jl and NCDatasets.jl