gaussianclasses¶
One of the two core libraries of pyssian. Contains the Classes that represent Gaussian Files (input and output).
- To do:
Create a Class to represent the basis and core electronic pontentials
GaussianInFile¶
Accepts a context manager usage similar to 'with open(file) as F:...'
Does not parse ONIOM calculation inputs
Does not parse MM calculation inputs
Not tested for z-matrix inputs
-
class
pyssian.
GaussianInFile
(file)[source]¶ Gaussian 09/16 .in file parent class, if any special type of input requires different processing it should be a subclass of this one.
- Parameters
file (io.TextIOBase or str) -- File instance (Result of open(filename,'r')) or valid filename.
-
preprocessing
¶ Dictionary in which each key corresponds to a certain Link0 keyword
- Type
dict
-
commandline
¶ Dictionary that contains the information of how the calculation will be carried out.
- Type
dict
-
title
¶ title of the calculation.
- Type
str
-
method
¶ If it cannot be recognized in the command line it will be empty.
- Type
str
-
basis
¶ If it cannot be recognized in the command line it will be empty.
- Type
str
-
spin
¶ - Type
int
-
charge
¶ - Type
int
-
geometry
¶ It should be able to write the text block of an input file upon calling str(geometry)
- Type
str-ish
-
tail
¶ List of str in which each should be separated from the others by a single blank line in the input file.
- Type
list
-
structure
¶ A string holding the structure of the input file. Used to write new Input files.
- Type
str
-
nprocs
¶ property to easily access and change the preprocessing['nprocshared'] value
- Type
int
-
mem
¶ property to easily access and change the preprocessing['mem'] value
- Type
int
-
add_chk
(name=None)[source]¶ Adds the chk to the file, with the specified name. If none is provided defaults to the file name ended in .chk
-
change_basis
(basis)[source]¶ Changes appropiately the basis of the calculation. Running self.basis = basis makes a call to this function.
- Parameters
basis (str) -- A string representation of a valid method if specified in the command line.
- Raises
NotImplementedError -- If the basis is not within the registered basis keywords
-
change_method
(method)[source]¶ Changes appropiately the method of the calculation. Running self.method = method makes a call to this function.
- Parameters
method (str) -- A string representation of a valid method
- Raises
NotImplementedError -- If the method is not within the registered methods keywords
-
parse_commandline
(lines)[source]¶ Parses the lines that contain the calculation commands keywords and transforms them into a dictionary representation.
- Parameters
lines (list) -- list of strings previously stripped. Empty lines will be ignored.
-
parse_geometry
(lines)[source]¶ Parses each line that contains 'Atom x y z' in an appropiate form and saves it to self.geometry
- Parameters
lines (list) -- list of strings previously stripped. Should not contain empty lines
-
parse_preprocessing
(lines)[source]¶ Parses the lines that contain the Link 0 keywords and transforms them into a dictionary representation.
- Parameters
lines (list) -- list of strings previously stripped. Empty lines will be ignored.
-
parse_tail
(lines)[source]¶ Chops the set of lines into different blocks of text using as reference the emptylines/blank lines
- Parameters
lines (list) -- list of strings previously stripped.
- Returns
Description of returned object.
- Return type
type
- Raises
ExceptionName -- Why the exception is raised.
GaussianOutFile¶
Accepts a context manager usage similar to 'with open(file) as F:...'
Will only parse a Gaussian Output File that has the "#p".
-
class
pyssian.
GaussianOutFile
(file, parselist=None)[source]¶ Gaussian 09/16 '.log' file parent class, if any special type of calculation requires different processing it should be a subclass of this one. Accepts a context manager usage similar to 'with open(file) as F:...'
- Parameters
file (io.TextIOBase or str) -- File instance (Result of open(filename,'r')) or valid filename.
parselist (list) -- List of integrers that represent which types of Links to parse (the default is None).
-
InternalJobs
¶ List of InternalJobs done by gaussian i.e an gaussian calculation with the opt freq keywords will run first an InternalJob for the Optimization and after an InternalJob for the Frequency calculation.
-
get_links
(*LinkIds)[source]¶ Wrapper Method to get a list of Links with certain Ids across the different Internal Jobs.
- Parameters
*LinkIds (int) -- Integrers that correspond to the type of links to be return.
- Returns
- Return type
list
-
update
(clean=True, FinalPrint=False)[source]¶ Tries to fetch new data. If it exists it parses it appropiately otherwise it fails silently.
- Parameters
clean (Bool) -- If True removes all the EmptyLinkJobs found (the default is True).
FinalPrint (Bool) -- If True after a normal execution has finished it will print in the console a message to notify the user (the default is False).
InternalJob¶
-
class
pyssian.
InternalJob
(number=None)[source]¶ Gaussian 09/16 InternalJob parent class, if any special type of Job requires different parsing it should be a subclass of this one.
- Parameters
number (int) -- ordinal number of the InternalJob (the default is None).
-
type
¶ string identifier for the job.
-
Links
¶ List of the different Links that belong to the InternalJob.
-
number
¶