Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
wcxve committed Nov 20, 2024
1 parent 8801f91 commit 8d1f3d8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/elisa/infer/results.py
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,7 @@ def ci(
else:
rtol = jax.tree.map(float, dict(rtol))
for k in rtol_keys:
rtol.set_default[k] = 1e-3
rtol.setdefault(k, 1e-3)
if np.any([i > 0.1 for i in rtol.values()]):
raise ValueError('rtol must be less than 0.1')

Expand Down
2 changes: 2 additions & 0 deletions tests/test_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,12 @@ def test_mle_ci_fn(mle_result2, powerlaw_flux):
params['PowerLaw.alpha'], params['PowerLaw.K'], emin, emax
)

ci0 = result.ci(params=[], fn={'fn': fn}, rtol={'fn': 5e-4})
ci1 = result.ci(params=[], fn={'fn': fn})
ci2 = result.ci(params=[], fn={'fn': fn}, method='boot')
ci3 = result.ci(params=[], fn={'fn': fn}, method='boot', parallel=False)
assert np.allclose(ci1.mle['fn'], fn_mle)
assert np.allclose(ci1.errors['fn'], ci0.errors['fn'])
assert np.allclose(ci1.errors['fn'], ci2.errors['fn'], rtol=5e-2, atol=0.0)
assert np.allclose(ci2.errors['fn'], ci3.errors['fn'])

Expand Down

0 comments on commit 8d1f3d8

Please sign in to comment.