Skip to content

Commit 619c48c

Browse files
Roman Muelleralexander-held
authored andcommitted
fix formatting
1 parent 7b6164f commit 619c48c

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

src/cabinetry/visualize/plot_model.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -145,12 +145,15 @@ def data_mc(
145145
n_zero_pred = sum(total_yield == 0.0) # number of bins with zero predicted yields
146146
if n_zero_pred > 0:
147147
log.warning(
148-
f"predicted yield is zero in {n_zero_pred} bin(s), excluded from ratio plot"
148+
f"predicted yield is zero in {n_zero_pred} bin(s),\
149+
excluded from ratio plot"
149150
)
150151
nonzero_model_yield = total_yield != 0.0
151152

152153
if np.any(total_yield < 0.0):
153-
raise ValueError(f"{label} total yield {total_yield.tolist()} has negative bin(s)")
154+
raise ValueError(
155+
f"{label} total yield {total_yield.tolist()} has negative bin(s)"
156+
)
154157

155158
# add uncertainty band around y=1
156159
rel_mc_unc = total_model_unc / total_yield
@@ -355,12 +358,16 @@ def templates(
355358

356359
if np.any(nominal_histo["yields"] < 0.0):
357360
log.warning(
358-
f"{label} nominal histo yield {nominal_histo['yields'].tolist()} has negative bin(s), taking absolute value for yerr on template ratio plot uncertainty"
361+
f"{label} nominal histo yield {nominal_histo['yields'].tolist()}\
362+
has negative bin(s), taking absolute value for yerr on\
363+
template ratio plot uncertainty"
364+
)
365+
template_ratio_plot_unc = template["stdev"] / np.abs(
366+
nominal_histo["yields"]
359367
)
360-
template_ratio_plot_unc = template["stdev"] / np.abs(nominal_histo["yields"])
361368
else:
362369
template_ratio_plot_unc = template["stdev"] / nominal_histo["yields"]
363-
370+
364371
ax2.plot(line_x, line_y, color=color, linestyle=linestyle)
365372
ax2.errorbar(
366373
bin_centers,

0 commit comments

Comments
 (0)