Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
mantidproject
mantid
Commits
3d6d228b
Commit
3d6d228b
authored
Aug 02, 2021
by
Gemma Guest
Browse files
Add outline algorithm to do the preprocessing
Add outline algorithm and tests Re #32125
parent
7c738fc1
Changes
4
Show whitespace changes
Inline
Side-by-side
Framework/PythonInterface/plugins/CMakeLists.txt
View file @
3d6d228b
...
...
@@ -270,6 +270,7 @@ set(PYTHON_PLUGINS
algorithms/WorkflowAlgorithms/ReflectometryILLPreprocess.py
algorithms/WorkflowAlgorithms/ReflectometryILLSumForeground.py
algorithms/WorkflowAlgorithms/ReflectometryILL_common.py
algorithms/WorkflowAlgorithms/ReflectometryISISPreprocess.py
algorithms/WorkflowAlgorithms/ReflectometryISISLoadAndProcess.py
algorithms/WorkflowAlgorithms/ResNorm2.py
algorithms/WorkflowAlgorithms/SANS/SANSBeamCentreFinder.py
...
...
Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ReflectometryISISPreprocess.py
0 → 100644
View file @
3d6d228b
# -*- coding: utf-8 -*-# Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2021 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source,
# Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
# SPDX - License - Identifier: GPL - 3.0 +
from
mantid.api
import
(
AlgorithmFactory
,
DataProcessorAlgorithm
)
class
_Prop
:
RUNS
=
'InputRunList'
GROUP_TOF
=
'GroupTOFWorkspaces'
OUTPUT_WS
=
'OutputWorkspace'
class
ReflectometryISISPreprocess
(
DataProcessorAlgorithm
):
def
__init__
(
self
):
"""Initialize an instance of the algorithm."""
DataProcessorAlgorithm
.
__init__
(
self
)
def
category
(
self
):
"""Return the categories of the algorithm."""
return
'ISIS
\\
Reflectometry;Workflow
\\
Reflectometry'
def
name
(
self
):
"""Return the name of the algorithm."""
return
'ReflectometryISISPreprocess'
def
summary
(
self
):
"""Return a summary of the algorithm."""
return
"Preprocess ISIS reflectometry data, including optional loading and summing of the input runs."
def
seeAlso
(
self
):
"""Return a list of related algorithm names."""
return
[
'ReflectometryISISLoadAndProcess'
,
'ReflectometryReductionOneAuto'
]
def
version
(
self
):
"""Return the version of the algorithm."""
return
1
def
PyInit
(
self
):
pass
def
PyExec
(
self
):
pass
AlgorithmFactory
.
subscribe
(
ReflectometryISISPreprocess
)
Framework/PythonInterface/test/python/plugins/algorithms/WorkflowAlgorithms/CMakeLists.txt
View file @
3d6d228b
...
...
@@ -59,6 +59,7 @@ set(TEST_PY_FILES
ReflectometryILLPreprocessTest.py
ReflectometryILLSumForegroundTest.py
ReflectometryISISLoadAndProcessTest.py
ReflectometryISISPreprocessTest.py
ResNorm2Test.py
SANSDarkRunBackgroundCorrectionTest.py
SANSFitShiftScaleTest.py
...
...
Framework/PythonInterface/test/python/plugins/algorithms/WorkflowAlgorithms/ReflectometryISISPreprocessTest.py
0 → 100644
View file @
3d6d228b
# Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2021 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source,
# Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
# SPDX - License - Identifier: GPL - 3.0 +
import
unittest
from
mantid.api
import
MatrixWorkspace
from
testhelpers
import
create_algorithm
class
ReflectometryISISLoadAndProcessTest
(
unittest
.
TestCase
):
ALG_NAME
=
"ReflectometryISISPreprocess"
def
test_algorithm_executes
(
self
):
alg
=
create_algorithm
(
self
.
ALG_NAME
)
alg
.
execute
()
self
.
assertTrue
(
alg
.
isExecuted
())
def
test_input_run_is_loaded
(
self
):
args
=
{
'InputRunList'
:
'13460'
}
alg
=
create_algorithm
(
self
.
ALG_NAME
,
**
args
)
alg
.
execute
()
output_ws
=
alg
.
getProperty
(
"OutputWorkspace"
)
self
.
assertIsInstance
(
MatrixWorkspace
,
output_ws
)
if
__name__
==
'__main__'
:
unittest
.
main
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment