Skip to content
Snippets Groups Projects
Commit ba765cb4 authored by Zhang, Chen's avatar Zhang, Chen
Browse files

update doctest

parent 6dde01fe
No related branches found
No related tags found
No related merge requests found
...@@ -9,8 +9,12 @@ ...@@ -9,8 +9,12 @@
Description Description
----------- -----------
Create an empty :ref:`PeaksWorkspace <PeaksWorkspace>`. Use This algorithm can be used to create a:
:ref:`algm-LoadIsawPeaks` or :ref:`algm-FindPeaksMD` to
- :ref:`PeaksWorkspace <PeaksWorkspace>` (Default, or when `OutputType` is set to `Peak`.)
- :ref:`LeanElasticPeaksWorkspace <LeanElasticPeaksWorkspace>` (when `OutputType` is set to `LeanElasticPeak`)
Use :ref:`algm-LoadIsawPeaks` or :ref:`algm-FindPeaksMD` to
create a peaks workspace with peaks. create a peaks workspace with peaks.
This workspace can serve as a starting point for modifying the This workspace can serve as a starting point for modifying the
...@@ -20,23 +24,32 @@ for example. ...@@ -20,23 +24,32 @@ for example.
If the input workspace is a MDWorkspace then the instrument from the If the input workspace is a MDWorkspace then the instrument from the
first experiment info is used. first experiment info is used.
If the `InstrumentWorkspace` is not provided then a
:ref:`LeanElasticPeaksWorkspace <LeanElasticPeaksWorkspace>` is
created instead of a :ref:`PeaksWorkspace <PeaksWorkspace>`
Usage Usage
----- -----
**Example: An empty table, not tied to an instrument**
.. testcode:: ExEmptyPeaksworkspaceTable
ws = CreatePeaksWorkspace()
print("Created a {} with {} rows".format(ws.id(), ws.rowCount()))
Output:
.. testoutput:: ExEmptyPeaksworkspaceTable
Created a PeaksWorkspace with 0 rows
**Example: Create an empty LeanElasticPeaksWorkspace, not tied to an instrument** **Example: Create an empty LeanElasticPeaksWorkspace, not tied to an instrument**
.. testcode:: ExEmptyTable .. testcode:: ExEmptyLeanElasticPeaksworkspaceTable
ws = CreatePeaksWorkspace(NumberOfPeaks=0) ws = CreatePeaksWorkspace(NumberOfPeaks=0, OutputType="LeanElasticPeak")
print("Created a {} with {} rows".format(ws.id(), ws.rowCount())) print("Created a {} with {} rows".format(ws.id(), ws.rowCount()))
Output: Output:
.. testoutput:: ExEmptyTable .. testoutput:: ExEmptyLeanElasticPeaksworkspaceTable
Created a LeanElasticPeaksWorkspace with 0 rows Created a LeanElasticPeaksWorkspace with 0 rows
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment