Ejemplo n.º 1
0
    def test_get_group_pair_name_and_run_from_workspace_name(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_counts_workspace(MuonRun([62260]), 'group_1_counts',
                                        False)
        group_1.update_asymmetry_workspace(MuonRun([62260]), 'group_1_asym',
                                           'group_1_asym_unorm', False)
        workspace_name_list = self.context.get_group_workspace_names(
            runs=[[62260]], 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')
Ejemplo n.º 2
0
    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_counts_workspace(MuonRun([62260, 62261]),
                                        'group_1_counts', False)
        group_1.update_asymmetry_workspace(MuonRun([62260,
                                                    62261]), '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')