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

Method test_dropna

xarray/tests/test_units.py:2842–2855  ·  view source on GitHub ↗
(self, dtype)

Source from the content-addressed store, hash-verified

2840 assert_identical(expected, actual)
2841
2842 def test_dropna(self, dtype):
2843 array = (
2844 create_nan_array([1.4, np.nan, 2.3, np.nan, np.nan, 9.1], dtype)
2845 * unit_registry.m
2846 )
2847 x = np.arange(len(array))
2848 data_array = xr.DataArray(data=array, coords={"x": x}, dims=["x"])
2849
2850 units = extract_units(data_array)
2851 expected = attach_units(strip_units(data_array).dropna(dim="x"), units)
2852 actual = data_array.dropna(dim="x")
2853
2854 assert_units_equal(expected, actual)
2855 assert_identical(expected, actual)
2856
2857 @pytest.mark.parametrize(
2858 "unit",

Callers

nothing calls this directly

Calls 9

dropnaMethod · 0.95
assert_identicalFunction · 0.90
create_nan_arrayFunction · 0.85
extract_unitsFunction · 0.85
attach_unitsFunction · 0.85
strip_unitsFunction · 0.85
assert_units_equalFunction · 0.85
arangeMethod · 0.80
dropnaMethod · 0.45

Tested by

no test coverage detected