def test_that_cannot_change_name_when_workspace_in_ADS(self): workspace_handle = MuonWorkspaceWrapper(workspace=self.workspace) workspace_handle.show("name1") with self.assertRaises(ValueError): workspace_handle.name = "new_name"
def handleFinished(self): self.activate() self.calculation_finished_notifier.notify_subscribers(self._maxent_output_workspace_name) # if phase table is outputed if self.view.output_reconstructed_spectra and SPECTRA in self._optional_output_names.keys(): ws = MuonWorkspaceWrapper(self._optional_output_names[SPECTRA]).workspace if self.use_groups: table = MuonWorkspaceWrapper(self._optional_output_names[GROUPINGTABLE]).workspace self.new_reconstructed_data.notify_subscribers({"ws": ws.name(), "table": table.name()}) else: self.new_reconstructed_data.notify_subscribers({"ws": ws.name(), "table": None}) if self.view.output_phase_table and PHASETABLE in self._optional_output_names.keys(): name = self._optional_output_names[PHASETABLE] if self.use_groups: num_groups = self.get_num_groups self.context.frequency_context.add_group_phase_table(MuonWorkspaceWrapper(name), num_groups) else: self.context.phase_context.add_phase_table(MuonWorkspaceWrapper(name)) self.new_phase_table.notify_subscribers() self.update_phase_table_options() # clear optional outputs self._optional_output_names = {}
def test_that_can_change_name_when_workspace_not_in_ADS(self): workspace_handle = MuonWorkspaceWrapper(workspace=self.workspace) workspace_handle.name = "new_name" self.assertEqual(workspace_handle.name, "new_name")