Skip to content

Commit

Permalink
change compute_backend param "None" to None
Browse files Browse the repository at this point in the history
  • Loading branch information
maawoo committed Feb 1, 2024
1 parent abc1a90 commit ebfe30f
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions xarray/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ def backend(request):
return request.param


@pytest.fixture(params=["numbagg", "bottleneck", "None"])
@pytest.fixture(params=["numbagg", "bottleneck", None])
def compute_backend(request):
if request.param == "None":
if request.param is None:
options = dict(use_bottleneck=False, use_numbagg=False)
elif request.param == "bottleneck":
options = dict(use_bottleneck=True, use_numbagg=False)
Expand Down
2 changes: 1 addition & 1 deletion xarray/tests/test_dataarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -2889,7 +2889,7 @@ def test_reduce_out(self) -> None:
with pytest.raises(TypeError):
orig.mean(out=np.ones(orig.shape))

@pytest.mark.parametrize("compute_backend", ["numbagg", "None"], indirect=True)
@pytest.mark.parametrize("compute_backend", ["numbagg", None], indirect=True)
@pytest.mark.parametrize("skipna", [True, False, None])
@pytest.mark.parametrize("q", [0.25, [0.50], [0.25, 0.75]])
@pytest.mark.parametrize(
Expand Down
4 changes: 2 additions & 2 deletions xarray/tests/test_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -5616,7 +5616,7 @@ def test_reduce_keepdims(self) -> None:
)
assert_identical(expected, actual)

@pytest.mark.parametrize("compute_backend", ["numbagg", "None"], indirect=True)
@pytest.mark.parametrize("compute_backend", ["numbagg", None], indirect=True)
@pytest.mark.parametrize("skipna", [True, False, None])
@pytest.mark.parametrize("q", [0.25, [0.50], [0.25, 0.75]])
def test_quantile(self, q, skipna, compute_backend) -> None:
Expand All @@ -5640,7 +5640,7 @@ def test_quantile(self, q, skipna, compute_backend) -> None:
assert "dim3" in ds_quantile.dims
assert all(d not in ds_quantile.dims for d in dim)

@pytest.mark.parametrize("compute_backend", ["numbagg", "None"], indirect=True)
@pytest.mark.parametrize("compute_backend", ["numbagg", None], indirect=True)
@pytest.mark.parametrize("skipna", [True, False])
def test_quantile_skipna(self, skipna, compute_backend) -> None:
q = 0.1
Expand Down
10 changes: 5 additions & 5 deletions xarray/tests/test_units.py
Original file line number Diff line number Diff line change
Expand Up @@ -2004,7 +2004,7 @@ def test_squeeze(self, dim, dtype):
assert_units_equal(expected, actual)
assert_identical(expected, actual)

@pytest.mark.parametrize("compute_backend", ["numbagg", "None"], indirect=True)
@pytest.mark.parametrize("compute_backend", ["numbagg", None], indirect=True)
@pytest.mark.parametrize(
"func",
(
Expand Down Expand Up @@ -3760,7 +3760,7 @@ def test_differentiate_integrate(self, func, variant, dtype):
assert_units_equal(expected, actual)
assert_identical(expected, actual)

@pytest.mark.parametrize("compute_backend", ["numbagg", "None"], indirect=True)
@pytest.mark.parametrize("compute_backend", ["numbagg", None], indirect=True)
@pytest.mark.parametrize(
"variant",
(
Expand Down Expand Up @@ -3889,7 +3889,7 @@ def test_resample(self, dtype):
assert_units_equal(expected, actual)
assert_identical(expected, actual)

@pytest.mark.parametrize("compute_backend", ["numbagg", "None"], indirect=True)
@pytest.mark.parametrize("compute_backend", ["numbagg", None], indirect=True)
@pytest.mark.parametrize(
"variant",
(
Expand Down Expand Up @@ -5249,7 +5249,7 @@ def test_interp_reindex_like_indexing(self, func, unit, error, dtype):
assert_units_equal(expected, actual)
assert_equal(expected, actual)

@pytest.mark.parametrize("compute_backend", ["numbagg", "None"], indirect=True)
@pytest.mark.parametrize("compute_backend", ["numbagg", None], indirect=True)
@pytest.mark.parametrize(
"func",
(
Expand Down Expand Up @@ -5406,7 +5406,7 @@ def test_resample(self, variant, dtype):
assert_units_equal(expected, actual)
assert_equal(expected, actual)

@pytest.mark.parametrize("compute_backend", ["numbagg", "None"], indirect=True)
@pytest.mark.parametrize("compute_backend", ["numbagg", None], indirect=True)
@pytest.mark.parametrize(
"func",
(
Expand Down
2 changes: 1 addition & 1 deletion xarray/tests/test_variable.py
Original file line number Diff line number Diff line change
Expand Up @@ -1842,7 +1842,7 @@ def test_quantile_chunked_dim_error(self):
with pytest.raises(ValueError, match=r"consists of multiple chunks"):
v.quantile(0.5, dim="x")

@pytest.mark.parametrize("compute_backend", ["numbagg", "None"], indirect=True)
@pytest.mark.parametrize("compute_backend", ["numbagg", None], indirect=True)
@pytest.mark.parametrize("q", [-0.1, 1.1, [2], [0.25, 2]])
def test_quantile_out_of_bounds(self, q, compute_backend):
if compute_backend == "numbagg" and q == -0.1:
Expand Down

0 comments on commit ebfe30f

Please sign in to comment.