The config module provides configurable options for the whole package; eventually it might grow into a sophisticated configuration system such as matplotlib’s rc system but right now it mostly serves to define which gromacs tools and other scripts are offered in the package and where template files are located. If the user wants to change anything they will still have to do it here in source until a better mechanism with rc files has been implemented.
User-supplied templates are stored under gromacs.config.configdir. Eventually this will also contain the configuration options currently hard-coded in gromacs.config.
The user should execute gromacs.config.setup() at least once to prepare the user configurable area in their home directory:
import gromacs
gromacs.config.setup()
Gromacs commands log their invocation to a log file; typically at loglevel INFO (see the python logging module for details).
load_* variables are lists that contain instructions to other parts of the code which packages and scripts should be wrapped.
3rd party analysis scripts and tools; this is a list of triplets of
(script name/path, command name, doc string)
(See the source code for examples.)
load_tools is populated by listing gmx_* tool group variables in gmx_tool_groups.
The tool groups variables are strings that contain white-space separated file names of Gromacs tools. These lists determine which tools are made available as classes in gromacs.tools.
Contains the file names of all Gromacs tools for which classes are generated. Editing this list has only an effect when the package is reloaded. If you want additional tools then add the, to the source (config.py) or derive new classes manually from gromacs.core.GromacsCommand. (Eventually, this functionality will be in a per-user configurable file.) The current list was generated from Gromacs 4.0.99 (git). Removed (because of various issues)
- g_kinetics
Template variables list files in the package that can be used as templates such as run input files. Because the package can be a zipped egg we actually have to unwrap these files at this stage but this is completely transparent to the user.
GromacsWrapper comes with a number of templates for run input files and queuing system scripts. They are provided as a convenience and examples but WITHOUT ANY GUARANTEE FOR CORRECTNESS OR SUITABILITY FOR ANY PURPOSE.
All template filenames are stored in gromacs.config.templates. Templates have to be extracted from the GromacsWrapper python egg file because they are used by external code: find the actual file locations from this variable.
Gromacs mdp templates
These are supplied as examples and there is NO GUARANTEE THAT THEY PRODUCE SENSIBLE OUTPUT — check for yourself! Note that only existing parameter names can be modified with gromacs.cbook.edit_mdp() at the moment; if in doubt add the parameter with its gromacs default value (or empty values) and modify later with edit_mdp().
The safest bet is to use one of the mdout.mdp files produced by gromacs.grompp() as a template as this mdp contains all parameters that are legal in the current version of Gromacs.
Queuing system templates
The queing system scripts are highly specific and you will need to add your own into gromacs.config.qscriptdir. See gromacs.qsub for the format and how these files are processed.
Create the directories in which the user can store template and config files.
This function can be run repeatedly without harm.
The following functions can be used to access configuration data. Note that files are searched first with their full filename, then in all directories listed in gromacs.config.path, and finally within the package itself.
Find template file t and return its real path.
t can be a single string or a list of strings. A string should be one of
The first match (in this order) is returned. If the argument is a single string then a single string is returned, otherwise a list of strings.
Arguments: | t : template file or key (string or list of strings) |
---|---|
Returns: | os.path.realpath(t) (or a list thereof) |
Raises: | ValueError if no file can be located. |
Find template file(s) t and return their real paths.
t can be a single string or a list of strings. A string should be one of
The first match (in this order) is returned for each input argument.
Arguments: | t : template file or key (string or list of strings) |
---|---|
Returns: | list of os.path.realpath(t) |
Raises: | ValueError if no file can be located. |