Skip to content

Commit

Permalink
isort
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewfeickert committed Sep 9, 2022
1 parent a57871b commit 98fbf98
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/pyhf/infer/intervals.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
"""Interval estimation"""
from pyhf.infer import hypotest
from pyhf import get_backend
from warnings import warn

import numpy as np
from scipy.optimize import toms748 as _toms748
from warnings import warn as _warn
from scipy.optimize import toms748

from pyhf import get_backend
from pyhf.infer import hypotest

__all__ = ["upperlimit"]

Expand Down Expand Up @@ -74,7 +76,7 @@ def upperlimit_auto(
- Tensor: The expected upper limits on the POI.
"""
if rtol is None:
_warn(
warn(
"upperlimit_auto: rtol not provided, defaulting to 1e-15. "
"For optimal performance rtol should be set to the highest acceptable relative tolerance."
)
Expand Down Expand Up @@ -130,9 +132,9 @@ def best_bracket(limit):
high_res = f_all(high)

tb, _ = get_backend()
obs = tb.astensor(_toms748(f, low, high, args=(0), k=2, xtol=atol, rtol=rtol))
obs = tb.astensor(toms748(f, low, high, args=(0), k=2, xtol=atol, rtol=rtol))
exp = [
tb.astensor(_toms748(f, *best_bracket(i), args=(i), k=2, xtol=atol, rtol=rtol))
tb.astensor(toms748(f, *best_bracket(i), args=(i), k=2, xtol=atol, rtol=rtol))
for i in range(1, 6)
]
if from_upperlimit_fn:
Expand Down

0 comments on commit 98fbf98

Please sign in to comment.