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

Method _inplace_binary_op

xarray/core/variable.py:2469–2477  ·  view source on GitHub ↗
(self, other, f)

Source from the content-addressed store, hash-verified

2467 return result
2468
2469 def _inplace_binary_op(self, other, f):
2470 if isinstance(other, xr.Dataset):
2471 raise TypeError("cannot add a Dataset to a Variable in-place")
2472 self_data, other_data, dims = _broadcast_compat_data(self, other)
2473 if dims != self.dims:
2474 raise ValueError("dimensions cannot change for in-place operations")
2475 with np.errstate(all="ignore"):
2476 self.values = f(self_data, other_data)
2477 return self
2478
2479 def _to_numeric(self, offset=None, datetime_unit=None, dtype=float):
2480 """A (private) method to convert datetime array to numeric dtype

Callers

nothing calls this directly

Calls 2

_broadcast_compat_dataFunction · 0.85
fFunction · 0.70

Tested by

no test coverage detected