Ticket #134 (closed: fixed)

Opened 12 years ago

Last modified 5 years ago

Sort out the copying of Workspace members (Instrument etc.) to algorithms' output workspaces

Reported by: Russell Taylor Owned by: Russell Taylor
Priority: minor Milestone: Iteration 10
Component: Keywords:
Cc: Blocked By:
Blocking: Tester:

Description

At the moment, the copying of workspace members (Instrument, SpectraDetectorMap, Sample, History, Unit) from input to output workspaces within algorithms is very random. Indeed, in most cases the information is lost when it probably shouldn't be. We need to develop tools (probably within the Algorithm Factory) to make it simple for an algorithm developer to get his output workspace holding the correct information.

Related to this is the issue of what happens when Input and Output workspace names are the same (or more generally if the output workspace is set to a name that already exists in the ADS). Should it just be completely overwritten (what currently happens unless an algorithm happens to checks the ADS itself) or just have its data changed?

Change History

comment:1 Changed 12 years ago by Nick Draper

  • Owner set to Russell Taylor
  • Milestone changed from Unassigned to Iteration 9

comment:2 Changed 12 years ago by Russell Taylor

(In [1148]) SpectraDetectorMap wasn't being copied over when a workspace was created from a parent. Re #134.

comment:3 Changed 12 years ago by Nick Draper

  • Milestone changed from Iteration 9 to Iteration 10

comment:4 Changed 12 years ago by Russell Taylor

  • Status changed from new to assigned

comment:5 Changed 12 years ago by Russell Taylor

(In [1172]) Regularised the copying over of Workspace data members (e.g. instrument, axes etc.). Main change is the extension to the WorkspaceFactory 'create from parent workspace' method so that the caller can optionally specify a different size for the new workspace. Re #134.

comment:6 Changed 12 years ago by Russell Taylor

  • Status changed from assigned to closed
  • Resolution set to fixed

I think this is OK for now. A couple of points: copying the SpectraMap over may not always be correct. Also, the isDistribution flag & ErrorHelpers are not copied. The first of these will, I suspect, change soon as more work is done on Units. The latter relates directly to the data, which is not copied.

For the second point in the ticket description, the WorkspaceProperty::isValid method will now get the pointer to an output workspace if it already exists in the ADS. It is then up to the algorithm developer to make use of that if appropriate - i.e. if the input and output workspaces are compatible (the same size). The only current algorithm where this is applicable is ConvertUnits. The effect of the change in this case is that we avoid creating a new workspace which then overwrites the old one in the ADS at the end of the algorithm.

comment:7 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 982

Note: See TracTickets for help on using tickets.