Ticket #7867 (closed: fixed)
mtd.addOrReplace() is not replacing
Reported by: | Arturs Bekasovs | Owned by: | Martyn Gigg |
---|---|---|---|
Priority: | blocker | Milestone: | Release 3.0 |
Component: | Python | Keywords: | |
Cc: | nick.draper@… | Blocked By: | |
Blocking: | Tester: | Arturs Bekasovs |
Description (last modified by Arturs Bekasovs) (diff)
mtd.remove("Workspace1") ws = WorkspaceFactory.create("Workspace2D", 1, 1, 1) mtd.add("Workspace1", ws) # Uncommenting the following line elliminates the error #mtd.remove("Workspace1") ws2 = WorkspaceFactory.create("Workspace2D", 1, 2, 2) mtd.addOrReplace("Workspace1", ws2)
I would expect the last line to update "Workspace1" in the ADS to hold ws2, but instead it throws:
RuntimeError: add : Unable to insert Data Object : 'Workspace1' at line 10 in 'New script'
Uncommenting the line solves the problem, which leads to a thought that addOrReplace() is not actually replacing the workspace if it already exists.
Observed in 2.6 on Ubuntu 12.04.
Change History
comment:5 Changed 7 years ago by Martyn Gigg
Fix the export of AnalysisDataService::addOrReplace
Add an explict test for the method. Refs #7867
Changeset: 0b5b0ce38e317824b3d2d945f0f98b7ca58407fd
comment:6 Changed 7 years ago by Martyn Gigg
- Status changed from inprogress to verify
- Resolution set to fixed
Branch: bugfix/7867_python_mtd_addorreplace
Tester: The script within the description should now work correctly. The unit test has been extended to cover this case explicitly.
comment:7 Changed 7 years ago by Arturs Bekasovs
- Status changed from verify to verifying
- Tester set to Arturs Bekasovs
comment:8 Changed 7 years ago by Arturs Bekasovs
- Status changed from verifying to closed
Merge remote-tracking branch 'origin/bugfix/7867_python_mtd_addorreplace'
Full changeset: e9eac56335f1dc4680c535af2500090384d4ef45
comment:10 Changed 5 years ago by Stuart Campbell
This ticket has been transferred to github issue 8712