Skip to content

Commit

Permalink
Refs #12722 Also cover range summation
Browse files Browse the repository at this point in the history
We may as wel make sure to cover *all* the syntax in the doc test, to
ensure it all works.
  • Loading branch information
Harry Jeffery committed Jun 8, 2015
1 parent ed9017b commit c050ddb
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Code/Mantid/docs/source/algorithms/GroupDetectors-v2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -491,22 +491,24 @@ Output:
# Create Workspace of 10 spectra each with one bin.
ws = CreateWorkspace(DataX=[1], DataY=[1,2,3,4,5,6,7,8,9,10], NSpec=10)

# Run algorithm adding first two spectra and then keep the fifth, and last three spectra
ws2 = GroupDetectors(ws, GroupingPattern="0+1,4,7:9")
# Run algorithm adding first two spectra and then keep the fourth, add the fifth to seventh, and then keep the last three spectra
ws2 = GroupDetectors(ws, GroupingPattern="0+1,3,4-6,7:9")

#print result
print ws2.readY(0)
print ws2.readY(1)
print ws2.readY(2)
print ws2.readY(3)
print ws2.readY(4)
print ws2.readY(5)

Output:

.. testoutput:: ExGroupDetectorsWithPattern

[ 3.]
[ 5.]
[ 4.]
[ 18.]
[ 8.]
[ 9.]
[ 10.]
Expand Down

0 comments on commit c050ddb

Please sign in to comment.