From 4481014f760e531824c4dc4f089bd09e2914b869 Mon Sep 17 00:00:00 2001 From: Martijn van der Marel Date: Mon, 22 Jul 2024 10:32:38 +0200 Subject: [PATCH] move kwargs test to separate parameter set --- pint_xarray/tests/test_accessors.py | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/pint_xarray/tests/test_accessors.py b/pint_xarray/tests/test_accessors.py index 1aa675ea..a1829869 100644 --- a/pint_xarray/tests/test_accessors.py +++ b/pint_xarray/tests/test_accessors.py @@ -1521,13 +1521,13 @@ def test_reindex_like(obj, units, other, other_units, expected, expected_units, {"x": "dm", "y": "s"}, {"x": Quantity([1, 3, 5], "m"), "y": Quantity([0, 2], "min")}, xr.DataArray( - [[0, 1], [0, 5], [0, 0]], + [[np.nan, 1], [np.nan, 5], [np.nan, np.nan]], dims=("x", "y"), coords={"x": ("x", [1, 3, 5]), "y": ("y", [0, 2])}, ), {"x": "m", "y": "min"}, None, - {"bounds_error": False, "fill_value": 0}, + None, id="DataArray-compatible units", ), pytest.param( @@ -1562,6 +1562,24 @@ def test_reindex_like(obj, units, other, other_units, expected, expected_units, None, id="DataArray-data units", ), + pytest.param( + xr.DataArray( + [[0, 1], [2, 3], [4, 5]], + dims=("x", "y"), + coords={"x": ("x", [10, 20, 30]), "y": ("y", [60, 120])}, + ), + {"x": "dm", "y": "s"}, + {"x": Quantity([1, 3, 5], "m"), "y": Quantity([0, 2], "min")}, + xr.DataArray( + [[0, 1], [0, 5], [0, 0]], + dims=("x", "y"), + coords={"x": ("x", [1, 3, 5]), "y": ("y", [0, 2])}, + ), + {"x": "m", "y": "min"}, + None, + {"bounds_error": False, "fill_value": 0}, + id="DataArray-other parameters", + ), ), ) def test_interp(obj, units, indexers, expected, expected_units, error, kwargs):