"docs/git@code.ornl.gov:mantidproject/mantid.git" did not exist on "ca8f7bfd180739c615d05522a6bf8e767caa0cef"
Newer
Older
import mantid.simpleapi as mantid
from Muon.GUI.ElementalAnalysis.LoadWidget import load_utils as lutils
super(LoadModel, self).__init__()
def execute(self):
if self.run not in self.loaded_runs:
self.load_run()
class CoLoadModel(lutils.LModel):
def __init__(self):
super(CoLoadModel, self).__init__()
self.workspace = None
self.co_runs = []
def wipe_co_runs(self):
self.co_runs = []
self.workspace = None
if self.run not in self.loaded_runs:
current_ws = self.load_run()
if current_ws is None:
return
self.loaded_runs[self.run] = current_ws
if self.run not in self.co_runs:
self.co_runs.append(self.run)
if self.workspace:
self.co_load_run(self.loaded_runs[self.run])
self.workspace = self.loaded_runs[self.run]
def add_runs(self, l, r, suffix):
# prevent new suffix being appended to old one
out = lutils.replace_workspace_name_suffix(l, suffix)
mantid.Plus(l, r, OutputWorkspace=out)
return out
run = lutils.hyphenise(self.co_runs)
to_add = [self.add_runs(l, r, run) for l, r in zip(*lutils.flatten_run_data(
self.workspace = lutils.group_by_detector(run, to_add)