@@ -972,7 +972,7 @@ def _replace(
972972 if dims is _default :
973973 dims = copy .copy (self ._dims )
974974 if data is _default :
975- data = copy .copy (self .data )
975+ data = copy .copy (self ._data )
976976 if attrs is _default :
977977 attrs = copy .copy (self ._attrs )
978978 if encoding is _default :
@@ -1228,7 +1228,7 @@ def _pad_options_dim_to_index(
12281228 if fill_with_shape :
12291229 return [
12301230 pad_option .get (d , (n , n ))
1231- for d , n in zip (self .dims , self .data . shape , strict = True )
1231+ for d , n in zip (self .dims , self .shape , strict = True )
12321232 ]
12331233 return [pad_option .get (d , (0 , 0 )) for d in self .dims ]
12341234
@@ -1304,7 +1304,7 @@ def pad(
13041304
13051305 # workaround for bug in Dask's default value of stat_length https://github.com/dask/dask/issues/5303
13061306 if stat_length is None and mode in ["maximum" , "mean" , "median" , "minimum" ]:
1307- stat_length = [(n , n ) for n in self .data . shape ] # type: ignore[assignment]
1307+ stat_length = [(n , n ) for n in self .shape ] # type: ignore[assignment]
13081308
13091309 pad_width_by_index = self ._pad_options_dim_to_index (pad_width )
13101310
@@ -1469,14 +1469,15 @@ def set_dims(self, dim, shape=None):
14691469 if self .dims == expanded_dims :
14701470 # don't use broadcast_to unless necessary so the result remains
14711471 # writeable if possible
1472- expanded_data = self .data
1472+ expanded_data = self ._data
14731473 elif shape is None or all (
14741474 s == 1 for s , e in zip (shape , dim , strict = True ) if e not in self_dims
14751475 ):
14761476 # "Trivial" broadcasting, i.e. simply inserting a new dimension
14771477 # This is typically easier for duck arrays to implement
14781478 # than the full "broadcast_to" semantics
14791479 indexer = (None ,) * (len (expanded_dims ) - self .ndim ) + (...,)
1480+ # TODO: switch this to ._data once we teach ExplicitlyIndexed arrays to handle indexers with None.
14801481 expanded_data = self .data [indexer ]
14811482 else : # elif shape is not None:
14821483 dims_map = dict (zip (dim , shape , strict = True ))
0 commit comments