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
6849ce45
Commit
6849ce45
authored
13 years ago
by
Doucet, Mathieu
Browse files
Options
Downloads
Patches
Plain Diff
Get rid of old code. Re #3628
parent
82d24ff9
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/scripts/reduction/reducer.py
+0
-58
0 additions, 58 deletions
Code/Mantid/scripts/reduction/reducer.py
with
0 additions
and
58 deletions
Code/Mantid/scripts/reduction/reducer.py
+
0
−
58
View file @
6849ce45
...
@@ -297,64 +297,6 @@ def validate_step(f):
...
@@ -297,64 +297,6 @@ def validate_step(f):
return
"
%s applied
"
%
algorithm
.
name
()
return
"
%s applied
"
%
algorithm
.
name
()
return
f
(
reducer
,
_AlgorithmStep
())
return
f
(
reducer
,
_AlgorithmStep
())
elif
False
and
isinstance
(
algorithm
,
types
.
FunctionType
):
# If the algorithm is a function, in which case
# we expect it to produce an algorithm proxy
class
_AlgorithmStep
(
ReductionStep
):
def
__init__
(
self
):
self
.
algm
=
algorithm
def
execute
(
self
,
reducer
,
inputworkspace
=
None
,
outputworkspace
=
None
):
"""
Create a new instance of the requested algorithm object,
set the algorithm properties replacing the input and output
workspaces.
The execution will work for any combination of mandatory/optional
properties.
@param reducer: Reducer object managing the reduction
@param inputworkspace: input workspace name [optional]
@param outputworkspace: output workspace name [optional]
"""
if
outputworkspace
is
None
:
outputworkspace
=
inputworkspace
kwargs
[
'
execute
'
]
=
False
proxy
=
self
.
algm
(
*
args
,
**
kwargs
)
if
not
isinstance
(
proxy
,
MantidFramework
.
IAlgorithmProxy
):
raise
RuntimeError
,
"
Reducer expects a ReductionStep or a function returning an IAlgorithmProxy object
"
_algm
=
proxy
.
_getHeldObject
()
# The inspect module has changed in python 2.6
if
sys
.
version_info
[
0
]
==
2
and
sys
.
version_info
[
1
]
<
6
:
argspec
=
inspect
.
getargspec
(
self
.
algm
)[
0
]
else
:
argspec
=
inspect
.
getargspec
(
self
.
algm
).
args
# Go through provided arguments
if
len
(
args
)
>
len
(
argspec
):
raise
RuntimeError
,
"
Could not get call signature for %s
"
%
_algm
.
name
()
for
i
in
range
(
len
(
args
)):
if
argspec
[
i
]
==
"
InputWorkspace
"
:
_algm
.
setPropertyValue
(
"
InputWorkspace
"
,
inputworkspace
)
elif
argspec
[
i
]
==
"
OutputWorkspace
"
:
_algm
.
setPropertyValue
(
"
OutputWorkspace
"
,
outputworkspace
)
else
:
_algm
.
setPropertyValue
(
argspec
[
i
],
args
[
i
])
# Go through keyword arguments
for
key
in
kwargs
:
if
key
not
in
proxy
.
keys
():
continue
if
key
==
"
InputWorkspace
"
:
_algm
.
setPropertyValue
(
"
InputWorkspace
"
,
inputworkspace
)
elif
key
==
"
OutputWorkspace
"
:
_algm
.
setPropertyValue
(
"
OutputWorkspace
"
,
outputworkspace
)
else
:
_algm
.
setPropertyValue
(
key
,
kwargs
[
key
])
mantidsimple
.
execute_algorithm
(
proxy
)
return
"
%s
\n\t
%s
"
%
(
self
.
algm
.
__name__
,
self
.
algm
.
__doc__
)
return
f
(
reducer
,
_AlgorithmStep
())
else
:
else
:
raise
RuntimeError
,
"
%s expects a ReductionStep object, found %s
"
%
(
f
.
__name__
,
algorithm
.
__class__
)
raise
RuntimeError
,
"
%s expects a ReductionStep object, found %s
"
%
(
f
.
__name__
,
algorithm
.
__class__
)
return
validated_f
return
validated_f
...
...
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