def test_that_get_group_pair_name_and_run_works_for_fit_workspace_names_containing_original_worspace(self): group_1 = MuonGroup('group_1', [1, 3, 5, 7, 9]) group_2 = MuonGroup('group_2', [1, 3, 4, 7, 9]) group_3 = MuonGroup('group_3', [1, 3, 4, 7, 9]) self.context.add_group(group_1) self.context.add_group(group_2) self.context.add_group(group_3) group_1.update_workspaces([62260, 62261], 'group_1_counts', 'group_1_asym', 'group_1_asym_unorm', False) workspace_name_list = self.context.get_group_workspace_names(runs = [[62260, 62261]], groups=['group_1'], rebin=False) group_name, run = self.context.get_group_pair_name_and_run_from_workspace_name(workspace_name_list[0] + '; Fit Seq Flatbackground') self.assertEqual(group_name, 'group_1') self.assertEqual(run, '62260-62261')
def create_group_populated_by_two_binned_and_two_unbinned_workspaces(): group = MuonGroup(group_name="group1") counts_workspace_22222 = CreateWorkspace([0], [0]) asymmetry_workspace_22222 = CreateWorkspace([0], [0]) asymmetry_workspace_unnorm_22222 = CreateWorkspace([0], [0]) group.update_workspaces([22222], counts_workspace_22222, asymmetry_workspace_22222, asymmetry_workspace_unnorm_22222 , False) group.show_raw([22222], 'counts_name_22222', 'asymmetry_name_22222', 'asymmetry_name_22222_unnorm') counts_workspace_33333 = CreateWorkspace([0], [0]) asymmetry_workspace_33333 = CreateWorkspace([0], [0]) asymmetry_workspace_unnorm_33333 = CreateWorkspace([0], [0]) group.update_workspaces([33333], counts_workspace_33333, asymmetry_workspace_33333, asymmetry_workspace_unnorm_33333, False) group.show_raw([33333], 'counts_name_33333', 'asymmetry_name_33333', 'asymmetry_name_33333_unnorm') counts_workspace_22222 = CreateWorkspace([0], [0]) asymmetry_workspace_22222 = CreateWorkspace([0], [0]) asymmetry_workspace_unnorm_22222 = CreateWorkspace([0], [0]) group.update_workspaces([22222], counts_workspace_22222, asymmetry_workspace_22222, asymmetry_workspace_unnorm_22222, True) group.show_rebin([22222], 'counts_name_22222_rebin', 'asymmetry_name_22222_rebin', 'asymmetry_name_22222_unnorm') counts_workspace_33333 = CreateWorkspace([0], [0]) asymmetry_workspace_33333 = CreateWorkspace([0], [0]) asymmetry_workspace_unnorm_33333 = CreateWorkspace([0], [0]) group.update_workspaces([33333], counts_workspace_33333, asymmetry_workspace_33333, asymmetry_workspace_unnorm_33333, True) group.show_rebin([33333], 'counts_name_33333_rebin', 'asymmetry_name_33333_rebin', 'asymmetry_name_22222_unnorm') return group
def test_get_group_pair_name_and_run_works_for_co_added_runs(self): group_1 = MuonGroup('group_1', [1, 3, 5, 7, 9]) group_2 = MuonGroup('group_2', [1, 3, 4, 7, 9]) group_3 = MuonGroup('group_3', [1, 3, 4, 7, 9]) self.context.add_group(group_1) self.context.add_group(group_2) self.context.add_group(group_3) group_1.update_workspaces([62260, 62261], 'group_1_counts', 'group_1_asym', 'group_1_asym_unorm', False) workspace_name_list = self.context.get_group_workspace_names(runs = [[62260, 62261]], groups=['group_1'], rebin=False) group_name, run = self.context.get_group_pair_name_and_run_from_workspace_name(workspace_name_list[0]) self.assertEqual(group_name, 'group_1') self.assertEqual(run, '62260-62261')
def create_group_populated_by_two_workspace(): group = MuonGroup(group_name="group1") counts_workspace_22222 = CreateWorkspace([0], [0]) asymmetry_workspace_22222 = CreateWorkspace([0], [0]) group.update_workspaces([22222], counts_workspace_22222, asymmetry_workspace_22222, False) group.show_raw([22222], 'counts_name_22222', 'asymmetry_name_22222') counts_workspace_33333 = CreateWorkspace([0], [0]) asymmetry_workspace_33333 = CreateWorkspace([0], [0]) group.update_workspaces([33333], counts_workspace_33333, asymmetry_workspace_33333, False) group.show_raw([33333], 'counts_name_33333', 'asymmetry_name_33333') return group