Skip to content

Commit

Permalink
merge (#408)
Browse files Browse the repository at this point in the history
* Update utils.py

* Update test_probabilistic.py

* Update test_resampling.py

* Update contingency.py
  • Loading branch information
aaronspring committed Oct 29, 2023
1 parent 95a08b7 commit c4b4246
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion xskillscore/core/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ def _helper_bool_to_int(da):

def _check_identical_xr_types(a, b):
"""Check that a and b are both xr.Dataset or both xr.DataArray."""
if type(a) != type(b):
if not isinstance(a, type(b)):
raise ValueError(f"a and b must be same type, found {type(a)} and {type(b)}")
for d in [a, b]:
if not isinstance(d, (xr.Dataset, xr.DataArray)):
Expand Down
2 changes: 1 addition & 1 deletion xskillscore/tests/test_probabilistic.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def assert_keep_attrs(actual, o, keep_attrs):


def assign_type_input_output(actual, o):
assert type(o) == type(actual)
assert isinstance(o, type(actual))


@pytest.mark.parametrize("chunk_bool", [True, False])
Expand Down
2 changes: 1 addition & 1 deletion xskillscore/tests/test_resampling.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def test_resample_inputs(a_1d, func, input, chunk, replace):
# check dask collection preserved
assert is_dask_collection(actual) if chunk else not is_dask_collection(actual)
# input type preserved
assert type(actual) == type(a_1d)
assert isinstance(a_1d, type(actual))


@pytest.mark.parametrize("func", resample_iterations_funcs)
Expand Down

0 comments on commit c4b4246

Please sign in to comment.