\(\renewcommand\AA{\unicode{x212B}}\)
Table of Contents
Name | Direction | Type | Default | Description |
---|---|---|---|---|
InputWorkspaces | Input | str list | Names of the Input Workspaces to Group | |
GlobExpression | Input | string | Add all Workspaces that match Glob expression to Group | |
OutputWorkspace | Output | WorkspaceGroup | Mandatory | Name of the workspace to be created as the output of grouping |
This algorithm takes two or more workspaces as input and creates an output workspace group. A list of workspaces and a glob pattern may be specified together.
# Create two workspaces
ws1 = CreateSampleWorkspace()
ws2 = CreateSampleWorkspace()
# Group them
group = GroupWorkspaces( [ws1,ws2] )
# Check the result
from mantid.api import WorkspaceGroup
print("Workspace's type is WorkspaceGroup: {}".format(isinstance(group, WorkspaceGroup)))
print('It has {} entries'.format(group.getNumberOfEntries()))
print('Its first item is {}'.format(group.getItem(0)))
print('Its second item is {}'.format(group.getItem(1)))
wrkspc1 = CreateSampleWorkspace()
wrkspc2 = CreateSampleWorkspace()
anotherGroup = GroupWorkspaces(GlobExpression='wrkspc?')
# Check the result
print('It has {} entries'.format(anotherGroup.getNumberOfEntries()))
print('Its first item is {}'.format(anotherGroup.getItem(0)))
print('Its second item is {}'.format(anotherGroup.getItem(1)))
Workspace's type is WorkspaceGroup: True
It has 2 entries
Its first item is ws1
Its second item is ws2
It has 2 entries
Its first item is wrkspc1
Its second item is wrkspc2
Categories: AlgorithmIndex | Transforms\Grouping | Utility\Workspaces
C++ header: GroupWorkspaces.h (last modified: 2020-03-20)
C++ source: GroupWorkspaces.cpp (last modified: 2020-04-07)