Skip to content

Commit 0252dee

Browse files
fix: validate post-processed histograms (#565)
* fix histogram validation in post-processing to run over final histogram instead of original
1 parent fcbc49e commit 0252dee

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/cabinetry/templates/postprocessor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ def process_template(
178178
smoothing_algorithm=smoothing_algorithm,
179179
nominal_histogram=nominal_histogram,
180180
)
181-
histogram.validate(histogram_name)
181+
new_histogram.validate(histogram_name)
182182
new_histo_path = histogram_folder / (histogram_name + "_modified")
183183
new_histogram.save(new_histo_path)
184184

tests/templates/test_templates_postprocessor.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,10 @@ def test__postprocessor(mock_name):
169169
)
170170
] # postprocessing was executed
171171

172+
assert mock_new_histogram.validate.call_args_list == [
173+
(("histo_name",), {})
174+
] # new histogram was validated
175+
172176
assert mock_new_histogram.save.call_args_list == [
173177
((pathlib.Path("path/histo_name_modified"),), {})
174178
] # new histogram was saved (meaning right name was obtained)

0 commit comments

Comments
 (0)