Skip to content

Commit

Permalink
Re #7828 Add event workspace check
Browse files Browse the repository at this point in the history
  • Loading branch information
mdoucet committed Aug 28, 2013
1 parent 0743648 commit 0ea89b1
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ def _load_data(self, filename, output_ws, property_manager, property_manager_nam
p = property_manager.getProperty('LoadAlgorithm')
alg = Algorithm.fromString(p.valueAsStr)

if AnalysisDataService.doesExist(filename):
if AnalysisDataService.doesExist(filename) \
and AnalysisDataService.retrieve(filename).__class__.__name__.find('EventWorkspace')>=0 \
and not AnalysisDataService.retrieve(filename).getRun().hasProperty("event_ws") \
and not AnalysisDataService.retrieve(filename).getRun().hasProperty("sample_detector_distance"):
alg.setProperty("InputWorkspace", filename)
else:
alg.setProperty('Filename', filename)
Expand Down Expand Up @@ -400,8 +403,8 @@ def _save_output(self, iq_output, iqxy_output, output_dir, property_manager):
if os.path.isfile(process_file):
proc = open(process_file, 'r')
proc_xml = proc.read()
elif len(process_file)>0:
Logger.get("SANSReduction").error("Could not read %s\n" % process_file)
elif len(process_file)>0 and process_file.lower().find("none") != 0:
Logger.get("SANSReduction").error("Could not read process info file %s\n" % process_file)

filename = os.path.join(output_dir, iq_output+'.txt')

Expand Down

0 comments on commit 0ea89b1

Please sign in to comment.