File tree Expand file tree Collapse file tree 2 files changed +15
-9
lines changed Expand file tree Collapse file tree 2 files changed +15
-9
lines changed Original file line number Diff line number Diff line change @@ -59,6 +59,8 @@ Bug fixes
59
59
By `Tom Nicholas <https://github.com/TomNicholas >`_.
60
60
- Ensure :py:meth: `DataArray.unstack ` works when wrapping array API-compliant classes. (:issue: `8666 `, :pull: `8668 `)
61
61
By `Tom Nicholas <https://github.com/TomNicholas >`_.
62
+ - Fix negative slicing of Zarr arrays without dask installed. (:issue: `8252 `)
63
+ By `Deepak Cherian <https://github.com/dcherian >`_.
62
64
- Preserve chunks when writing time-like variables to zarr by enabling lazy CF
63
65
encoding of time-like variables (:issue: `7132 `, :issue: `8230 `, :issue: `8432 `,
64
66
:pull: `8575 `). By `Spencer Clark <https://github.com/spencerkclark >`_ and
Original file line number Diff line number Diff line change @@ -86,19 +86,23 @@ def get_array(self):
86
86
def _oindex (self , key ):
87
87
return self ._array .oindex [key ]
88
88
89
+ def _vindex (self , key ):
90
+ return self ._array .vindex [key ]
91
+
92
+ def _getitem (self , key ):
93
+ return self ._array [key ]
94
+
89
95
def __getitem__ (self , key ):
90
96
array = self ._array
91
97
if isinstance (key , indexing .BasicIndexer ):
92
- return array [ key . tuple ]
98
+ method = self . _getitem
93
99
elif isinstance (key , indexing .VectorizedIndexer ):
94
- return array .vindex [
95
- indexing ._arrayize_vectorized_indexer (key , self .shape ).tuple
96
- ]
97
- else :
98
- assert isinstance (key , indexing .OuterIndexer )
99
- return indexing .explicit_indexing_adapter (
100
- key , array .shape , indexing .IndexingSupport .VECTORIZED , self ._oindex
101
- )
100
+ method = self ._vindex
101
+ elif isinstance (key , indexing .OuterIndexer ):
102
+ method = self ._oindex
103
+ return indexing .explicit_indexing_adapter (
104
+ key , array .shape , indexing .IndexingSupport .VECTORIZED , method
105
+ )
102
106
103
107
# if self.ndim == 0:
104
108
# could possibly have a work-around for 0d data here
You can’t perform that action at this time.
0 commit comments