Runtime Configuration

To configure the runtime behavior such as logging the system or other parameters, the configuration module reads several config files to build its final set of settings. It searches for the file ‘pyemma.cfg’ in several locations with different priorities:

  1. $CWD/pyemma.cfg

2. $HOME/.pyemma/pyemma.cfg 4. ~/pyemma.cfg 5. $PYTHONPATH/pyemma/pyemma.cfg (always taken as default configuration file)

The same applies for the filename ”.pyemma.cfg” (hidden file).

The default values are stored in latter file to ensure these values are always defined. This is preferred over hardcoding them somewhere in the Python code.

Default configuration file

Default settings are stored in a provided pyemma.cfg file, which is included in the Python package:

################################################################################
# PyEMMA configuration file
#
# notes:
# - comments are not allowed in line, since they would be appended to the value!
################################################################################

[Logging]
enabled = True
toconsole = True
tofile = False
file = pyemma.log
level = INFO
format = %%(asctime)s %%(name)-12s %%(levelname)-8s %%(message)s


# pyemma configuration section
[pyemma]
show_progress_bars = True
# useful for trajectory formats, for which one has to read the whole file to get len
use_trajectory_lengths_cache = True

To access the config at runtime eg. the logging section:

from pyemma.util.config import config
print config.Logging.level

Notes

All values are being stored as strings, so to compare eg. if a value is True, compare for:

if config['section'].my_bool == 'True':
    pass

Members

conf_values store arbitrary attributes in this dictionary like class.
used_filenames list() -> new empty list