diff --git a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/SANS/SANSLoad.py b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/SANS/SANSLoad.py index 4f6cb562e12f5346aeaa9dd4d044733e443384a2..5c84dd6e14b31dd4c8ba92eb0ca5447515436eb2 100644 --- a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/SANS/SANSLoad.py +++ b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/SANS/SANSLoad.py @@ -341,7 +341,6 @@ class SANSLoad(ParallelDataProcessorAlgorithm): else: is_trans = False move_alg.setProperty("IsTransmissionWorkspace", is_trans) - for workspace in workspace_list: zero_alg.setProperty("Workspace", workspace) zero_alg.execute() diff --git a/Testing/SystemTests/tests/analysis/SANSDiagnosticPageTest.py b/Testing/SystemTests/tests/analysis/SANSDiagnosticPageTest.py index 0d90b158bd5ba91dc8cead258b5a5130c6b00202..b8000c278be83d96d70c3fdf4351bae520ca8155 100644 --- a/Testing/SystemTests/tests/analysis/SANSDiagnosticPageTest.py +++ b/Testing/SystemTests/tests/analysis/SANSDiagnosticPageTest.py @@ -70,7 +70,8 @@ class SANSDiagnosticPageTest(unittest.TestCase): compare_alg.setChild(False) compare_alg.execute() result = compare_alg.getProperty("Result").value - self.assertTrue(result) + message = compare_alg.getProperty("Messages").value + self.assertTrue(result, message) # Remove file if os.path.exists(f_name): @@ -105,9 +106,9 @@ class SANSDiagnosticPageTest(unittest.TestCase): # Act output_workspaces = run_integral('', True, IntegralEnum.Horizontal, DetectorType.LAB, state) - + self.assertEqual(len(output_workspaces), 1) # Evaluate it up to a defined point - reference_file_name = "SANS2D_ws_diagnostic_reference.nxs" + reference_file_name = "SANS2D_ws_centred_diagnostic_reference.nxs" self._compare_workspace(output_workspaces[0], reference_file_name) def test_that_produces_correct_workspace_multiperiod_LARMOR(self): diff --git a/Testing/SystemTests/tests/analysis/SANSMaskWorkspaceTest.py b/Testing/SystemTests/tests/analysis/SANSMaskWorkspaceTest.py index 57c7047918efd9889198dbe31a3f8762872c661e..b126b38f7372c7f69919e5c6e84384e2db9c5b0b 100644 --- a/Testing/SystemTests/tests/analysis/SANSMaskWorkspaceTest.py +++ b/Testing/SystemTests/tests/analysis/SANSMaskWorkspaceTest.py @@ -86,7 +86,8 @@ class SANSMaskWorkspaceTest(unittest.TestCase): expected_spectra = list(set(expected_spectra)) masked_spectra = list(get_masked_spectrum_numbers(workspace)) - self.assertTrue(len(expected_spectra) == len(masked_spectra)) + self.assertTrue(len(expected_spectra) == len(masked_spectra), + "{} does not equal {}".format(len(expected_spectra), len(masked_spectra))) for expected, actual in zip(sorted(expected_spectra), sorted(masked_spectra)): self.assertTrue(expected == actual) @@ -95,7 +96,9 @@ class SANSMaskWorkspaceTest(unittest.TestCase): expected_spectra = list(set(expected_spectra)) non_masked_spectra = list(get_non_masked_spectrum_numbers(workspace)) - self.assertTrue(len(expected_spectra) == len(non_masked_spectra)) + + self.assertTrue(len(expected_spectra) == len(non_masked_spectra), + "Expected length {}, got length {}".format(len(expected_spectra), len(non_masked_spectra))) for expected, actual in zip(sorted(expected_spectra), sorted(non_masked_spectra)): self.assertTrue(expected == actual) diff --git a/Testing/SystemTests/tests/analysis/reference/SANS2D_ws_centred_diagnostic_reference.nxs.md5 b/Testing/SystemTests/tests/analysis/reference/SANS2D_ws_centred_diagnostic_reference.nxs.md5 new file mode 100644 index 0000000000000000000000000000000000000000..a37abbfabc11ce83d31b5a68681b7f5c13b96dee --- /dev/null +++ b/Testing/SystemTests/tests/analysis/reference/SANS2D_ws_centred_diagnostic_reference.nxs.md5 @@ -0,0 +1 @@ +bebc77b6ba8d3256f154a7224d213295 diff --git a/scripts/SANS/sans/algorithm_detail/move_workspaces.py b/scripts/SANS/sans/algorithm_detail/move_workspaces.py index 8e053425581e4e50efee224d286df20903453894..007e2ddd6b2b7242a6ece1a663c76b4530cb4eb0 100644 --- a/scripts/SANS/sans/algorithm_detail/move_workspaces.py +++ b/scripts/SANS/sans/algorithm_detail/move_workspaces.py @@ -523,7 +523,7 @@ class SANSMoveLOQ(SANSMove): super(SANSMoveLOQ, self).__init__() def do_move_initial(self, move_info, workspace, coordinates, component, is_transmission_workspace): - # For LOQ we only have to coordinates + # For LOQ we only have two coordinates assert len(coordinates) == 2 if not is_transmission_workspace: # First move the sample holder diff --git a/scripts/SANS/sans/common/general_functions.py b/scripts/SANS/sans/common/general_functions.py index 4e3e0713c4e970bae509a73aed7e1918b09ce807..8c75e8d1ce900887c908d92b23bebe7f470e8a44 100644 --- a/scripts/SANS/sans/common/general_functions.py +++ b/scripts/SANS/sans/common/general_functions.py @@ -292,10 +292,8 @@ def convert_bank_name_to_detector_type_isis(detector_name): """ detector_name = detector_name.upper() detector_name = detector_name.strip() - print("name: ", detector_name) if detector_name == "REAR-DETECTOR" or detector_name == "MAIN-DETECTOR-BANK" or detector_name == "DETECTORBENCH" \ or detector_name == "REAR" or detector_name == "MAIN": - print("IN LAB!") detector_type = DetectorType.LAB elif detector_name == "FRONT-DETECTOR" or detector_name == "HAB" or detector_name == "FRONT": detector_type = DetectorType.HAB diff --git a/scripts/SANS/sans/gui_logic/presenter/masking_table_presenter.py b/scripts/SANS/sans/gui_logic/presenter/masking_table_presenter.py index c63e778f6162c1a532cc5f26f23cfbd5378ddc83..6a4182b661f08c1baefbcf098f52c29fd31b9aad 100644 --- a/scripts/SANS/sans/gui_logic/presenter/masking_table_presenter.py +++ b/scripts/SANS/sans/gui_logic/presenter/masking_table_presenter.py @@ -85,6 +85,15 @@ def perform_load(serialized_state): def perform_move(state, workspace): serialized_state = state.property_manager move_name = "SANSMove" + + zero_options = {"SANSState": serialized_state, + "Workspace": workspace, + "MoveType": "SetToZero", + "Component": ""} + zero_alg = create_unmanaged_algorithm(move_name, **zero_options) + zero_alg.execute() + workspace = zero_alg.getProperty("Workspace").value + move_options = {"SANSState": serialized_state, "Workspace": workspace, "MoveType": "InitialMove"}