Commit 885395d3 authored by payno's avatar payno Committed by Henri Payno
Browse files

normalization: fix test since calculation area and method have been removed.

parent a90a9f1c
......@@ -74,43 +74,29 @@ class TestNormalization(unittest.TestCase):
process_params.method = Method.SUBTRACTION
process_params.source = params._ValueSource.MANUAL_ROI
expected_results = {
"mean": {
"scalar": 5800.5,
"one value per fame": numpy.array([800.5, 10800.5]),
},
"median": {
"scalar": 5800.5,
"one value per fame": numpy.array([800.5, 10800.5]),
},
"mean": numpy.array([800.5, 10800.5]),
"median": numpy.array([800.5, 10800.5]),
}
for calc_fct in params._ValueCalculationFct.values():
for calc_method in params._ValueCalculationMethod.values():
with self.subTest(calc_method=calc_method, calc_fct=calc_fct):
process_params.extra_infos = {
"start_x": 0,
"end_x": 2,
"start_y": 8,
"end_y": 9,
"calc_fct": calc_fct,
"calc_method": calc_method,
"calc_area": "volume",
with self.subTest(calc_fct=calc_fct):
process_params.extra_infos = {
"start_x": 0,
"end_x": 2,
"start_y": 8,
"end_y": 9,
"calc_fct": calc_fct,
"calc_area": "volume",
}
process = normalization.IntensityNormalizationTask(
inputs={
"data": self.scan,
"configuration": process_params,
}
process = normalization.IntensityNormalizationTask(
inputs={
"data": self.scan,
"configuration": process_params,
}
)
process.run()
res = self.scan.intensity_normalization.get_extra_infos().get(
"value"
)
if isinstance(res, numpy.ndarray):
numpy.testing.assert_array_equal(
res, expected_results[calc_fct][calc_method]
)
else:
numpy.testing.assert_array_equal(
res, expected_results[calc_fct][calc_method]
)
)
process.run()
res = self.scan.intensity_normalization.get_extra_infos().get("value")
if isinstance(res, numpy.ndarray):
numpy.testing.assert_array_equal(res, expected_results[calc_fct])
else:
numpy.testing.assert_array_equal(res, expected_results[calc_fct])
......@@ -95,9 +95,7 @@ class TestNormIntensityWindow(TestCaseQt):
assert "end_x" in output_configuration
assert "start_y" in output_configuration
assert "end_y" in output_configuration
assert "calc_area" in output_configuration
assert "calc_fct" in output_configuration
assert "calc_method" in output_configuration
self._widget.setCurrentMethod(NormalizationMethod.DIVISION)
self.qapp.processEvents()
self._widget.setCurrentSource(NormalizationSource.DATASET)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment