(self, unit, dtype)
| 2865 | ), |
| 2866 | ) |
| 2867 | def test_isin(self, unit, dtype): |
| 2868 | array = ( |
| 2869 | create_nan_array([1.4, np.nan, 2.3, np.nan, np.nan, 9.1], dtype) |
| 2870 | * unit_registry.m |
| 2871 | ) |
| 2872 | data_array = xr.DataArray(data=array, dims="x") |
| 2873 | |
| 2874 | raw_values = create_nan_array([1.4, np.nan, 2.3], dtype) |
| 2875 | values = raw_values * unit |
| 2876 | |
| 2877 | units = {None: unit_registry.m if array.check(unit) else None} |
| 2878 | expected = strip_units(data_array).isin( |
| 2879 | strip_units(convert_units(values, units)) |
| 2880 | ) & array.check(unit) |
| 2881 | actual = data_array.isin(values) |
| 2882 | |
| 2883 | assert_units_equal(expected, actual) |
| 2884 | assert_identical(expected, actual) |
| 2885 | |
| 2886 | @pytest.mark.parametrize( |
| 2887 | "variant", ("masking", "replacing_scalar", "replacing_array", "dropping") |
nothing calls this directly
no test coverage detected