What are Workspaces?

Workspaces store data that algorithms operate on. Workspaces are usually stored in-memory. An algorithm can manipulate a workspace in-place or create a new one as an output.

Workspace is as loose term that encompases a range of possible data structures. All forms of Workspace provide some common information:

  • The type identifier (id) of the workspace (see below), unique to every type of workspace

  • The name of the workspace, unique to every instance of a workspace even those of the same type

  • The history of algorithms that were run to form and manipulate the workspace to its current state


In MantidWorkbench the data from the workspaces can be graphically viewed, inspected, and plotted in many ways.


In addition to data, workspaces hold a workspace history, which details the algorithms which have been run on this workspace. This means workspaces carry all the meta-information to fully recreate themeselves.

Workspaces Types

  • Matrix Workspace - Is really a catagorisation for a family which contains measured (or derived) data with associated errors and an axis giving information about where the the measurement was made. Matrix Workspaces are typically create initially by executing one of Mantid’s Load algorithms, for example LoadRaw or LoadNexus. Of data structures representing 2D measurement data. The following are common sorts of Matrix Workspace:

    • Workspace 2D - A workspace for holding two dimensional histogram data in memory, this is the most commonly used workspace.

    • Event Workspace - A workspace that retains the individual neutron event data often including the pulse time corresponding to the reading.

  • Table Workspace - A workspace holding data in rows of columns having a particular type (e.g. text, integer, …).

  • Workspace Group - A container for a collection of workspaces. Algorithms given a group as input usually run sequentially on each member of the group.

The workspace type id identifies the type of a Workspace instance.


For C++ or Python development, these values are needed in such functions as the Analysis Data Service’s createWorkspace.


Workspace Type



























Working with Workspaces

This page describes how you can work with workspaces in python, including accessing their properties and history

Writing you own Workspace

Table Workspace is the best solution at present for customising the data structures you need. Changes beyond that are at present not trivial. For specialisation of existing data structures, or new data requirements, please contact the Mantid Team for help.

Category: Concepts