Package gromacs :: Package analysis :: Module core :: Class Worker
[hide private]
[frames] | no frames]

Class Worker

source code

         object --+    
                  |    
utilities.FileUtils --+
                      |
                     Worker

Base class for a plugin worker.
Instance Methods [hide private]
 
__init__(self, **kwargs)
Set up Worker class.
source code
 
_register_hook(self, **kwargs)
Things to initialize once the :class:`Simulation` instance is known.
source code
 
topdir(self, *args)
Returns a directory located under the simulation top directory.
source code
 
plugindir(self, *args)
Returns a directory located under the plugin top directory.
source code
 
figdir(self, *args)
Returns a directory under the plugin top directory to store figures in.
source code
 
run(self, **kwargs) source code
 
analyze(self, **kwargs) source code
 
plot(self, **kwargs) source code
 
savefig(self, filename=None, ext='png')
Save the current figure under the default name or filename.
source code
 
store_xvg(self, name, a, **kwargs)
Store array *a* as :class:`~gromacs.formats.XVG` in result *name*.
source code

Inherited from utilities.FileUtils: __repr__, check_file_exists, filename, infix_filename

Inherited from utilities.FileUtils (private): _init_filename

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

Class Variables [hide private]

Inherited from utilities.FileUtils: default_extension

Instance Variables [hide private]
  plugin
:class:`Plugin` instance that owns this Worker.
  plugin_name
Name of the plugin that this Worker belongs to.

Inherited from utilities.FileUtils: real_filename

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, **kwargs)
(Constructor)

source code 
Set up Worker class.

:Keywords:
  *plugin* : instance
     The :class:`Plugin` instance that owns this worker. **Must be supplied.**
  *simulation*
     A :class:Simulation` object, required for registration,
     but can be supplied later.
  *kwargs*
     All other keyword arguments are passed to the super class.

Overrides: object.__init__

_register_hook(self, **kwargs)

source code 
Things to initialize once the :class:`Simulation` instance is known.

The hook is called from :meth:`Plugin.register`.

.. Note:: Subclasses should do all their :class:`Simulation` -
          dependent initialization in their own :meth:`_register_hook` which
          **must** call the super class hook via the :class:`super`
          mechanism.

savefig(self, filename=None, ext='png')

source code 

Save the current figure under the default name or filename.

Uses the supplied format and extension ext.

store_xvg(self, name, a, **kwargs)

source code 
Store array *a* as :class:`~gromacs.formats.XVG` in result *name*.

kwargs are passed to :class:`gromacs.formats.XVG`.

This is a helper method that simplifies the task of storing
results in the form of a numpy array as a data file on disk in
the xmgrace format and also as a :class:`~gromacs.formats.XVG`
instance in the :attr:`gromacs.analysis.core.Worker.results`
dictionary.