MCPcopy
hub / github.com/pydata/xarray / astype

Method astype

xarray/tests/arrays.py:217–222  ·  view source on GitHub ↗

Needed because xarray will call this even when it's a no-op

(self, dtype: np.dtype, /, *, copy: bool = True)

Source from the content-addressed store, hash-verified

215 return NotImplemented
216
217 def astype(self, dtype: np.dtype, /, *, copy: bool = True) -> Self:
218 """Needed because xarray will call this even when it's a no-op"""
219 if dtype != self.dtype:
220 raise NotImplementedError()
221 else:
222 return self
223
224 def __and__(self, other: Self) -> Self:
225 return type(self)(self._array & other._array)

Calls

no outgoing calls