File tree 2 files changed +9
-4
lines changed 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -218,6 +218,10 @@ async def _async_getitem(self, key):
218
218
async_array = self ._array ._async_array
219
219
return await async_array .getitem (key )
220
220
221
+ async def _async_oindex (self , key ):
222
+ async_array = self ._array ._async_array
223
+ return await async_array .oindex .getitem (key )
224
+
221
225
def __getitem__ (self , key ):
222
226
array = self ._array
223
227
if isinstance (key , indexing .BasicIndexer ):
@@ -241,12 +245,11 @@ async def async_getitem(self, key):
241
245
# method = self._vindex
242
246
raise NotImplementedError ("async lazy vectorized indexing is not supported" )
243
247
elif isinstance (key , indexing .OuterIndexer ):
244
- # method = self._oindex
245
- raise NotImplementedError ("async lazy orthogonal indexing is not supported" )
248
+ method = self ._async_oindex
246
249
247
250
print ("did an async get" )
248
251
return await indexing .async_explicit_indexing_adapter (
249
- key , array .shape , indexing .IndexingSupport .BASIC , method
252
+ key , array .shape , indexing .IndexingSupport .OUTER , method
250
253
)
251
254
252
255
Original file line number Diff line number Diff line change @@ -25,6 +25,9 @@ class LatencyStore(WrapperStore[T_Store]):
25
25
26
26
latency : float
27
27
28
+ # TODO only have to add this because of dumb behaviour in zarr where it raises with "ValueError: Store is not read-only but mode is 'r'"
29
+ read_only = True
30
+
28
31
def __init__ (
29
32
self ,
30
33
store : T_Store ,
@@ -175,7 +178,6 @@ async def test_concurrent_load_multiple_objects(self, xr_obj) -> None:
175
178
total_time = timer .total_time , latency = self .LATENCY , n_loads = N_OBJECTS
176
179
)
177
180
178
- @pytest .mark .xfail (reason = "not implemented" )
179
181
async def test_indexing (self , memorystore ) -> None :
180
182
latencystore = LatencyStore (memorystore , latency = self .LATENCY )
181
183
ds = xr .open_zarr (latencystore , zarr_format = 3 , consolidated = False , chunks = None )
You can’t perform that action at this time.
0 commit comments