Skip to content

Commit

Permalink
Fix test for minimum xarray
Browse files Browse the repository at this point in the history
  • Loading branch information
dcamron authored and dopplershift committed Dec 23, 2022
1 parent 55e0132 commit f963218
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tests/calc/test_kinematics.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,11 +381,14 @@ def test_advection_1d_vertical():
pressure = xr.DataArray(
np.array([1000., 950., 900.]), dims='pressure', attrs={'units': 'hPa'})
omega = xr.DataArray(
np.array([20., 30., 40.]), coords={'pressure': pressure}, attrs={'units': 'hPa/sec'})
np.array([20., 30., 40.]),
coords=[pressure], dims=['pressure'], attrs={'units': 'hPa/sec'})
s = xr.DataArray(
np.array([25., 20., 15.]), coords={'pressure': pressure}, attrs={'units': 'degC'})
np.array([25., 20., 15.]),
coords=[pressure], dims=['pressure'], attrs={'units': 'degC'})
a = advection(s, w=omega)
truth = xr.DataArray(-np.array([2, 3, 4]) * units('K/sec'), coords=a.coords)
truth = xr.DataArray(
-np.array([2, 3, 4]) * units('K/sec'), coords=[pressure], dims=['pressure'])

assert_array_almost_equal(a, truth)

Expand Down

0 comments on commit f963218

Please sign in to comment.