Ticket #2129 (closed: fixed)
Allow algorithms to be "ReductionSteps" - name to be improved
Reported by: | Nick Draper | Owned by: | Mathieu Doucet |
---|---|---|---|
Priority: | major | Milestone: | Iteration 27 |
Component: | Mantid | Keywords: | |
Cc: | Blocked By: | ||
Blocking: | Tester: | Michael Whitty |
Description
This requires algorithms to not store themselves in the history of a workspace.
It was also discussed that they should store a list of the algorithms to be used and the options of underlying algorithms.
Change History
comment:3 Changed 10 years ago by Mathieu Doucet
From python, we can now create an algorithm object without executing it by calling
algo = [algorithm name]( [parameters...], execute=False)
For example:
algo = Load("myfile.txt", "mywksp", execute=False)
Once created, the algorithm can be run by doing
mantidsimple.execute_algorithm(algo)
The Reducer has been modified so that Mantid algorithms can be passed to append_step(). Previously, this method only accepted ReductionStep objects.
r = Reducer() r.append_step(Load, "myfile.txt", "mywksp")
The Reducer will create the algorithm and only execute it when reduce() is called. Note that ReductionStep objects can still be passed to append_step() and this change is fully backward compatible. Also note that the input and output workspaces, when defined, will be over-written by the Reducer. Still, dummy values should be passed according to the algorithm's syntax.
comment:5 Changed 10 years ago by Mathieu Doucet
Any Reducer method with a signature of the type
def some_method(reduction_step)
where reduction_step is a ReductionStep object, can now take a mantidsimple algorithm function and its parameters by decorating the method with @validate_step
@validate_step def some_method(reduction_step)
comment:10 Changed 10 years ago by Mathieu Doucet
Needs unit tests, otherwise the needed functionality should be complete. I have created a new ticket (#2270) to deal with history logging issue of python sub-algorithms.
comment:11 Changed 10 years ago by Mathieu Doucet
comment:12 Changed 10 years ago by Mathieu Doucet
comment:13 Changed 10 years ago by Mathieu Doucet
comment:14 Changed 10 years ago by Mathieu Doucet
- Status changed from accepted to verify
- Resolution set to fixed
comment:15 Changed 10 years ago by Michael Whitty
- Status changed from verify to verifying
- Tester set to Michael Whitty
comment:16 Changed 10 years ago by Michael Whitty
- Status changed from verifying to closed
tested in [9528] - allows base algorithms to be set as reduction steps.
comment:17 Changed 5 years ago by Stuart Campbell
This ticket has been transferred to github issue 2976