Skip to content

Commit

Permalink
Remove unrequired testcleanup sections
Browse files Browse the repository at this point in the history
Refs #9574
  • Loading branch information
martyngigg committed Jun 4, 2014
1 parent 23ec642 commit aef0618
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 108 deletions.
Expand Up @@ -72,10 +72,6 @@ Usage

print("The 51st y-value is: %.3f" % ws.readY(0)[50])

.. testcleanup:: ExHRPDFocussing

DeleteWorkspace(ws)

Output:

.. testoutput:: ExHRPDFocussing
Expand All @@ -96,10 +92,6 @@ Output:
print "Number of focussed spectra: " + str(ws.getNumberHistograms())
print "What type is the workspace after focussing: " + str(type(ws))

.. testcleanup:: ExEventFocussing

DeleteWorkspace(ws)

Output:

.. testoutput:: ExEventFocussing
Expand Down
72 changes: 34 additions & 38 deletions Code/Mantid/docs/source/algorithms/Fit-v1.rst
Expand Up @@ -81,14 +81,14 @@ default value defined by the function. All names are case sensitive. For
example for fitting a Gaussian the Function property might look like
this:

``Function: "name=Gaussian, PeakCentre=4.6, Height=10, Sigma=0.5"``
``Function: "name=Gaussian, PeakCentre=4.6, Height=10, Sigma=0.5"``

Some functions have attributes. An attribute is a non-fitting parameter
and can be of one of the following types: text string, integer, or
double. Attributes are set just like the parameters using name=value
pairs. For example:

``Function: "name=UserFunction, Formula=a+b*x, a=1, b=2"``
``Function: "name=UserFunction, Formula=a+b*x, a=1, b=2"``

In this example Formula is the name of a string attribute which defines
an expression for the user UserFunction. The fitting parameters a and b
Expand All @@ -107,9 +107,9 @@ the Function property. Each simple function definition must be separated
by a semicolon ';'. For example fitting two Gaussians on a linear
background might look like this:

| ``Function: "name=LinearBackground, A0=0.3; ``
| ``           name=Gaussian, PeakCentre=4.6, Height=10, Sigma=0.5;``
| ``           name=Gaussian, PeakCentre=7.6, Height=8, Sigma=0.5"``
| ``Function: "name=LinearBackground, A0=0.3; ``
| `` name=Gaussian, PeakCentre=4.6, Height=10, Sigma=0.5;``
| `` name=Gaussian, PeakCentre=7.6, Height=8, Sigma=0.5"``
Setting ties
############
Expand All @@ -120,7 +120,7 @@ tying expressions. Use Ties property to set any ties. In case of a
simple function the parameter names are used as variables in the tying
expressions. For example

``Ties: "a=2*b+1, c=2"``
``Ties: "a=2*b+1, c=2"``

This ties parameter "a" to parameter "b" and fixes "c" to the constant
2.
Expand All @@ -136,13 +136,13 @@ part defines the function by its index in the composite function
(starting at 0). The index corresponds to the order in which the
functions are defined in the Function property. For example:

``Ties: "f1.Sigma=f0.Sigma,f2.Sigma=f0.Sigma"``
``Ties: "f1.Sigma=f0.Sigma,f2.Sigma=f0.Sigma"``

This ties parameter "Sigma" of functions 1 and 2 to the "Sigma" of
function 0. Of course all three functions must have a parameter called
"Sigma" for this to work. The last example can also be written

``Ties: "f1.Sigma=f2.Sigma=f0.Sigma"``
``Ties: "f1.Sigma=f2.Sigma=f0.Sigma"``

Setting constraints
###################
Expand All @@ -155,22 +155,22 @@ The penalty applied is described in more detail
constraints. In case of a simple function the parameter names are used
as variables in the constraint expressions. For example

``Constraints: "4.0 < c < 4.2"``
``Constraints: "4.0 < c < 4.2"``

Constraint the parameter "c" to be with the range 4.0 to 4.2, whereas

``Constraints: "c > 4.0"``
``Constraints: "c > 4.0"``

means "c" is constrained to be above the lower value 4.0 and

``Constraints: "c < 4.2"``
``Constraints: "c < 4.2"``

means "c" is constrained to be below the upper value 4.2.

In case of a composite function the same notation is used for
constraints and for ties. For example

``Constraints: "f1.c < 4.2"``
``Constraints: "f1.c < 4.2"``

constrain the parameter "c" of function 1.

Expand Down Expand Up @@ -207,10 +207,10 @@ Examples
This example shows a simple fit to a Gaussian function. The algorithm
properties are:

