Skip to content

Commit

Permalink
Merge remote branch 'origin/feature/8575_save_workspace_groups_sans_b…
Browse files Browse the repository at this point in the history
…atch'
  • Loading branch information
RussellTaylor committed Dec 20, 2013
2 parents e0f10f1 + 1c99e7b commit cc2e6cf
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Code/Mantid/scripts/SANS/SANSBatchMode.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#Make the reduction module available
from ISISCommandInterface import *
from mantid.simpleapi import *
from mantid.api import WorkspaceGroup
from mantid.kernel import Logger
sanslog = Logger.get("SANS")
import copy
Expand Down Expand Up @@ -217,8 +218,15 @@ def BatchReduce(filename, format, plotresults=False, saveAlgs={'SaveRKH':'txt'},
file = run['output_as']
#saving if optional and doesn't happen if the result workspace is left blank. Is this feature used?
if file:
save_names = []
for n in names:
w = mtd[n]
if isinstance(w,WorkspaceGroup):
save_names.extend(w.getNames())
else:
save_names.append(n)
for algor in saveAlgs.keys():
for workspace_name in names:
for workspace_name in save_names:
#add the file extension, important when saving different types of file so they don't over-write each other
ext = saveAlgs[algor]
if not ext.startswith('.'):
Expand Down

0 comments on commit cc2e6cf

Please sign in to comment.