Skip to content

Commit

Permalink
print out when toys fail
Browse files Browse the repository at this point in the history
  • Loading branch information
kratsg committed Jul 5, 2024
1 parent c41bb4d commit 89a5e54
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/pyhf/infer/calculators.py
Original file line number Diff line number Diff line change
Expand Up @@ -806,9 +806,10 @@ def distributions(self, poi_test, track_progress=None):
self.par_bounds,
self.fixed_params,
)
except RuntimeError:
except:

Check notice on line 809 in src/pyhf/infer/calculators.py

View check run for this annotation

codefactor.io / CodeFactor

src/pyhf/infer/calculators.py#L809

Do not use bare 'except'. (E722)
if self.skip_failing_toys:
value = None
print(f'signal failed for: {sample}')
else:
raise

Expand All @@ -826,9 +827,10 @@ def distributions(self, poi_test, track_progress=None):
self.par_bounds,
self.fixed_params,
)
except RuntimeError:
except:

Check notice on line 830 in src/pyhf/infer/calculators.py

View check run for this annotation

codefactor.io / CodeFactor

src/pyhf/infer/calculators.py#L830

Do not use bare 'except'. (E722)
if self.skip_failing_toys:
value = None
print(f'background failed for: {sample}')
else:
raise

Expand Down

0 comments on commit 89a5e54

Please sign in to comment.