| ``InputWorkspace:  Test``
| ``WorkspaceIndex:  0``
| ``Function:        name=Gaussian, PeakCentre=4, Height=1.3, Sigma=0.5``
| ``Output:          res``
| ``InputWorkspace: Test``
| ``WorkspaceIndex: 0``
| ``Function: name=Gaussian, PeakCentre=4, Height=1.3, Sigma=0.5``
| ``Output: res``
.. figure:: /images/GaussianFit.jpg
:alt: GaussianFit.jpg
Expand All @@ -221,11 +221,11 @@ properties are:

The next example shows a fit of the same data but with a tie.

| ``InputWorkspace:  Test``
| ``WorkspaceIndex:  0``
| ``Function:        name=Gaussian, PeakCentre=4, Height=1.3, Sigma=0.5``
| ``Ties:            Sigma=Height/2``
| ``Output:          res``
| ``InputWorkspace: Test``
| ``WorkspaceIndex: 0``
| ``Function: name=Gaussian, PeakCentre=4, Height=1.3, Sigma=0.5``
| ``Ties: Sigma=Height/2``
| ``Output: res``
.. figure:: /images/GaussianFit_Ties.jpg
:alt: GaussianFit_Ties.jpg
Expand All @@ -238,12 +238,12 @@ This example shows a fit of two overlapping Gaussians on a linear
background. Here we create a composite function with a LinearBackground
and two Gaussians:

| ``InputWorkspace:  Test``
| ``WorkspaceIndex:  0``
| ``Function:        name=LinearBackground,A0=1;``
| ``                 name=Gaussian,PeakCentre=4,Height=1.5, Sigma=0.5;``
| ``                 name=Gaussian,PeakCentre=6,Height=4, Sigma=0.5 ``
| ``Output:          res``
| ``InputWorkspace: Test``
| ``WorkspaceIndex: 0``
| ``Function: name=LinearBackground,A0=1;``
| `` name=Gaussian,PeakCentre=4,Height=1.5, Sigma=0.5;``
| `` name=Gaussian,PeakCentre=6,Height=4, Sigma=0.5 ``
| ``Output: res``
.. figure:: /images/Gaussian2Fit.jpg
:alt: Gaussian2Fit.jpg
Expand All @@ -255,13 +255,13 @@ and two Gaussians:
This example repeats the previous one but with the Sigmas of the two
Gaussians tied:

| ``InputWorkspace:  Test``
| ``WorkspaceIndex:  0``
| ``Function:        name=LinearBackground,A0=1;``
| ``                 name=Gaussian,PeakCentre=4,Height=1.5, Sigma=0.5;``
| ``                 name=Gaussian,PeakCentre=6,Height=4, Sigma=0.5 ``
| ``Ties:            f2.Sigma = f1.Sigma``
| ``Output:          res``
| ``InputWorkspace: Test``
| ``WorkspaceIndex: 0``
| ``Function: name=LinearBackground,A0=1;``
| `` name=Gaussian,PeakCentre=4,Height=1.5, Sigma=0.5;``
| `` name=Gaussian,PeakCentre=6,Height=4, Sigma=0.5 ``
| ``Ties: f2.Sigma = f1.Sigma``
| ``Output: res``
.. figure:: /images/Gaussian2Fit_Ties.jpg
:alt: Gaussian2Fit_Ties.jpg
Expand Down Expand Up @@ -306,10 +306,6 @@ Usage
print "Number of spectra in fitWorkspace is: " + str(fitWorkspace.getNumberHistograms())
print("The 20th y-value of the calculated pattern: %.4f" % fitWorkspace.readY(1)[19])

.. testcleanup:: ExFitPeak

DeleteWorkspace(ws)

Output:

.. testoutput:: ExFitPeak
Expand Down
16 changes: 0 additions & 16 deletions Code/Mantid/docs/source/algorithms/Load-v1.rst
Expand Up @@ -41,10 +41,6 @@ Usage

print "The 1st x-value of the first spectrum is: " + str(ws.readX(0)[0])

.. testcleanup:: ExLoadISISnexusHist

DeleteWorkspace(ws)

Output:

.. testoutput:: ExLoadISISnexusHist
Expand All @@ -61,10 +57,6 @@ Output:

print "The number of histograms (spectra) is: " + str(ws.getNumberHistograms())

.. testcleanup:: ExLoadEventNexus

DeleteWorkspace(ws)

Output:

.. testoutput:: ExLoadEventNexus
Expand All @@ -81,10 +73,6 @@ Output:

print "The number of periods (entries) is: " + str(ws[0].getNumberOfEntries())

