Skip to content

Commit f1b58d4

Browse files
committed
Use range of integers as out_selection not slice in CoordinateIndexer
To fix issue when using vindex with repeated indexes in indexer
1 parent 0b4b5d8 commit f1b58d4

File tree

2 files changed

+1
-9
lines changed

2 files changed

+1
-9
lines changed

src/zarr/core/indexing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1193,7 +1193,7 @@ def __iter__(self) -> Iterator[ChunkProjection]:
11931193
stop = self.chunk_nitems_cumsum[chunk_rix]
11941194
out_selection: slice | npt.NDArray[np.intp]
11951195
if self.sel_sort is None:
1196-
out_selection = slice(start, stop)
1196+
out_selection = np.arange(start, stop)
11971197
else:
11981198
out_selection = self.sel_sort[start:stop]
11991199

tests/test_properties.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -152,14 +152,6 @@ def test_vindex(data: st.DataObject) -> None:
152152
actual = zarray.vindex[indexer]
153153
assert_array_equal(nparray[indexer], actual)
154154

155-
# FIXME!
156-
# when the indexer is such that a value gets overwritten multiple times,
157-
# I think the output depends on chunking.
158-
# new_data = data.draw(npst.arrays(shape=st.just(actual.shape), dtype=nparray.dtype))
159-
# nparray[indexer] = new_data
160-
# zarray.vindex[indexer] = new_data
161-
# assert_array_equal(nparray, zarray[:])
162-
163155

164156
@given(store=stores, meta=array_metadata()) # type: ignore[misc]
165157
async def test_roundtrip_array_metadata_from_store(

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy