def get_group_workspace(self, group_name, run): """ Return the workspace associated to group_name, creating one if it doesn't already exist (e.g. if group added to table but no update yet triggered). """ try: workspace = self._groups_and_pairs[group_name].workspace[MuonRun(run)].workspace except AttributeError: workspace = self._context.calculate_group(group_name, run, rebin=False) self._groups_and_pairs[group_name].update_counts_workspace(workspace, MuonRun(run)) return workspace
def get_asymmetry_workspace_names_rebinned(self, runs): workspace_list = [] for run in runs: run_object = MuonRun(run) if run_object in self.workspace_rebin and self.workspace_rebin[run_object].workspace_name: workspace_list.append(self.workspace_rebin[run_object].workspace_name) return workspace_list
def test_get_asymmetry_workspace_names_returns_nothing_if_workspace_is_hidden( self): group = create_group_populated_by_two_workspace() group._asymmetry_estimate[MuonRun([22222])].hide() workspace_list = group.get_asymmetry_workspace_names([[22222]]) self.assertEqual(workspace_list, [])
def update_asymmetry_workspace(self, asymmetry_workspace, run, rebin=False): run_object = MuonRun(run) if not rebin: self._workspace.update({run_object: MuonWorkspaceWrapper(asymmetry_workspace)}) else: self.workspace_rebin.update({run_object: MuonWorkspaceWrapper(asymmetry_workspace)})
def show_rebin(self, run, name): run_object = MuonRun(run) run_object not in self.workspace_rebin or self.workspace_rebin[run_object].show(name)
def show_raw(self, run, name): run_object = MuonRun(run) run_object not in self._workspace or self._workspace[run_object].show(name)