Skip to content

Commit c41bb4d

Browse files
pre-commit-ci[bot]kratsg
authored andcommitted
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 0b05b53 commit c41bb4d

File tree

1 file changed

+18
-22
lines changed

1 file changed

+18
-22
lines changed

src/pyhf/infer/calculators.py

+18-22
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,7 @@ def __init__(
675675
test_stat="qtilde",
676676
ntoys=2000,
677677
track_progress=True,
678-
skip_failing_toys = False,
678+
skip_failing_toys=False,
679679
):
680680
r"""
681681
Toy-based Calculator.
@@ -757,7 +757,7 @@ def distributions(self, poi_test, track_progress=None):
757757
758758
"""
759759

760-
print('skip?',self.skip_failing_toys)
760+
print('skip?', self.skip_failing_toys)
761761

762762
tensorlib, _ = get_backend()
763763
sample_shape = (self.ntoys,)
@@ -797,14 +797,14 @@ def distributions(self, poi_test, track_progress=None):
797797

798798
signal_teststat = []
799799
for sample in tqdm.tqdm(signal_sample, **tqdm_options, desc='Signal-like'):
800-
try:
800+
try:
801801
value = teststat_func(
802-
poi_test,
803-
sample,
804-
self.pdf,
805-
self.init_pars,
806-
self.par_bounds,
807-
self.fixed_params,
802+
poi_test,
803+
sample,
804+
self.pdf,
805+
self.init_pars,
806+
self.par_bounds,
807+
self.fixed_params,
808808
)
809809
except RuntimeError:
810810
if self.skip_failing_toys:
@@ -813,20 +813,18 @@ def distributions(self, poi_test, track_progress=None):
813813
raise
814814

815815
if (value is not None) and (tensorlib.isfinite(value)):
816-
signal_teststat.append(
817-
value
818-
)
816+
signal_teststat.append(value)
819817

820818
bkg_teststat = []
821819
for sample in tqdm.tqdm(bkg_sample, **tqdm_options, desc='Background-like'):
822-
try:
820+
try:
823821
value = teststat_func(
824-
poi_test,
825-
sample,
826-
self.pdf,
827-
self.init_pars,
828-
self.par_bounds,
829-
self.fixed_params,
822+
poi_test,
823+
sample,
824+
self.pdf,
825+
self.init_pars,
826+
self.par_bounds,
827+
self.fixed_params,
830828
)
831829
except RuntimeError:
832830
if self.skip_failing_toys:
@@ -835,9 +833,7 @@ def distributions(self, poi_test, track_progress=None):
835833
raise
836834

837835
if (value is not None) and (tensorlib.isfinite(value)):
838-
bkg_teststat.append(
839-
value
840-
)
836+
bkg_teststat.append(value)
841837

842838
s_plus_b = EmpiricalDistribution(tensorlib.astensor(signal_teststat))
843839
b_only = EmpiricalDistribution(tensorlib.astensor(bkg_teststat))

0 commit comments

Comments
 (0)