Ticket #7805: DummyAlg.py

File DummyAlg.py, 696 bytes (added by Samuel Jackson, 7 years ago)

Python script that could be useful for testing.

Line 
1# Algorithm to start Force
2from mantid.api import PythonAlgorithm, AlgorithmFactory
3from mantid.kernel import FloatBoundedValidator, IntBoundedValidator
4
5class 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
17AlgorithmFactory.subscribe(BoundedValidatorTestAlg) # Register algorithm with Mantid