.. testcleanup:: ExLoadISISMuon

DeleteWorkspace(ws[0])

Output:

.. testoutput:: ExLoadISISMuon
Expand All @@ -101,10 +89,6 @@ Output:

print "The number of histograms (spectra) is: " + str(ws.getNumberHistograms())

.. testcleanup:: ExLoadNexusProcessedWithLoad

DeleteWorkspace(ws)

Output:

.. testoutput:: ExLoadNexusProcessedWithLoad
Expand Down
12 changes: 0 additions & 12 deletions Code/Mantid/docs/source/algorithms/LoadISISNexus-v2.rst
Expand Up @@ -25,10 +25,6 @@ Usage

print "The 1st x-value of the first spectrum is: " + str(ws.readX(0)[0])

.. testcleanup:: ExLoadISISnexus

DeleteWorkspace(ws)

Output:

.. testoutput:: ExLoadISISnexus
Expand All @@ -44,10 +40,6 @@ Output:

print "The number of histograms (spectra) is: " + str(ws.getNumberHistograms())

.. testcleanup:: ExLoadSpectrumMinMax

DeleteWorkspace(ws)

Output:

.. testoutput:: ExLoadSpectrumMinMax
Expand All @@ -63,10 +55,6 @@ Output:

print "The number of histograms (spectra) is: " + str(ws.getNumberHistograms())

.. testcleanup:: ExLoadEntryNumber

DeleteWorkspace(ws)

Output:

.. testoutput:: ExLoadEntryNumber
Expand Down
12 changes: 0 additions & 12 deletions Code/Mantid/docs/source/algorithms/LoadNexus-v1.rst
Expand Up @@ -39,10 +39,6 @@ Usage

print "The 1st x-value of the first spectrum is: " + str(ws.readX(0)[0])

.. testcleanup:: ExLoadISISnexus

DeleteWorkspace(ws)

Output:

.. testoutput:: ExLoadISISnexus
Expand All @@ -59,10 +55,6 @@ Output:

print "The number of periods (entries) is: " + str(ws[0].getNumberOfEntries())

.. testcleanup:: ExLoadISISMuon

DeleteWorkspace(ws[0])

Output:

.. testoutput:: ExLoadISISMuon
Expand All @@ -79,10 +71,6 @@ Output:

print "The number of histograms (spectra) is: " + str(ws.getNumberHistograms())

.. testcleanup:: ExLoadNexusProcessedWithLoadNexus

DeleteWorkspace(ws)

Output:

.. testoutput:: ExLoadNexusProcessedWithLoadNexus
Expand Down
22 changes: 0 additions & 22 deletions Code/Mantid/docs/source/algorithms/Rebin-v1.rst
Expand Up @@ -98,10 +98,6 @@ Usage
print "The rebinned X values are: " + str(ws.readX(0))
print "The rebinned Y values are: " + str(ws.readY(0))

.. testcleanup:: ExHistSimple

DeleteWorkspace(ws)

Output:

.. testoutput:: ExHistSimple
Expand All @@ -123,10 +119,6 @@ Output:

print "The 2nd and 3rd rebinned X values are: " + str(ws.readX(0)[1:3])

.. testcleanup:: ExHistLog

DeleteWorkspace(ws)

Output:

.. testoutput:: ExHistLog
Expand All @@ -147,10 +139,6 @@ Output:

print "The rebinned X values are: " + str(ws.readX(0))

.. testcleanup:: ExHistCustom

DeleteWorkspace(ws)

Output:

.. testoutput:: ExHistCustom
Expand All @@ -172,10 +160,6 @@ Output:
print "The rebinned X values are: " + str(ws.readX(0))
print "The rebinned Y values are: " + str(ws.readY(0))

.. testcleanup:: ExHistFullBinsOnly

DeleteWorkspace(ws)

Output:

.. testoutput:: ExHistFullBinsOnly
Expand All @@ -198,10 +182,6 @@ Output:
print "What type is the workspace after 2nd rebin: " + str(type(ws))
# note you can also check the type of a workspace using: print isinstance(ws, IEventWorkspace)

.. testcleanup:: ExEventRebin

DeleteWorkspace(ws)

Output:

.. testoutput:: ExEventRebin
Expand All @@ -210,6 +190,4 @@ Output:
What type is the workspace after 1st rebin: <class 'mantid.api._api.IEventWorkspace'>
What type is the workspace after 2nd rebin: <class 'mantid.api._api.MatrixWorkspace'>



.. categories::

0 comments on commit aef0618

Please sign in to comment.