Package gromacs :: Module tools :: Class GromacsCommandMultiIndex
[hide private]
[frames] | no frames]

Class GromacsCommandMultiIndex

source code

     object --+        
              |        
   core.Command --+    
                  |    
core.GromacsCommand --+
                      |
                     GromacsCommandMultiIndex
Known Subclasses:

Instance Methods [hide private]
 
__init__(self, **kwargs)
Initialize instance.
source code
 
run(self, *args, **kwargs)
Run the command; make a combined multi-index file if necessary.
source code
 
_fake_multi_ndx(self, **kwargs)
Combine multiple index file into a single one and return appropriate kwargs.
source code
 
__del__(self)
Clean up temporary multi-index files if they were used.
source code

Inherited from core.GromacsCommand: check_failure, transform_args

Inherited from core.Command: Popen, __call__, commandline, help

Inherited from core.Command (private): _commandline

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Class Variables [hide private]

Inherited from core.GromacsCommand: command_name, doc_pattern, failuremodes, gmxfatal_pattern

Properties [hide private]

Inherited from core.GromacsCommand: gmxdoc

Inherited from object: __class__

Method Details [hide private]

__init__(self, **kwargs)
(Constructor)

source code 
Initialize instance.

1) Sets up the combined index file.
2) Inititialize :class:`~gromacs.core.GromacsCommand` with the 
   new index file.

See the documentation for :class:`gromacs.core.GromacsCommand` for details. 

Overrides: object.__init__

run(self, *args, **kwargs)

source code 
Run the command; make a combined multi-index file if necessary.
Overrides: core.Command.run

_fake_multi_ndx(self, **kwargs)

source code 
Combine multiple index file into a single one and return appropriate kwargs.

Calling the method combines multiple index files into a a single
temporary one so that Gromacs tools that do not (yet) support multi
file input for index files can be used transparently as if they did.

If a temporary index file is required then it is deleted once the
object is destroyed.

:Returns:
  The method returns the input keyword arguments with the necessary
  changes to use the temporary index files.

:Keywords: 
   Only the listed keywords have meaning for the method:

   *n* : filename or list of filenames
      possibly multiple index files; *n* is replaced by the name of 
      the temporary index file.
   *s* : filename
      structure file (tpr, pdb, ...) or ``None``; if a structure file is 
      supplied then the Gromacs default index groups are automatically added
      to the temporary indexs file.

:Example: 
   Used in derived classes that replace the standard
   :meth:`run` (or :meth:`__init__`) methods with something like::

      def run(self,*args,**kwargs):
          kwargs = self._fake_multi_ndx(**kwargs)            
          return super(G_mindist, self).run(*args, **kwargs)