Skip to content
forked from pydata/xarray

Commit

Permalink
fix tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
dcherian committed Nov 9, 2019
1 parent b93a19f commit d7f677c
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions xarray/tests/test_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -5402,12 +5402,11 @@ def test_coarsen(ds, dask, boundary, side):

actual = ds.coarsen(time=2, x=3, boundary=boundary, side=side).max()
assert_equal(
actual["z1"], ds["z1"].coarsen(time=2, x=3, boundary=boundary, side=side).max()
actual["z1"], ds["z1"].coarsen(x=3, boundary=boundary, side=side).max()
)
# coordinate should be mean by default
assert_equal(
actual["time"],
ds["time"].coarsen(time=2, x=3, boundary=boundary, side=side).mean(),
actual["time"], ds["time"].coarsen(time=2, boundary=boundary, side=side).mean()
)


Expand All @@ -5418,8 +5417,8 @@ def test_coarsen_coords(ds, dask):

# check if coord_func works
actual = ds.coarsen(time=2, x=3, boundary="trim", coord_func={"time": "max"}).max()
assert_equal(actual["z1"], ds["z1"].coarsen(time=2, x=3, boundary="trim").max())
assert_equal(actual["time"], ds["time"].coarsen(time=2, x=3, boundary="trim").max())
assert_equal(actual["z1"], ds["z1"].coarsen(x=3, boundary="trim").max())
assert_equal(actual["time"], ds["time"].coarsen(time=2, boundary="trim").max())

# raise if exact
with pytest.raises(ValueError):
Expand Down

0 comments on commit d7f677c

Please sign in to comment.