def PyInit(self): only_positive = IntBoundedValidator() only_positive.setLower(0) self.declareProperty('NumPropWithDefaultDir', -1, only_positive) self.declareProperty('NumPropWithInOutDir', -1, only_positive, "doc string", Direction.InOut)
def PyInit(self): instruments = ['BSS', 'SNAP', 'REF_M', 'CNCS', 'EQSANS', 'VULCAN', 'VENUS', 'MANDI', 'TOPAZ', 'ARCS'] self.declareProperty('Instrument', '', StringListValidator(instruments), 'Empty uses default instrument') runValidator = IntBoundedValidator() runValidator.setLower(1) self.declareProperty('RunNumber', Property.EMPTY_INT, runValidator, doc='Live run number to use (Optional, Default=most recent)') self.declareProperty(WorkspaceProperty('OutputWorkspace', '', direction=Direction.Output)) self.declareProperty('NormalizeByCurrent', True, 'Normalize by current') self.declareProperty('LoadLogs', True, 'Attempt to load logs from an existing file') self.declareProperty(FileProperty('LogFilename', '', direction=Direction.Input, action=FileAction.OptionalLoad, extensions=['_event.nxs']), doc='File containing logs to use (Optional)') self.setPropertySettings('LogFilename', EnabledWhenProperty('LoadLogs', PropertyCriterion.IsDefault))
def PyInit(self): only_positive = IntBoundedValidator() only_positive.setLower(0) self.declareProperty('NumPropWithDefaultDir', -1, only_positive) self.declareProperty('NumPropWithInOutDir', -1, only_positive,"doc string", Direction.InOut)