Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
mantid
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mantidproject
mantid
Commits
ba765cb4
Commit
ba765cb4
authored
4 years ago
by
Zhang, Chen
Browse files
Options
Downloads
Patches
Plain Diff
update doctest
parent
6dde01fe
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
docs/source/algorithms/CreatePeaksWorkspace-v1.rst
+22
-9
22 additions, 9 deletions
docs/source/algorithms/CreatePeaksWorkspace-v1.rst
with
22 additions
and
9 deletions
docs/source/algorithms/CreatePeaksWorkspace-v1.rst
+
22
−
9
View file @
ba765cb4
...
@@ -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:: ExEmpty
LeanElasticPeaksworkspace
Table
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:: ExEmpty
LeanElasticPeaksworkspace
Table
Created a LeanElasticPeaksWorkspace with 0 rows
Created a LeanElasticPeaksWorkspace with 0 rows
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment