(self, unit, dtype)
| 3150 | ), |
| 3151 | ) |
| 3152 | def test_broadcast_equals(self, unit, dtype): |
| 3153 | left_array = np.ones(shape=(2, 2), dtype=dtype) * unit_registry.m |
| 3154 | right_array = np.ones(shape=(2,), dtype=dtype) * unit |
| 3155 | |
| 3156 | left = xr.DataArray(data=left_array, dims=("x", "y")) |
| 3157 | right = xr.DataArray(data=right_array, dims="x") |
| 3158 | |
| 3159 | units = { |
| 3160 | **extract_units(left), |
| 3161 | **({} if left_array.check(unit) else {None: None}), |
| 3162 | } |
| 3163 | expected = strip_units(left).broadcast_equals( |
| 3164 | strip_units(convert_units(right, units)) |
| 3165 | ) & left_array.check(unit) |
| 3166 | actual = left.broadcast_equals(right) |
| 3167 | |
| 3168 | assert expected == actual |
| 3169 | |
| 3170 | def test_pad(self, dtype): |
| 3171 | array = np.linspace(0, 5, 10).astype(dtype) * unit_registry.m |
nothing calls this directly
no test coverage detected