def test_that_create_manage_non_child_algorithm_is_called_once_in_centre_finder_mass( self, make_algorithm_mock, load_data_mock): r_min = 5 position_1_start = 300 position_2_start = -300 tolerance = 0.001 iterations = 10 load_data_mock.return_value = { SANSDataType.SampleScatter: [mock.MagicMock()] }, { SANSDataType.SampleScatter: [mock.MagicMock()] } beam_centre_finder = "SANSBeamCentreFinderMassMethod" beam_centre_finder_options = { "RMin": r_min / 1000, "Centre1": position_1_start, "Centre2": position_2_start, "Component": 'LAB', "Tolerance": tolerance } centre_finder_mass(self.state, r_min=r_min, max_iter=iterations, position_1_start=position_1_start, position_2_start=position_2_start, tolerance=tolerance, component=DetectorType.LAB) make_algorithm_mock.assert_called_once_with( beam_centre_finder, **beam_centre_finder_options)
def test_that_create_manage_non_child_algorithm_is_called_once_in_centre_finder_mass(self, make_algorithm_mock, load_data_mock): r_min = 5 position_1_start = 300 position_2_start = -300 tolerance = 0.001 iterations = 10 load_data_mock.return_value = {SANSDataType.SampleScatter: [mock.MagicMock()]}, { SANSDataType.SampleScatter: [mock.MagicMock()]} beam_centre_finder = "SANSBeamCentreFinderMassMethod" beam_centre_finder_options = {"RMin": r_min / 1000, "Centre1": position_1_start, "Centre2": position_2_start, "Component": 'LAB', "Tolerance": tolerance} centre_finder_mass(self.state, r_min=r_min, max_iter=iterations, position_1_start=position_1_start , position_2_start=position_2_start, tolerance=tolerance, component=DetectorType.LAB) make_algorithm_mock.assert_called_once_with(beam_centre_finder, **beam_centre_finder_options)
def _execute_mass_method(state, r_min, max_iter, xstart, ystart, tolerance): # Perform the beam centre finder algorithm return centre_finder_mass(state, r_min, max_iter, xstart, ystart, tolerance)
def _execute_mass_method(state, r_min, max_iter, xstart, ystart, tolerance): # Perform the beam centre finder algorithm return centre_finder_mass(state, r_min, max_iter, xstart, ystart, tolerance)