Ticket #2353 (closed: fixed)

Opened 10 years ago

Last modified 5 years ago

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:2 Changed 10 years ago by Peter Peterson

(In [9126]) Added some more mutators to the class to make it a bit easier to bind to python. Refs #2353.

comment:3 Changed 10 years ago by Peter Peterson

(In [9127]) Add the necessary bits for a IValidator<vector<type> > can be messed with. Refs #2353.

comment:4 Changed 10 years ago by Peter Peterson

(In [9129]) Remove compiler warning. Refs #2353.

comment:5 Changed 10 years ago by Peter Peterson

(In [9130]) Finish off python binding with nice crumb layer in MantidFramework. Refs #2353.

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.

comment:9 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 3200

Note: See TracTickets for help on using tickets.