diff --git a/docs/source/concepts/WorkspaceGroup.rst b/docs/source/concepts/WorkspaceGroup.rst index 1e50806154a1..8196fd0594a3 100644 --- a/docs/source/concepts/WorkspaceGroup.rst +++ b/docs/source/concepts/WorkspaceGroup.rst @@ -26,6 +26,8 @@ Workspace groups can be created in a more flexible way in the Python script wind .. testcode:: CreatingWorkspaceGroups + from mantid.simpleapi import * + ws1 = CreateSampleWorkspace() ws2 = CreateSampleWorkspace() ws3 = CreateSampleWorkspace() @@ -70,8 +72,11 @@ the group should then appear in the ADS with the given name. Using direct instan .. testcode:: CreatingWorkspaceGroupsInstantiated + from mantid.simpleapi import * from mantid.api import WorkspaceGroup + mtd.clear() + ws1 = CreateSampleWorkspace() ws2 = CreateSampleWorkspace() ws3 = CreateSampleWorkspace() @@ -97,8 +102,11 @@ Alternatively, workspace group objects can be fed workspaces which are not in th .. testcode:: CreatingWorkspaceGroupsNoADS + from mantid.simpleapi import * from mantid.api import WorkspaceGroup + mtd.clear() + ws1 = WorkspaceFactory.create("Workspace2D", 2, 2, 2) ws2 = WorkspaceFactory.create("Workspace2D", 2, 2, 2) ws3 = WorkspaceFactory.create("Workspace2D", 2, 2, 2) @@ -135,6 +143,7 @@ If you want to check if a variable points to something that is a Workspace Group .. testcode:: CheckGroupWorkspace + from mantid.simpleapi import * from mantid.api import WorkspaceGroup ws1 = CreateSampleWorkspace() @@ -156,6 +165,8 @@ Looping over all of the members of a group .. testcode:: GroupWorkspaceMembers + from mantid.simpleapi import * + ws1 = CreateSampleWorkspace() ws2 = CreateSampleWorkspace() wsGroup = GroupWorkspaces("ws1,ws2") @@ -186,6 +197,8 @@ You can pass workspace groups into any algorithm and Mantid will run that algori .. testcode:: CheckGroupWorkspace + from mantid.simpleapi import * + ws1 = CreateSampleWorkspace() ws2 = CreateSampleWorkspace() wsGroup = GroupWorkspaces("ws1,ws2") @@ -211,6 +224,8 @@ Final words of warning: .. testcode:: Iterative Deletion of Grouped Workspaces + from mantid.simpleapi import * + ws1 = CreateSampleWorkspace() ws2 = CreateSampleWorkspace() wsGroup = GroupWorkspaces("ws1,ws2") @@ -224,6 +239,8 @@ otherwise indexing will be confused by each deletion. .. testcode:: Delete Entire Workspace + from mantid.simpleapi import * + ws1 = CreateSampleWorkspace() ws2 = CreateSampleWorkspace() wsGroup = GroupWorkspaces("ws1,ws2")