dask: `Data.inspect` by davidhassell · Pull Request #394 · NCAS-CMS/cf-python
Expand Up
@@ -845,7 +845,7 @@ def __bool__(self):
"elements is ambiguous. Use d.any() or d.all()"
)
return bool(self._get_dask()) return bool(self.to_dask_array())
def __repr__(self): """Called by the `repr` built-in function. Expand Down Expand Up @@ -5665,7 +5665,7 @@ def all(self, axis=None, keepdims=True, split_every=None):
""" d = self.copy(array=False) dx = self._get_dask() dx = self.to_dask_array() dx = da.all(dx, axis=axis, keepdims=keepdims, split_every=split_every) d._set_dask(dx, reset_mask_hardness=False) d.hardmask = _DEFAULT_HARDMASK Expand Down Expand Up @@ -5782,7 +5782,7 @@ def any(self, axis=None, keepdims=True, split_every=None):
""" d = self.copy(array=False) dx = self._get_dask() dx = self.to_dask_array() dx = da.any(dx, axis=axis, keepdims=keepdims, split_every=split_every) d._set_dask(dx, reset_mask_hardness=False) d.hardmask = _DEFAULT_HARDMASK Expand Down Expand Up @@ -9544,6 +9544,7 @@ def flip(self, axes=None, inplace=False, i=False):
return d
@daskified(_DASKIFIED_VERBOSE) def inspect(self): """Inspect the object for debugging.
Expand All @@ -9553,10 +9554,23 @@ def inspect(self):
`None`
**Examples**
>>> d = cf.Data([9], 'm') >>> d.inspect() <CF Data(1): [9] m> ------------------- {'_components': {'custom': {'_Units': <Units: m>, '_axes': ('dim0',), '_cyclic': set(), '_hardmask': True, 'dask': dask.array<cf_harden_mask, shape=(1,), dtype=int64, chunksize=(1,), chunktype=numpy.ndarray>}, 'netcdf': {}}}
""" from ..functions import inspect
print(inspect(self)) # pragma: no cover inspect(self)
def isclose(self, y, rtol=None, atol=None): """Return where data are element-wise equal to other, Expand Down
return bool(self._get_dask()) return bool(self.to_dask_array())
def __repr__(self): """Called by the `repr` built-in function. Expand Down Expand Up @@ -5665,7 +5665,7 @@ def all(self, axis=None, keepdims=True, split_every=None):
""" d = self.copy(array=False) dx = self._get_dask() dx = self.to_dask_array() dx = da.all(dx, axis=axis, keepdims=keepdims, split_every=split_every) d._set_dask(dx, reset_mask_hardness=False) d.hardmask = _DEFAULT_HARDMASK Expand Down Expand Up @@ -5782,7 +5782,7 @@ def any(self, axis=None, keepdims=True, split_every=None):
""" d = self.copy(array=False) dx = self._get_dask() dx = self.to_dask_array() dx = da.any(dx, axis=axis, keepdims=keepdims, split_every=split_every) d._set_dask(dx, reset_mask_hardness=False) d.hardmask = _DEFAULT_HARDMASK Expand Down Expand Up @@ -9544,6 +9544,7 @@ def flip(self, axes=None, inplace=False, i=False):
return d
@daskified(_DASKIFIED_VERBOSE) def inspect(self): """Inspect the object for debugging.
Expand All @@ -9553,10 +9554,23 @@ def inspect(self):
`None`
**Examples**
>>> d = cf.Data([9], 'm') >>> d.inspect() <CF Data(1): [9] m> ------------------- {'_components': {'custom': {'_Units': <Units: m>, '_axes': ('dim0',), '_cyclic': set(), '_hardmask': True, 'dask': dask.array<cf_harden_mask, shape=(1,), dtype=int64, chunksize=(1,), chunktype=numpy.ndarray>}, 'netcdf': {}}}
""" from ..functions import inspect
print(inspect(self)) # pragma: no cover inspect(self)
def isclose(self, y, rtol=None, atol=None): """Return where data are element-wise equal to other, Expand Down