| 1 | from mantid.api import PythonAlgorithm, AlgorithmFactory | 
|---|
| 2 | from mantid.kernel import FloatArrayProperty, StringArrayProperty, StringArrayMandatoryValidator, Direction | 
|---|
| 3 |  | 
|---|
| 4 | from pdb import set_trace as tr | 
|---|
| 5 |  | 
|---|
| 6 | class TestSetPropertyGroup(PythonAlgorithm): | 
|---|
| 7 |  | 
|---|
| 8 |   def category(self): | 
|---|
| 9 |     return "Test" | 
|---|
| 10 |  | 
|---|
| 11 |   def name(self): | 
|---|
| 12 |     return 'TestSetPropertyGroup' | 
|---|
| 13 |  | 
|---|
| 14 |   def PyInit(self): | 
|---|
| 15 |     self.declareProperty(FloatArrayProperty('Property0', values=[], direction=Direction.Input), doc='this is Property0') | 
|---|
| 16 |     arrvalidator = StringArrayMandatoryValidator() | 
|---|
| 17 |     self.declareProperty(StringArrayProperty('Property1', values=[], validator=arrvalidator, direction=Direction.Input), doc='this is Property1') | 
|---|
| 18 |     self.declareProperty(FloatArrayProperty('Property2', values=[], direction=Direction.Input), doc='this is Property2') | 
|---|
| 19 |  | 
|---|
| 20 |     self.setPropertyGroup('Property1','This is a group') | 
|---|
| 21 |     self.setPropertyGroup('Property2','This is a group') | 
|---|
| 22 |  | 
|---|
| 23 |     self.declareProperty(FloatArrayProperty('Property3', values=[], direction=Direction.Input), doc='this is Property3') | 
|---|
| 24 |  | 
|---|
| 25 |   def PyExec(self): | 
|---|
| 26 |     pass | 
|---|
| 27 |  | 
|---|
| 28 | AlgorithmFactory.subscribe(TestSetPropertyGroup) | 
|---|