Skip to content

Commit

Permalink
reduce skipped tests (#704)
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronspring authored Dec 6, 2021
1 parent 784548e commit ebf40e2
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 38 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ What's New
==========



climpred unreleased (202x-xx-xx)
================================

Expand Down
38 changes: 0 additions & 38 deletions climpred/tests/test_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,44 +110,6 @@ def test_pm_metric_skipna(PM_da_initialized_3d, PM_da_control_3d, metric):
assert not skipping.isel(lead=2, x=5, y=5).isnull()


@pytest.mark.skip(reason="comparisons dont work here")
@pytest.mark.parametrize("metric", ("rmse", "mse"))
@pytest.mark.parametrize("comparison", ["m2e", "m2m"])
def test_pm_metric_weights_m2x(
PM_da_initialized_3d, PM_da_control_3d, comparison, metric
):
"""Test init weights in compute_perfect_model."""
# distribute weights on initializations
dim = "init"
base = compute_perfect_model(
PM_da_initialized_3d,
PM_da_control_3d,
dim=dim,
metric=metric,
comparison=comparison,
)
weights = xr.DataArray(np.arange(1, 1 + PM_da_initialized_3d[dim].size), dims=dim)
weights = xr.DataArray(
np.arange(
1,
1 + PM_da_initialized_3d[dim].size * PM_da_initialized_3d["member"].size,
),
dims="init",
)

weighted = compute_perfect_model(
PM_da_initialized_3d,
PM_da_control_3d,
dim=dim,
comparison=comparison,
metric=metric,
weights=weights,
)
print((base / weighted).mean(["x", "y"]))
# test for difference
assert (xs.smape(base, weighted, ["x", "y"]) > 0.01).any()


@pytest.mark.parametrize("metric", ("rmse", "mse"))
def test_hindcast_metric_skipna(hind_da_initialized_3d, reconstruction_da_3d, metric):
"""Test skipna argument in hindcast_metric."""
Expand Down

0 comments on commit ebf40e2

Please sign in to comment.