1 | # Algorithm to start Force |
---|
2 | from mantid.api import PythonAlgorithm, AlgorithmFactory |
---|
3 | from mantid.kernel import FloatBoundedValidator, IntBoundedValidator |
---|
4 | |
---|
5 | class BoundedValidatorTestAlg(PythonAlgorithm): |
---|
6 | |
---|
7 | def category(self): |
---|
8 | return "PythonAlgorithms" |
---|
9 | |
---|
10 | def PyInit(self): |
---|
11 | self.declareProperty(name='FloatValue',defaultValue=5.0,validator=FloatBoundedValidator(1.0,10.0,True), doc='A Float Value') |
---|
12 | self.declareProperty(name='IntValue',defaultValue=2,validator=IntBoundedValidator(1,5,True), doc='An Int Value') |
---|
13 | |
---|
14 | def PyExec(self): |
---|
15 | print "This is a dummy algorithm! Did you expecting it to do something?" |
---|
16 | |
---|
17 | AlgorithmFactory.subscribe(BoundedValidatorTestAlg) # Register algorithm with Mantid |
---|