\(\renewcommand\AA{\unicode{x212B}}\)
As with the basic types (int, float, etc.) there are some special validators for checking input workspaces.
Those currently available are:
WorkspaceUnitValidator("UnitName")
HistogramValidator(True/False)
CommonBinsValidator()
RawCountsValidator(True/False)
InstrumentValidator()
To use a specific one pass the created validator as the validator argument
of the declareProperty
function, e.g.
def PyInit(self):
# Requires the input workspace to have x-axis units of Wavelength
self.declareProperty(WorkspaceProperty(name="InputWorkspace",
defaultValue="",
direction=Direction.Input,
validator=WorkspaceUnitValidator("Wavelength")))