Skip to content

Commit e589871

Browse files
pre-commit-ci[bot]matthewfeickert
authored andcommitted
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 3453040 commit e589871

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
@@ -674,7 +674,7 @@ def __init__(
674674
test_stat="qtilde",
675675
ntoys=2000,
676676
track_progress=True,
677-
skip_failing_toys = False,
677+
skip_failing_toys=False,
678678
):
679679
r"""
680680
Toy-based Calculator.
@@ -756,7 +756,7 @@ def distributions(self, poi_test, track_progress=None):
756756
757757
"""
758758

759-
print('skip?',self.skip_failing_toys)
759+
print('skip?', self.skip_failing_toys)
760760

761761
tensorlib, _ = get_backend()
762762
sample_shape = (self.ntoys,)
@@ -796,14 +796,14 @@ def distributions(self, poi_test, track_progress=None):
796796

797797
signal_teststat = []
798798
for sample in tqdm.tqdm(signal_sample, **tqdm_options, desc='Signal-like'):
799-
try:
799+
try:
800800
value = teststat_func(
801-
poi_test,
802-
sample,
803-
self.pdf,
804-
self.init_pars,
805-
self.par_bounds,
806-
self.fixed_params,
801+
poi_test,
802+
sample,
803+
self.pdf,
804+
self.init_pars,
805+
self.par_bounds,
806+
self.fixed_params,
807807
)
808808
except RuntimeError:
809809
if self.skip_failing_toys:
@@ -812,20 +812,18 @@ def distributions(self, poi_test, track_progress=None):
812812
raise
813813

814814
if (value is not None) and (tensorlib.isfinite(value)):
815-
signal_teststat.append(
816-
value
817-
)
815+
signal_teststat.append(value)
818816

819817
bkg_teststat = []
820818
for sample in tqdm.tqdm(bkg_sample, **tqdm_options, desc='Background-like'):
821-
try:
819+
try:
822820
value = teststat_func(
823-
poi_test,
824-
sample,
825-
self.pdf,
826-
self.init_pars,
827-
self.par_bounds,
828-
self.fixed_params,
821+
poi_test,
822+
sample,
823+
self.pdf,
824+
self.init_pars,
825+
self.par_bounds,
826+
self.fixed_params,
829827
)
830828
except RuntimeError:
831829
if self.skip_failing_toys:
@@ -834,9 +832,7 @@ def distributions(self, poi_test, track_progress=None):
834832
raise
835833

836834
if (value is not None) and (tensorlib.isfinite(value)):
837-
bkg_teststat.append(
838-
value
839-
)
835+
bkg_teststat.append(value)
840836

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

0 commit comments

Comments
 (0)