Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

defer to numpy for the expected result #7875

Merged
merged 4 commits into from
May 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions xarray/tests/test_ufuncs.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import pytest

import xarray as xr
from xarray.tests import assert_array_equal, mock
from xarray.tests import assert_allclose, assert_array_equal, mock
from xarray.tests import assert_identical as assert_identical_


Expand All @@ -16,16 +16,16 @@ def assert_identical(a, b):
assert_array_equal(a, b)


def test_unary():
args = [
0,
np.zeros(2),
@pytest.mark.parametrize(
"a",
[
xr.Variable(["x"], [0, 0]),
xr.DataArray([0, 0], dims="x"),
xr.Dataset({"y": ("x", [0, 0])}),
]
for a in args:
assert_identical(a + 1, np.cos(a))
],
)
def test_unary(a):
assert_allclose(a + 1, np.cos(a))


def test_binary():
Expand Down