Skip to content

Commit

Permalink
Fix documentation tests.
Browse files Browse the repository at this point in the history
Refs #12656
  • Loading branch information
martyngigg committed Jun 12, 2015
1 parent 14b5183 commit de3a200
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 17 deletions.
10 changes: 5 additions & 5 deletions Code/Mantid/docs/source/concepts/InstrumentDataService.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ How does it work?
The Instrument data service is similar to all of the other :ref:`Data Services <Data Service>`
in mantid and is implemented as a simple dictionary object holding keys referring to shared pointers to the base
instrument definitions. The key is a compound string made up of the Instrument name with a sha1 hash of the text
of the instrument definition appended. For those detail minded among you, the has is derived specifically by
first converting any lines endings within the definition to linux line endings, and then trimming any white space
of the instrument definition appended. For those detail minded among you, the has is derived specifically by
first converting any lines endings within the definition to linux line endings, and then trimming any white space
from the start and end of the definition before calculating the sha1 checksum.

Extracting an instrument from the Instrument Data Service
Expand All @@ -33,10 +33,10 @@ workspace.
**Example: Getting the instrument from a workspace**

.. testcode:: GetInstrument

ws = CreateSampleWorkspace("Event",NumBanks=1,BankPixelWidth=1)
inst = ws.getInstrument()
inst.getSource().getPos()
print inst.getSource().getPos()

Output:

Expand All @@ -46,4 +46,4 @@ Output:



.. categories:: Concepts
.. categories:: Concepts
25 changes: 13 additions & 12 deletions Code/Mantid/docs/source/concepts/InstrumentDefinitionFile.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Instrument Definition File
==========================
.. contents::
:depth: 3

.. role:: xml(literal)
:class: highlight

Expand Down Expand Up @@ -129,8 +129,8 @@ using :ref:`LoadInstrument <algm-LoadInstrument>` or
:ref:`LoadEmptyInstrument <algm-LoadEmptyInstrument>`.

When loading a data file if the file has an embedded mantid instrument definition
(as in some nexus files) then this one will be used, otherwise we will attempt to
determine a matching file from the IDFs located in the MantidInstall instrument directory.
(as in some nexus files) then this one will be used, otherwise we will attempt to
determine a matching file from the IDFs located in the MantidInstall instrument directory.

To be found automatically Instrument definition files are
required to have the format INSTRUMENTNAME\_DefinitionANYTHING.xml,
Expand All @@ -151,30 +151,31 @@ using the following python:
.. testcode:: getInstrumentFilename

# if no date is given it will default to returning the IDF filename that is currently valid.
currentIDF = mantid.api.ExperimentInfo.getInstrumentFilename("ARCS")
otherIDF = mantid.api.ExperimentInfo.getInstrumentFilename("ARCS", "2012-10-30")
from mantid.api import ExperimentInfo
currentIDF = ExperimentInfo.getInstrumentFilename("ARCS")
otherIDF = ExperimentInfo.getInstrumentFilename("ARCS", "2012-10-30T00:00:00")


Downloaded Instrument File Definitions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

As well as the instrument definitions that ship with Mantid, mantid can also download updates
or new instrument definitions when it is started. This is a great way of keeping the files
As well as the instrument definitions that ship with Mantid, mantid can also download updates
or new instrument definitions when it is started. This is a great way of keeping the files
current without needing a new release of Mantid for each instrument change.

Mantid does not overwrite files in the MantidInstall instrument directory when downloading files,
it writes to another location that is a little different on windows and linux.

For windows:
%appdata%\\mantidproject\\instrument

For Linux:
~/.mantid/instrument

You should not edit files there, or add new ones as the may be deleted or overwritten.
If you have a change to an instrument definition you wish to use then edit a copy in the
MantidInstall instrument directory, but updated the valid-from date so mantid will pick that one
up in preference. Or if you just wish to force a particular instrument definition for a particular
You should not edit files there, or add new ones as the may be deleted or overwritten.
If you have a change to an instrument definition you wish to use then edit a copy in the
MantidInstall instrument directory, but updated the valid-from date so mantid will pick that one
up in preference. Or if you just wish to force a particular instrument definition for a particular
workspace just run :ref:`LoadInstrument <algm-LoadInstrument>` for that workspace.

More detailed descriptions of various parts of the IDF
Expand Down

0 comments on commit de3a200

Please sign in to comment.