Properties File

The *.properties Files

The Mantid framework is configured using up to three simple text *.properties files that are read an interpreted every time the framework is started. These properties are not the same as the properties of algorithms. All three have the same format. The three files are read from first to last, with the values in subsequent *.properties overriding those in previous ones.

  1. Install directory Mantid.properties defines the default configuration that the development team suggest as sensible defaults. This file should not be altered by users as it will be replaced with every new install or upgrade of Mantid.
  2. /etc/mantid.local.properties is an optional, linux only file that sets shared defaults on a shared system. This is commonly used for setting the default.facility, default.instrument, and datasearch.searcharchive properties.
  3. Home directory Mantid.user.properties is where users may override any property setting in Mantid. Any Property setting in this file will override anything set in the Mantid.properties file. Simply either enter the property you wish to override in this file together with it’s new value. The change will take effect the next time Mantid is started. Subsequent installs or upgrades of Mantid will never alter this file.

The Properties

Note

Use forward slash (/) or double up on the number of backslash (\) characters for all paths

General properties

Property Description Example value
algorithms.retained The Number of algorithms properties to retain in memory for refence in scripts. 50
algorithms.categories.hidden A comma separated list of any categories of algorithms that should be hidden in Mantid. Muons,Testing
MultiThreaded.MaxCores Sets the maximum number of cores available to be used for threads for OpenMP. If zero it will use one thread per logical core available. 0

Facility and instrument properties

Property Description Example value
default.facility The name of the default facility. The facility must be defined within the facilites.xml file to be considered valid. The file is described here. ISIS
default.instrument The name of the default instrument. The instrument must be defined within the facilities.xml file to be valid. The file is described here. WISH
Q.convention The convention for converting to Q. For Inelastic the convention is ki-kf. For Crystallography the convention is kf-ki. Crystallography or Inelastic

Directory Properties

Property Description Example value
datasearch.directories A semi-colon(;) separated list of directories to use to search for data. ../data;\\\\isis\\isis$\\ndxgem
datasearch.searcharchive on (only the default facility), off (none), all (all archives), or a list of individual facilities to search for files in the data archive on or hfir,sns
defaultsave.directory A default directory to use for saving files. the data archive ../data
instrumentDefinition.directory Where to load instrument definition files from ../Test/Instrument
parameterDefinition.directory Where to load parameter definition files from ../Test/Instrument
pythonscripts.directories Python will also search the listed directories when importing modules. ../scripts or C:/MyScripts
pythonscripts.directory DEPRECATED: Use pythonscripts.directories instead N/A
requiredpythonscript.directories A list of directories containing Python scripts that Mantid requires to function correctly. WARNING: Do not alter the default value. N/A
framework.plugins.directory The path to the directory that contains the Mantid plugin libraries ../plugins
framework.plugins.exclude A list of substrings to allow libraries to be skipped Qt4;Qt5
mantidqt.plugins.directory The path to the directory containing the Mantid Qt-based plugin libraries ../plugins/qtX
requiredpythonscript.directories A list of directories containing Python scripts that Mantid requires to function correctly. WARNING: Do not alter the default value. N/A

Logging Properties

The details of configuring the logging functionality within Mantid will not be explained here. For those who want more details look into the POCO logging classes and the Log4J logging module that it closely emulates. There are several comments in the properties file itself that explain the configuration we provide by default. However there are some obvious areas that you may want to alter and those properties are detailed below.

Property Description Example value
logging.loggers.root.level Defines the lowest level of messages to be output by the system, and will override lower settings in filterChannels. The default is information, but this can be lowered to debug for more detailed feedback. debug, information, notice, warning, error, critical or fatal
logging.channels.fileFilterChannel.level The lowest level messages to output to the log file. The default is warning, but this can be lowered to debug for more detailed feedback. The higher level of this and logging.loggers.root.level will apply. debug, information, notice, warning, error, critical or fatal
logging.channels.consoleFilterChannel.level The lowest level messages to output to the console. The default is warning, but this can be lowered to debug for more detailed feedback. The higher level of this and logging.loggers.root.level will apply. debug, information, notice, warning, error, critical or fatal
logging.channels.fileChannel.path The Path to the log file. ../logs/mantid.log

The logging priority levels for the file logging and console logging can also be adjusted in python using the commands:

#Set the console to log at debug level on above (7=debug)
ConfigService.setConsoleLogLevel(7)
#Set the file to only log at critical level (2=critical)
ConfigService.setConsoleLogLevel(2)

MantidPlot Properties

Property Description Example value
MantidOptions.InvisibleWorkspaces Do not show ‘invisible’ workspaces 0, 1
MantidOptions.InstrumentView.UseOpenGL Controls the use of OpenGL in rendering the “unwrapped” (flat) instrument views. On, Off

Network Properties

Property Description Example value
CheckMantidVersion.OnStartup Check if there is a newer version available and logs a message at information level 1
network.default.timeout Defines the default timeout for all network operations (in seconds). 30
network.scriptrepo.timeout The timeout for network operations in the script repository, this overrides the deafault timeout. 5
proxy.host Allows the system proxy to be overridden, if not set mantid will use the system proxy http://www.proxy.org
proxy.port Must be set if proxy.host is set 8080
proxy.httpsTargetUrl A sample url used to determine the system proxy to use on windows. http://www.google.com
UpdateInstrumentDefinitions.OnStartup Download new instrument definition files and Facilities.xml to ~/.mantid/instruments on linux or APPDATA directory on windows. If this is disabled, previously downloaded instruments are ignored and only those in the installation are used. 1
usagereports.enabled Enable usage reporting 1

ScriptRepository Properties

Property Description Example value
ScriptLocalRepository Directory where ScriptRepository is Installed. C:\\MantidInstall\\MyScriptRepository
ScriptRepository Base URL for the remote script repository. http://download.mantidproject.org/scriptrepository/
UploaderWebServer URL for uploading scripts. http://upload.mantidproject.org/scriptrepository/payload/publish
ScriptRepositoryIgnore CSV patterns for paths that should not be listed at ScriptRepository. *pyc;

Getting access to Mantid properties

To get access to, e.g. data saving path property from a C++ program one has to issue the following command:

path = ConfigService.getString("defaultsave.directory")

Category: Concepts