Skip to content

Commit

Permalink
add test with as_dict=True
Browse files Browse the repository at this point in the history
  • Loading branch information
marinang committed May 20, 2020
1 parent c1c22af commit d0fc1ca
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/test_fitresult.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,13 +154,14 @@ def test_correlation(minimizer_class_and_kwargs):

cor_mat = result.correlation(params=[a, b, c])
cov_mat = result.covariance(params=[a, b, c])
cor_dict = result.correlation(params=[a, b], as_dict=True)

np.testing.assert_allclose(np.diag(cor_mat), 1.0)

a_error = hesse[a]['error']
b_error = hesse[b]['error']
assert pytest.approx(cor_mat[0, 1], rel=0.01) == cov_mat[0, 1]/(a_error * b_error)

assert pytest.approx(cor_dict[(a, b)], rel=0.01) == cov_mat[0, 1]/(a_error * b_error)

@pytest.mark.parametrize("minimizer_class_and_kwargs", minimizers)
def test_errors(minimizer_class_and_kwargs):
Expand Down

0 comments on commit d0fc1ca

Please sign in to comment.