Ticket #2353 (closed: fixed)
ArrayBoundedValidator in python
| Reported by: | Peter Peterson | Owned by: | Peter Peterson |
|---|---|---|---|
| Priority: | major | Milestone: | Iteration 27 |
| Component: | Mantid | Keywords: | |
| Cc: | Blocked By: | ||
| Blocking: | Tester: | Martyn Gigg |
Description
It is useful to have this validator in python.
Change History
comment:1 Changed 10 years ago by Peter Peterson
- Status changed from new to accepted
- Owner set to Peter Peterson
comment:6 Changed 10 years ago by Peter Peterson
- Status changed from accepted to verify
- Resolution set to fixed
The last commit fixed this.
comment:7 Changed 10 years ago by Martyn Gigg
- Status changed from verify to verifying
- Tester set to Martyn Gigg
comment:8 Changed 10 years ago by Martyn Gigg
- Status changed from verifying to closed
Tested in 1.1.9520
Confirmed with script
class ValidatorTest(PythonAlgorithm):
def PyInit(self):
self.declareListProperty("TestArray",[1.0],ArrayBoundedValidator(1.0,5.0))
def PyExec(self):
input_list = self.getProperty("TestArray")
mtd.sendLogMessage("Property type %s" % str(type(input_list)))
mtd.sendLogMessage("Allowed array %s" % str(input_list))
mtd.registerPyAlgorithm(ValidatorTest())
Clicking on the algorithm in the GUI and then putting invalid values results in a validation error as expected.
Note: See
TracTickets for help on using
tickets.
