def PyInit(self): self.declareProperty(MultipleFileProperty('Filename'), doc='List of input files') self.declareProperty('LoaderName', defaultValue='Load', validator=StringContainsValidator(['Load']), direction=Direction.InOut, doc='The name of the specific loader. Generic Load by default.') self.declareProperty('LoaderVersion', defaultValue=-1, direction=Direction.InOut, doc='The version of the specific loader') self.declareProperty(PropertyManagerProperty('LoaderOptions',dict()), doc='Options for the specific loader') self.declareProperty(PropertyManagerProperty('MergeRunsOptions',dict()), doc='Options for merging the metadata') self.declareProperty(WorkspaceProperty('OutputWorkspace', '', direction=Direction.Output), doc='Output workspace or workspace group.')
def invalid_init(self, input_case): if input_case == "String List": self.declareAttribute("StringAtt", "error", StringListValidator(["filename", "test"])) elif input_case == "Float Bounded": self.declareAttribute("FloatAtt", 10.0, FloatBoundedValidator(0.0, 5.0)) elif input_case == "Array Bounded": self.declareAttribute("ListAtt", [1.0, 2.0, 3.0, 10.0], FloatArrayBoundedValidator(0.0, 5.0)) elif input_case == "String Contains": self.declareAttribute("StringContainsAtt", "error", StringContainsValidator(["Contains"]))
def PyInit(self): self.declareProperty(MultipleFileProperty('Filename'), doc='List of input files') self.getProperty('Filename').setAutoTrim(setting=False) self.declareProperty( 'LoaderName', defaultValue='Load', validator=StringContainsValidator(['Load']), direction=Direction.InOut, doc='The name of the specific loader. Generic Load by default.') self.declareProperty('LoaderVersion', defaultValue=-1, direction=Direction.InOut, doc='The version of the specific loader') self.declareProperty(PropertyManagerProperty('LoaderOptions', dict()), doc='Options for the specific loader') self.declareProperty(PropertyManagerProperty('MergeRunsOptions', dict()), doc='Options for merging the metadata') self.declareProperty(WorkspaceProperty('OutputWorkspace', '', direction=Direction.Output), doc='Output workspace or workspace group.') self.declareProperty( 'OutputBehaviour', 'Group', StringListValidator(['Group', 'Concatenate']), doc= 'Whether to group the workspaces to a workspace group or to concatenate them to a single workspace.' ) self.declareProperty( 'SampleLogAsXAxis', '', doc= 'Sample log to be put as x-axis when concatenating; will use linear indices if left blank.' ) self.setPropertySettings( 'SampleLogAsXAxis', EnabledWhenProperty('OutputBehaviour', PropertyCriterion.IsEqualTo, 'Concatenate'))
def PyInit(self): validator = StringContainsValidator(["Home", "meOw"]) self.declareProperty("Input", "", validator)
def PyInit(self): validator = StringContainsValidator() validator.setRequiredStrings(["meOw"]) self.declareProperty("Input", "", validator)
def PyInit(self): validator = StringContainsValidator() validator.setRequiredStrings(["Home","meOw"]) self.declareProperty("Input", "", validator)