Ticket #5841 (closed: fixed)
CloneWorkspace breaks sharing between Dx vectors
Reported by: | Russell Taylor | Owned by: | Russell Taylor |
---|---|---|---|
Priority: | major | Milestone: | Release 2.3 |
Component: | Mantid | Keywords: | |
Cc: | Blocked By: | ||
Blocking: | Tester: | Michael Reuter |
Description
The line "outputWorkspace->dataDx(i) = inputMatrix->readDx(i)" breaks the sharing between the vectors behind the cow_ptr (which is almost always there because this functionality is used only by the ORNL SANS analysis).
This is particularly bad news when workspaces are going managed because Dx has never been added to ManagedWorkspace2D and the data remains in memory (usually not a big deal as it's just one vector of zeroes).
Change History
comment:2 Changed 8 years ago by Russell Taylor
Re #5841. Make sure sharing between Dx vectors is not broken.
Dx is very rarely used, but the old line in CloneWorkspaces turned a single vector of zeroes into one for each spectrum - particularly bad news when managed workspaces are in play as Dx isn't saved out to file.
Changeset: ee433afa25c7232c2522713a251fa3abf95943f4
comment:3 Changed 8 years ago by Russell Taylor
Re #5841. Correctly load X errors (if present) in LoadAscii.
When checking other usages of dataDx, I noticed that X errors were not being correctly loaded in LoadAscii. Fix that, being careful that memory is not used unnecessarily if X errors are not there, and expand the test to cover it.
Changeset: 3cfe469dafca7a50778bed4a2378931671c3165d
comment:4 Changed 8 years ago by Russell Taylor
- Status changed from accepted to verify
- Resolution set to fixed
To test: Check that the tests currently at lines 64-72 of CloneWorkspaceTest are still there, and are passing. Also check that LoadAscii succeeds on a file created by saving a single spectrum of a file using SaveAscii with WriteXError checked. Edit some of the numbers in the 4th column of the created file to make sure they're being read in (using the python workspace.dataDx() method is one way to check).
comment:5 Changed 8 years ago by Russell Taylor
Re #5841. Make sure sharing between Dx vectors is not broken.
Dx is very rarely used, but the old line in CloneWorkspaces turned a single vector of zeroes into one for each spectrum - particularly bad news when managed workspaces are in play as Dx isn't saved out to file.
Changeset: ee433afa25c7232c2522713a251fa3abf95943f4
comment:6 Changed 8 years ago by Michael Reuter
- Status changed from verify to verifying
- Tester set to Michael Reuter
comment:7 Changed 8 years ago by Michael Reuter
- Status changed from verifying to closed
This looks like it is working correctly.
comment:8 Changed 8 years ago by Russell Taylor
Re #5841. Correctly load X errors (if present) in LoadAscii.
When checking other usages of dataDx, I noticed that X errors were not being correctly loaded in LoadAscii. Fix that, being careful that memory is not used unnecessarily if X errors are not there, and expand the test to cover it.
Changeset: 3cfe469dafca7a50778bed4a2378931671c3165d