Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
mantid
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mantidproject
mantid
Commits
706a8e2a
Commit
706a8e2a
authored
10 years ago
by
Dan Nixon
Browse files
Options
Downloads
Patches
Plain Diff
Add proper workspace validation
Refs #11403
parent
f946f7f9
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Code/Mantid/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/FlatPlatePaalmanPingsCorrection.py
+8
-4
8 additions, 4 deletions
...hms/WorkflowAlgorithms/FlatPlatePaalmanPingsCorrection.py
with
8 additions
and
4 deletions
Code/Mantid/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/FlatPlatePaalmanPingsCorrection.py
+
8
−
4
View file @
706a8e2a
#pylint: disable=no-init,invalid-name
#pylint: disable=no-init,invalid-name
from
mantid.simpleapi
import
*
from
mantid.simpleapi
import
*
from
mantid.api
import
PythonAlgorithm
,
AlgorithmFactory
,
PropertyMode
,
MatrixWorkspaceProperty
,
\
from
mantid.api
import
PythonAlgorithm
,
AlgorithmFactory
,
PropertyMode
,
MatrixWorkspaceProperty
,
\
WorkspaceGroupProperty
WorkspaceGroupProperty
,
InstrumentValidator
,
WorkspaceUnitValidator
from
mantid.kernel
import
StringListValidator
,
StringMandatoryValidator
,
IntBoundedValidator
,
\
from
mantid.kernel
import
StringListValidator
,
StringMandatoryValidator
,
IntBoundedValidator
,
\
FloatBoundedValidator
,
Direction
,
logger
FloatBoundedValidator
,
Direction
,
logger
,
CompositeValidator
import
math
,
numpy
as
np
import
math
,
numpy
as
np
...
@@ -39,8 +39,11 @@ class FlatPlatePaalmanPingsCorrection(PythonAlgorithm):
...
@@ -39,8 +39,11 @@ class FlatPlatePaalmanPingsCorrection(PythonAlgorithm):
def
PyInit
(
self
):
def
PyInit
(
self
):
ws_validator
=
CompositeValidator
([
WorkspaceUnitValidator
(
'
Wavelength
'
),
InstrumentValidator
()])
self
.
declareProperty
(
MatrixWorkspaceProperty
(
'
SampleWorkspace
'
,
''
,
self
.
declareProperty
(
MatrixWorkspaceProperty
(
'
SampleWorkspace
'
,
''
,
direction
=
Direction
.
Input
),
direction
=
Direction
.
Input
,
validator
=
ws_validator
),
doc
=
'
Name for the input sample workspace
'
)
doc
=
'
Name for the input sample workspace
'
)
self
.
declareProperty
(
name
=
'
SampleChemicalFormula
'
,
defaultValue
=
''
,
self
.
declareProperty
(
name
=
'
SampleChemicalFormula
'
,
defaultValue
=
''
,
...
@@ -57,7 +60,8 @@ class FlatPlatePaalmanPingsCorrection(PythonAlgorithm):
...
@@ -57,7 +60,8 @@ class FlatPlatePaalmanPingsCorrection(PythonAlgorithm):
self
.
declareProperty
(
MatrixWorkspaceProperty
(
'
CanWorkspace
'
,
''
,
self
.
declareProperty
(
MatrixWorkspaceProperty
(
'
CanWorkspace
'
,
''
,
direction
=
Direction
.
Input
,
direction
=
Direction
.
Input
,
optional
=
PropertyMode
.
Optional
),
optional
=
PropertyMode
.
Optional
,
validator
=
ws_validator
),
doc
=
"
Name for the input container workspace
"
)
doc
=
"
Name for the input container workspace
"
)
self
.
declareProperty
(
name
=
'
CanChemicalFormula
'
,
defaultValue
=
''
,
self
.
declareProperty
(
name
=
'
CanChemicalFormula
'
,
defaultValue
=
''
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment