Newer
Older
from MantidFramework import *
from mantidsimple import *
class ExampleRedStep(PythonAlgorithm):
def name(self):
return "ExampleRedStep"
def PyInit(self):
self.declareWorkspaceProperty("InputWorkspace", "", Direction.Input)
self.declareProperty("OutputWorkspace", "")
self.declareAlgorithmProperty("Algorithm")
def PyExec(self):
input_ws = self.getProperty("InputWorkspace")
output_ws = self.getProperty("OutputWorkspace")
alg = self.getProperty("Algorithm")
alg.setPropertyValue("InputWorkspace", str(input_ws))
alg.setPropertyValue("OutputWorkspace", output_ws)
alg.execute()
#mtd.registerPyAlgorithm(ExampleRedStep())
Doucet, Mathieu
committed
class ExampleLoader(PythonAlgorithm):
def name(self):
return "ExampleLoader"
def PyInit(self):
self.declareProperty("Filename", "")
Doucet, Mathieu
committed
self.declareProperty("OutputWorkspace", "")
def PyExec(self):
filename = self.getProperty("Filename")
Doucet, Mathieu
committed
output_ws = self.getProperty("OutputWorkspace")
Doucet, Mathieu
committed
print filename, output_ws