MCPcopy Index your code
hub / github.com/pydata/xarray / PydapArrayWrapper

Class PydapArrayWrapper

xarray/backends/pydap_.py:38–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36
37
38class PydapArrayWrapper(BackendArray):
39 def __init__(self, array, checksums=True):
40 self.array = array
41
42 @property
43 def shape(self) -> tuple[int, ...]:
44 return self.array.shape
45
46 @property
47 def dtype(self):
48 return self.array.dtype
49
50 def __getitem__(self, key):
51 return indexing.explicit_indexing_adapter(
52 key, self.shape, indexing.IndexingSupport.BASIC, self._getitem
53 )
54
55 def _getitem(self, key):
56 result = robust_getitem(self.array, key, catch=ValueError)
57 result = np.asarray(result.data)
58 axis = tuple(n for n, k in enumerate(key) if isinstance(k, integer_types))
59 if result.ndim + len(axis) != self.array.ndim and axis:
60 result = np.squeeze(result, axis)
61 return result
62
63
64def get_group(ds, group):

Callers 1

open_store_variableMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…