gromacs.environment – Run time modification of behaviour — GromacsWrapper 0.4.0-dev documentation

### Navigation

- index
- modules |
- next |
- previous |
- GromacsWrapper 0.4.0-dev documentation »
- GromacsWrapper package »
- Gromacs core modules »

# `gromacs.environment` – Run time modification of behaviour

Some aspects of GromacsWrapper can be determined globally. The corresponding flags `Flag` are set in the environment (think of them like environment variables). They are accessible through the pseudo-dictionary `gromacs.environment.flags`.

The entries appear as ‘name’-‘value’ pairs. Flags check values and illegal ones raise a `ValueError`. Documentation on all flags can be obtained with

    print gromacs.environment.flags.doc()

## List of GromacsWrapper flags with default values

class `gromacs.environment.` `flagsDocs`

  capture_output = False

  > Select if Gromacs command output is always captured.

  >     >>> flags['capture_output'] = False

  > By default a `GromacsCommand` will direct STDOUT and STDERR output from the command itself to the screen (through /dev/stdout and /dev/stderr). When running the command, this can be changed with the keywords stdout and stderr as described in `gromacs.core` and `Command`.

  > If this flag is set to `True` then by default STDOUT and STDERR are captured as if one had set

  >     stdout=False, stderr=False

  > Explicitly setting stdout and/or stderr overrides the behaviour described above.

  > If set to the special keyword `"file"` then the command writes to the file whose name is given by ``flags['capture_output_filename']`. This file is over-written for each command. In this way one can investigate the output from the last command (presumably because it failed). STDOUT and STDERR are captured into this file by default. STDERR is printed first and then STDOUT, which does not necessarily reflect the order of output one would see on the screen.

  > The default is False.

  capture_output_filename = ‘gromacs_captured_output.txt’

  > Name of the file that captures output if ``flags[‘capture_output’] = “file”

  >     >>> flags['capture_output_filename'] = 'gromacs_captured_output.txt'

  > This is an experimental feature. The default is ‘gromacs_captured_output.txt’.

## Classes

`gromacs.environment.` `flags`

class `gromacs.environment.` `Flags`(*args)

  Global registry of flags. Acts like a dict for item access.

  There are a number flags defined that influence how MDAnalysis behaves. They are accessible through the pseudo-dictionary

  > `gromacs.environment.flags`

  The entries appear as ‘name’-‘value’ pairs. Flags check values and illegal ones raise a `ValueError`. Documentation on all flags can be obtained with

      print gromacs.environment.flags.__doc__

  New flags are added with the `Flags.register()` method which takes a new `Flag` instance as an argument.

  For developers: Initialize Flags registry with a list of `Flag` instances.

  `doc`()

    Shows doc strings for all flags.

  `register`(flag)

    Register a new `Flag` instance with the Flags registry.

  `update`(*flags)

    Update Flags registry with a list of `Flag` instances.

class `gromacs.environment.` `Flag`(name, default, mapping=None, doc=None)

  A Flag, essentially a variable that knows its default and legal values.

  Create a new flag which will be registered with FLags.

  > newflag = Flag(name,default,mapping,doc)

    Arguments : | name name of the flag, must be a legal python name default default value mapping dict that maps allowed input values to canonical values; if `None` then no argument checking will be performed and all values are directly set. doc doc string; may contain string interpolation mappings for:
        %%(name)s        name of the flag
        %%(default)r     default value
        %%(value)r       current value
        %%(mapping)r     mapping
  Doc strings are generated dynamically and reflect the current state.

  `prop`()

    Use this for property(**flag.prop())

### Navigation

- index
- modules |
- next |
- previous |
- GromacsWrapper 0.4.0-dev documentation »
- GromacsWrapper package »
- Gromacs core modules »