pyviblib.io.writers
index
/usr/lib/python2.4/site-packages/pyviblib/io/writers.py

Module for writing files.
 
The following classes are exported :
    AbstractFileWriter      -- abstract base class for the writers
    FCHKFileWriter          -- Gaussian Formatted Checkpoint files
    VOAVIEWFileWriter       -- VOAVIEW files
    MOLDENFileWriter        -- MOLDEN files
    XMolXYZFileWriter       -- XMol XYZ files
    GaussianInputFileWriter -- Gaussian input files
    HESFileWriter           -- Hessian files of DALTON 1.x or 2.0

 
Modules
       
os

 
Classes
       
__builtin__.object
AbstractFileWriter
FCHKFileWriter
GaussianInputFileWriter
HESFileWriter
MOLDENFileWriter
VOAVIEWFileWriter
XMolXYZFileWriter

 
class AbstractFileWriter(__builtin__.object)
    Abstract base class for all writers.
 
The following protected method is called in the constructor :
    _check_consistency()  -- check the data supplied by the user
 
The following public method is exported :
    write()               -- write the data and close the file
 
Subclasses *must* override these two methods.
Otherwise a NotImplementedError is raised.
 
The following read-only property is exposed :
    filename              -- filename argument supplied in the constructor
 
  Methods defined here:
__init__(self, filename, **data)
Constructor of the class.
 
Positional arguments :
filename -- file name of file object
 
Keyword arguments :    
data     -- data to be written
write(self)
Write the data to a file.
 
Subclasses *must* override the method.
This implementation raises a NotImplementedError.

Data and other attributes defined here:
__dict__ = <dictproxy object>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'AbstractFileWriter' objects>
list of weak references to the object (if defined)

 
class FCHKFileWriter(AbstractFileWriter)
    Writer for Gaussian formatted checkpoint files.
 
The following items are written :
 
Comment
Dummy job line (always 'JobType Method Basis')
Number of atoms
Charge (always '0')
Multiplicity (always '1')
Atomic numbers
Cartesian coordinates
Hessian (if available)
Derivatives of the polarizability tensor     [alpha] (if available)
Derivatives of the optical rotation tensor   [G']    (if available)
Derivatives of the D-Q polarizability tensor [A]     (if available)
Derivatives of the electric dipole moment    [APT]   (if available)
Derivatives of the magnetic dipole moment    [AAT]   (if available)
 
 
Method resolution order:
FCHKFileWriter
AbstractFileWriter
__builtin__.object

Methods defined here:
__init__(self, filename, **data)
Constructor of the class.
 
Positional arguments :
filename -- file name of file object
 
Keyword arguments :    
molecule -- pyviblib.molecule.Molecule (required)
comment  -- comment (default None)
hessian  -- hessian matrix (default None)
write(self)
Write the data.

Data and other attributes inherited from AbstractFileWriter:
__dict__ = <dictproxy object>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'AbstractFileWriter' objects>
list of weak references to the object (if defined)

 
class GaussianInputFileWriter(AbstractFileWriter)
    Writer for Gaussian input files.
 
Example is given bellow :
 
%chk=filebase.chk
%mem=256MB
%nproc=1
# B3LYP/6-31G* OPT
 
molecule_name <generated by PyVib2-version>
 
0 1
atomic coordinates (in angstrom)...
 
 
Method resolution order:
GaussianInputFileWriter
AbstractFileWriter
__builtin__.object

Methods defined here:
__init__(self, filename, **data)
Constructor of the class.
 
Positional arguments :
filename -- file name of file object
 
Keyword arguments :    
molecule -- pyviblib.molecule.Molecule (required)
comment  -- comment
write(self)
Write the data.

Data and other attributes inherited from AbstractFileWriter:
__dict__ = <dictproxy object>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'AbstractFileWriter' objects>
list of weak references to the object (if defined)

 
class HESFileWriter(AbstractFileWriter)
    Writer for hessian files of DALTON 1.x or 2.0 (*.hes).
 
 
Method resolution order:
HESFileWriter
AbstractFileWriter
__builtin__.object

Methods defined here:
__init__(self, filename, **data)
Constructor of the class.
 
Positional arguments :
filename -- file name of file object
 
Keyword arguments :    
hessian  -- hessian matrix (required)
coords   -- cartesian coordinates (required)
inbohr   -- whether coordinates are given in a.u. (default False)
write(self)
Write the data.

Data and other attributes inherited from AbstractFileWriter:
__dict__ = <dictproxy object>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'AbstractFileWriter' objects>
list of weak references to the object (if defined)

 
class MOLDENFileWriter(AbstractFileWriter)
    Writer for MOLDEN files.
 
Currently the cartesian coordinates and the normal modes (if available) are
written.
 
 
Method resolution order:
MOLDENFileWriter
AbstractFileWriter
__builtin__.object

Methods defined here:
__init__(self, filename, **data)
Constructor of the class.
 
Positional arguments :
filename -- file name of file object
 
Keyword arguments :    
molecule -- pyviblib.molecule.Molecule (required)
comment  -- comment
write(self)
Write the data.

Data and other attributes inherited from AbstractFileWriter:
__dict__ = <dictproxy object>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'AbstractFileWriter' objects>
list of weak references to the object (if defined)

 
class VOAVIEWFileWriter(AbstractFileWriter)
    Writer for VOAVIEW files.
 
 
Method resolution order:
VOAVIEWFileWriter
AbstractFileWriter
__builtin__.object

Methods defined here:
__init__(self, filename, **data)
Constructor of the class.
 
Positional arguments :
filename -- file name of file object
 
Keyword arguments :    
molecule -- pyviblib.molecule.Molecule (required)
write(self)
Write the data.

Data and other attributes inherited from AbstractFileWriter:
__dict__ = <dictproxy object>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'AbstractFileWriter' objects>
list of weak references to the object (if defined)

 
class XMolXYZFileWriter(AbstractFileWriter)
    Writer for XMol XYZ files.
 
 
Method resolution order:
XMolXYZFileWriter
AbstractFileWriter
__builtin__.object

Methods defined here:
__init__(self, filename, **data)
Constructor of the class.
 
Positional arguments :
filename -- file name of file object
 
Keyword arguments :    
molecule -- pyviblib.molecule.Molecule (required)
comment  -- comment
write(self)
Write the data.

Data and other attributes inherited from AbstractFileWriter:
__dict__ = <dictproxy object>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'AbstractFileWriter' objects>
list of weak references to the object (if defined)

 
Data
        __all__ = ['AbstractFileWriter', 'FCHKFileWriter', 'VOAVIEWFileWriter', 'MOLDENFileWriter', 'XMolXYZFileWriter', 'GaussianInputFileWriter', 'HESFileWriter']
__author__ = 'Maxim Fedorovsky'

 
Author
        Maxim Fedorovsky