Skip to content

Commit

Permalink
Use ds sizes in test
Browse files Browse the repository at this point in the history
since dims may change to tuple of dim names in future
  • Loading branch information
zmoon committed Sep 5, 2024
1 parent 1534e9d commit dbd69d3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/test_remap.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def test_combine_da_da():
new = combine_da_to_da(model, obs, merge=False, interp_time=False)

# Check
assert new.dims == {"z": 5, "y": n, "x": n}
assert new.sizes == {"z": 5, "y": n, "x": n}
assert float(new.longitude.min()) == pytest.approx(0.1)
assert float(new.longitude.max()) == pytest.approx(0.9)
assert float(new.latitude.min()) == pytest.approx(0.1)
Expand All @@ -105,6 +105,6 @@ def test_combine_da_da():

# Use orthogonal selection to get track
a = new.data.values[:, new.y, new.x]
assert a.shape == (model.dims["z"], n), "model levels but obs grid points"
assert a.shape == (model.sizes["z"], n), "model levels but obs grid points"
assert (np.diff(a.mean(axis=0)) >= 0).all(), "obs profile goes S"
assert np.isclose(np.diff(a.mean(axis=1)), 1, atol=1e-15, rtol=0).all(), "obs profile goes U"

0 comments on commit dbd69d3

Please sign in to comment.