Commit a57ad867 authored by Yuanpeng Zhang's avatar Yuanpeng Zhang
Browse files

change the way of coping with container not found error

parent e131618d
......@@ -538,14 +538,6 @@ def create_absorption_input( # noqa: C901
# Make sure one is set before calling SetSample
if material or geometry or environment:
if environment:
mantid.simpleapi.SetSampleFromLogs(InputWorkspace=absName,
Material=material,
Geometry=geometry,
Environment=environment)
else:
mantid.simpleapi.SetSample(InputWorkspace=absName,
Material=material,
Geometry=geometry)
mantid.simpleapi.SetSampleFromLogs(InputWorkspace=absName, Material=material, Geometry=geometry, Environment=environment)
return absName
......@@ -166,13 +166,18 @@ class SetSampleFromLogs(DistributedDataProcessorAlgorithm):
environment = self._createEnvironment(runObject, instrEnum)
# let SetSample generate errors if anything is wrong
SetSample(InputWorkspace=wksp,
Material=material,
Geometry=geometry,
Environment=environment,
ContainerGeometry=geometryContainer,
ContainerMaterial=materialContainer)
try:
SetSample(InputWorkspace=wksp,
Material=material,
Geometry=geometry,
Environment=environment,
ContainerGeometry=geometryContainer,
ContainerMaterial=materialContainer)
except Exception as inst:
self.log().warning(inst.args[0])
SetSample(InputWorkspace=wksp,
Material=material,
Geometry=geometry)
# Register algorithm with Mantid.
AlgorithmFactory.subscribe(SetSampleFromLogs)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment