Skip to content

Commit

Permalink
Re #10958 Fixed output workspace name
Browse files Browse the repository at this point in the history
  • Loading branch information
abuts committed Jan 26, 2015
1 parent e0e2f49 commit eabee4d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
15 changes: 13 additions & 2 deletions Code/Mantid/scripts/Inelastic/Direct/ReductionWrapper.py
@@ -1,5 +1,6 @@
from mantid.simpleapi import *
from mantid import config
from mantid.kernel import funcreturns

from PropertyManager import PropertyManager
# this import is used by children
Expand Down Expand Up @@ -166,7 +167,6 @@ def reduce(self,input_file=None,output_directory=None):
Wrap it into @iliad wrapper to switch input for
reduction properties between script and web variables
"""

if input_file:
self.reducer.sample_run = input_file

Expand Down Expand Up @@ -227,6 +227,12 @@ def iliad(reduce):
"""
def iliad_wrapper(*args):
#seq = inspect.stack()
# output workspace name.
try:
n,r = funcreturns.lhs_info('both')
out_ws_name = r[0]
except:
out_ws_name = None

host = args[0]
if len(args)>1:
Expand Down Expand Up @@ -255,11 +261,16 @@ def iliad_wrapper(*args):
else:
pass # we should set already set up variables using


rez = reduce(*args)

# prohibit returning workspace to web services.
if host._run_from_web and not isinstance(rez,str):
rez=""
else:
if out_ws_name and rez.name() != out_ws_name :
rez=RenameWorkspace(InputWorkspace=rez,OutputWorkspace=out_ws_name)

return rez

return iliad_wrapper
Expand Down
2 changes: 1 addition & 1 deletion Code/Mantid/scripts/Inelastic/Direct/RunDescriptor.py
Expand Up @@ -212,7 +212,7 @@ def file_hint(self,run_num_str,filePath=None,fileExt=None,**kwargs):
inst_name = RunDescriptor._holder.short_inst_name
if 'file_hint' in kwargs:
hint = kwargs['file_hint']
fname,old_ext=os.path.splitext(file_hint)
fname,old_ext=os.path.splitext(hint)
if len(old_ext) == 0:
old_ext = self.get_file_ext()
else:
Expand Down

0 comments on commit eabee4d

Please sign in to comment.