Skip to content

Commit

Permalink
added tests for other methods
Browse files Browse the repository at this point in the history
  • Loading branch information
s-scherrer committed Mar 8, 2021
1 parent 260a9f5 commit 7b1a835
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/test_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ def test_analytical_cis(testdata):
assert ub > ub10


def test_CIs():
@pytest.mark.parametrize("method", ["BCa", "basic", "percentile"])
def test_bootstrap_cis_simple(method):
np.random.seed(313)
# a test case with bias where we have analytical CIs to compare and
# convergence should work if everything is implemented correctly
Expand All @@ -95,7 +96,10 @@ def test_CIs():
assert b - lb == ub - b

# test bootstrapped CIs
bs_b, bs_lb, bs_ub = with_bootstrapped_ci(pytesmo.metrics.bias, x, y, alpha=0.1)
bs_b, bs_lb, bs_ub = with_bootstrapped_ci(
pytesmo.metrics.bias, x, y, alpha=0.1,
method=method
)
assert bs_b == b # this is the same function call
# The difference in CIs is based on experience values, and not quite as
# good as with analytical estimates
Expand Down

0 comments on commit 7b1a835

Please sign in to comment.