mispr.gaussian.firetasks package

Submodules

mispr.gaussian.firetasks.geo_transformation module

Define firetasks for performing various molecule transformations.

class mispr.gaussian.firetasks.geo_transformation.AttachFunctionalGroup(*args, **kwargs)[source]

Bases: FiretaskBase

Attach a functional group to a molecule and adds it to fw_spec.

Parameters:
func_grp : str

Name of the functional group (e.g. carboxyl).

index : int

Site index in the molecule at which to attach the functional group.

db : str or dict, optional

Database credentials.

molecule : Molecule, optional

Molecule to attach the functional group to; either provided directly or taken from a previous calculation through fw_spec; priority is given to the latter.

bond_order : int, optional

Bond order to calculate the bond length between the two sites. Defaults to 1.

save_to_db : bool, optional

Whether to save the derived molecule to db.

update_duplicates : bool, optional

Whether to update molecule document in db if it already exists.

save_mol_file : bool, optional

Whether to save the derived molecule to file (xyz, pdb, etc.).

fmt : str, optional

Format of the molecule file to create if save_mol_file is True; uses xyz if not specified.

filename : str, optional

Name of the molecule file to create if save_mol_file is True; will use molecular formula if not specified.

run_task(fw_spec)[source]

This method gets called when the Firetask is run. It can take in a Firework spec, perform some task using that data, and then return an output in the form of a FWAction.

Parameters:
fw_spec : dict

A Firework spec. This comes from the master spec. In addition, this spec contains a special “_fw_env” key that contains the env settings of the FWorker calling this method. This provides for abstracting out certain commands or settings. For example, “foo” may be named “foo1” in resource 1 and “foo2” in resource 2. The FWorker env can specify { “foo”: “foo1”}, which maps an abstract variable “foo” to the relevant “foo1” or “foo2”. You can then write a task that uses fw_spec[“_fw_env”][“foo”] that will work across all these multiple resources.

Returns:

(FWAction)

class mispr.gaussian.firetasks.geo_transformation.BreakMolecule(*args, **kwargs)[source]

Bases: FiretaskBase

Break a molecule into unique fragments (uniqueness is in terms of structure and assigned charge) and creates optimization and frequency Fireworks for each fragment (optional).

credits: Samuel Blau

Parameters:
mol : Molecule, optional

Molecule to break into fragments; can be provided directly or taken from a previous calculation; priority is given to the latter.

bonds : list, optional

List of tuples of the bonds to break; e.g. [(0, 1), (1, 2)] will break the bonds between atoms 0 and 1 and between atoms 1 and 2; if none is specified, will attempt to break all bonds; defaults to None.

ref_charge : int, optional

Charge on the principle molecule; if not provided, charge on Molecule will be used.

fragment_charges : list, optional

List of charges to assign to the fragments in addition to the ones already assigned.

Note

The following charges will be used:
  1. Neutral molecule: each fragment will have charges of 0, 1, and -1

  2. Molecule with charge -N: each fragment will have charges of

    0, -N, -N+1, -N+2

  3. Molecule with charge +N: each fragment will have charges of

    0, N, N-1, N-2

If charges different from the above are provided via fragment_charges, additional fragments with these charges will be created.

open_rings : bool, optional

Whether to open rings; if set to True, will perform local optimization to get a good initial guess for the structure; defaults to False.

opt_steps : int, optional

Number of optimization steps to perform when opening the rings; uses 10000 if not specified.

working_dir : str, optional

Working directory to use for saving any files or running the calculations.

db : str or dict, optional

Database credentials

opt_gaussian_inputs : dict, optional

Dictionary of parameters to use for optimizing the fragments if calc_frags is True.

freq_gaussian_inputs : dict, optional

Dictionary of parameters to use for performing a frequency analysis if calc_frags is True.

cart_coords : bool, optional

Whether to use cartesian coordinates in writing Gaussian input files if calc_frags is True.

oxidation_states : dict, optional

Dictionary of oxidation states that can be used in setting the charge and spin multiplicity of the molecule; e.g.: {“Li”:1, “O”:-2}.

calc_frags : bool, optional

Whether to create optimization and frequency Fireworks for the generated fragments and add them as children via FWAction.

save_to_db : bool, optional

Whether to save the generated fragments to db.

save_to_file : bool, optional

Whether to save the generated fragments to file.

fmt : str, optional

Format of the molecule file to create if save_to_file is True (e.g. xyz, pdb, etc.).

update_duplicates : bool, optional

Whether to update fragment document in the db if it already exists; works only if save_to_db is True.

run_task(fw_spec)[source]

This method gets called when the Firetask is run. It can take in a Firework spec, perform some task using that data, and then return an output in the form of a FWAction.

Parameters:
fw_spec : dict

A Firework spec. This comes from the master spec. In addition, this spec contains a special “_fw_env” key that contains the env settings of the FWorker calling this method. This provides for abstracting out certain commands or settings. For example, “foo” may be named “foo1” in resource 1 and “foo2” in resource 2. The FWorker env can specify { “foo”: “foo1”}, which maps an abstract variable “foo” to the relevant “foo1” or “foo2”. You can then write a task that uses fw_spec[“_fw_env”][“foo”] that will work across all these multiple resources.

Returns:

(FWAction)

class mispr.gaussian.firetasks.geo_transformation.ConvertToMoleculeObject(*args, **kwargs)[source]

Bases: FiretaskBase

Read a molecule from a file, converts it to a Molecule object, and saves it as dict to mongodb.

Parameters:
mol_file : str

Molecule file; supported file formats include xyz|pdb|mol|mdl|sdf|sd|ml2|sy2|mol2|cml|mrv, gaussian input (gjf|g03|g09|com|inp), Gaussian output (.out), and pymatgen’s JSON serialized molecules.

db : str or dict, optional

Database credentials.

save_to_db : bool, optional

Whether to save the processed molecule to db.

update_duplicates : bool, optional

Whether to update molecule document in db if it already exists.

run_task(fw_spec)[source]

This method gets called when the Firetask is run. It can take in a Firework spec, perform some task using that data, and then return an output in the form of a FWAction.

Parameters:
fw_spec : dict

A Firework spec. This comes from the master spec. In addition, this spec contains a special “_fw_env” key that contains the env settings of the FWorker calling this method. This provides for abstracting out certain commands or settings. For example, “foo” may be named “foo1” in resource 1 and “foo2” in resource 2. The FWorker env can specify { “foo”: “foo1”}, which maps an abstract variable “foo” to the relevant “foo1” or “foo2”. You can then write a task that uses fw_spec[“_fw_env”][“foo”] that will work across all these multiple resources.

Returns:

(FWAction)

class mispr.gaussian.firetasks.geo_transformation.LinkMolecules(*args, **kwargs)[source]

Bases: FiretaskBase

Link two molecules using one site from the first and another site from the second molecule and adds the resulting molecule to fw_spec.

Parameters:
index1 : int

site index in the first molecule at which to link the two molecules.

index2 : int

site index in the second molecule at which to link the two molecules.

db : str or dict, optional

Database credentials.

mol1 : Molecule, optional

First molecule; can be provided directly or taken from a previous calculation; priority is given to the latter.

mol2 : Molecule, optional

Second molecule; can be provided directly or taken from a previous calculation; priority is given to the latter.

bond_order : int, optional

Bond order to calculate the bond length between the two sites. Defaults to 1.

save_to_db : bool, optional

Whether to save the derived molecule to db.

update_duplicates : bool, optional

Whether to update molecule document in db if it already exists.

save_mol_file : bool, optional

Whether to save the derived molecule to file (xyz, pdb, etc.).

fmt : str, optional

Format of the molecule file to create if save_mol_file is True; uses xyz if not specified.

filename : str, optional

Name of the molecule file to create if save_mol_file is True; will use molecular formula if not specified.

run_task(fw_spec)[source]

This method gets called when the Firetask is run. It can take in a Firework spec, perform some task using that data, and then return an output in the form of a FWAction.

Parameters:
fw_spec : dict

A Firework spec. This comes from the master spec. In addition, this spec contains a special “_fw_env” key that contains the env settings of the FWorker calling this method. This provides for abstracting out certain commands or settings. For example, “foo” may be named “foo1” in resource 1 and “foo2” in resource 2. The FWorker env can specify { “foo”: “foo1”}, which maps an abstract variable “foo” to the relevant “foo1” or “foo2”. You can then write a task that uses fw_spec[“_fw_env”][“foo”] that will work across all these multiple resources.

Returns:

(FWAction)

class mispr.gaussian.firetasks.geo_transformation.ProcessMoleculeInput(*args, **kwargs)[source]

Bases: FiretaskBase

Process a molecule and generates a Molecule object. Used for handling different molecule formats provided to Gaussian workflows.

Parameters:
mol : Molecule, str, GaussianOutput, dict

Source of the structure; should correspond to that of the operation_type; see mispr.gaussian.utilities.mol.process_mol for more details; besides the formats supported by mispr.gaussian.utilities.mol.process_mol, if the molecule is to be obtained via fw_spec, mol should be a string corresponding to the key in fw_spec.

operation_type : str, optional

Type of operation to perform. See mispr.gaussian.utilities.mol.process_mol for details of supported types.

db : str or dict, optional

Database credentials; could be provided as the path to the db.json file or in the form of a dictionary; if none is provided, attempts to get it from the configuration files.

save_to_db : bool, optional

Whether to save the processed molecule to the molecules collection in the db.

charge : int, optional

Charge of the molecule.

update_duplicates : bool, optional

Whether to update molecule document in the db if it already exists.

save_to_file : bool, optional

Whether to save the processed molecule to a file.

fmt : str, optional

Molecule file format if save_to_file is True. Defaults to xyz.

filename : str, optional

Name of the file to save the molecule to if save_to_file is True. Defaults to molecular formula.

from_fw_spec : bool, optional

Whether to get the molecule from the fw_spec; mol in this case is the key to the dict in fw_spec.

local_opt : bool, optional

Whether to perform local optimization on the molecule.

force_field : str, optional

Force field to use for local optimization; see mispr.gaussian.utilities.mol.process_mol for supported force field types.

steps : int, optional

Number of steps to perform local optimization.

str_type : str, optional

format of string if operation_type is get_from_str; e.g. smi or any other format supported by OpenBabel).

working_dir : str, optional

Working directory to save the molecule file to or read input files from.

run_task(fw_spec)[source]

This method gets called when the Firetask is run. It can take in a Firework spec, perform some task using that data, and then return an output in the form of a FWAction.

Parameters:
fw_spec : dict

A Firework spec. This comes from the master spec. In addition, this spec contains a special “_fw_env” key that contains the env settings of the FWorker calling this method. This provides for abstracting out certain commands or settings. For example, “foo” may be named “foo1” in resource 1 and “foo2” in resource 2. The FWorker env can specify { “foo”: “foo1”}, which maps an abstract variable “foo” to the relevant “foo1” or “foo2”. You can then write a task that uses fw_spec[“_fw_env”][“foo”] that will work across all these multiple resources.

Returns:

(FWAction)

class mispr.gaussian.firetasks.geo_transformation.RetrieveMoleculeObject(*args, **kwargs)[source]

Bases: FiretaskBase

Retrieve a molecule object from the database using InChI as an identifier and add it to the fw_spec.

Parameters:
inchi : str

InChI string.

db : str or dict, optional

Database credentials.

save_mol_file : bool, optional

Whether to save the retrieved molecule to file.

fmt : str, optional

Format of the molecule file to create if save_mol_file is True. Defaults to xyz.

filename : str

Name of the molecule file to create if save_mol_file is True; will use molecular formula if not specified.

run_task(fw_spec)[source]

This method gets called when the Firetask is run. It can take in a Firework spec, perform some task using that data, and then return an output in the form of a FWAction.

Parameters:
fw_spec : dict

A Firework spec. This comes from the master spec. In addition, this spec contains a special “_fw_env” key that contains the env settings of the FWorker calling this method. This provides for abstracting out certain commands or settings. For example, “foo” may be named “foo1” in resource 1 and “foo2” in resource 2. The FWorker env can specify { “foo”: “foo1”}, which maps an abstract variable “foo” to the relevant “foo1” or “foo2”. You can then write a task that uses fw_spec[“_fw_env”][“foo”] that will work across all these multiple resources.

Returns:

(FWAction)

mispr.gaussian.firetasks.parse_outputs module

Define firetasks for parsing Gaussian output files.

class mispr.gaussian.firetasks.parse_outputs.BDEtoDB(*args, **kwargs)[source]

Bases: FiretaskBase

Enter a bond dissociation energy calculation into the database. The calculation can correspond to one or more bonds in the same molecule.

Parameters:
principle_mol_key : str, optional

Key of the Gaussian run corresponding to the principle molecule in the fw_spec.

db : str or dict, optional

Database credentials to store the run; could be provided as the path to the “db.json” file or in the form of a dictionary.

save_to_db : bool, optional

Whether to insert the BDE dict to the BDE collection in the db.

save_to_file : bool, optional

Whether to save the BDE dict to a json file; if True, will save to a file named “bde.json”.

solvent_gaussian_inputs : str, optional

Gaussian inputs for the implicit solvent model to add to the BDE dict, if any.

solvent_properties : dict, optional

Implicit solvent properties to add to the final BDE dict, if any.

additional_prop_doc_fields : dict, optional

Additional fields to add to the final BDE dict.

visualize : bool, optional

Whether to create a bar plot of the BDE results along with the 2D structure of the principle molecule with highlighted broken bonds.

color : tuple, optional

RGB color to use for highlighting the broken bonds in the molecule; e.g. (0.0, 0.0, 0.0) for black; if not provided, will use (197 / 255, 237 / 255, 223 / 255, 1).

run_task(fw_spec)[source]

This method gets called when the Firetask is run. It can take in a Firework spec, perform some task using that data, and then return an output in the form of a FWAction.

Parameters:
fw_spec : dict

A Firework spec. This comes from the master spec. In addition, this spec contains a special “_fw_env” key that contains the env settings of the FWorker calling this method. This provides for abstracting out certain commands or settings. For example, “foo” may be named “foo1” in resource 1 and “foo2” in resource 2. The FWorker env can specify { “foo”: “foo1”}, which maps an abstract variable “foo” to the relevant “foo1” or “foo2”. You can then write a task that uses fw_spec[“_fw_env”][“foo”] that will work across all these multiple resources.

Returns:

(FWAction)

class mispr.gaussian.firetasks.parse_outputs.BindingEnergytoDB(*args, **kwargs)[source]

Bases: FiretaskBase

Enter a binding energy run into the database. The binding energy value is in eV.

Parameters:
index : list

List of indices of the two sites in the molecules at which they are expected to bind.

keys : list

List of keys of Gaussian runs in fw_spec to use in building the binding energy document; e.g. these keys could correspond to set of optimization and frequency jobs leading to the final result.

db : str or dict, optional

Database credentials to store the run; could be provided as the path to the “db.json” file or in the form of a dictionary.

save_to_db : bool, optional

Whether to insert the binding energy dict to the binding energy collection in the db.

save_to_file : bool, optional

Whether to save the binding energy dict to a json file; if True, will save to a file named “binding_energy.json”.

additional_prop_doc_fields : dict, optional

Additional fields to add to the final binding energy dict.

solvent_gaussian_inputs : str, optional

Gaussian inputs for the implicit solvent model to add to the final binding energy dict, if any.

solvent_properties : dict, optional

Implicit solvent properties to add to the final binding energy dict, if any.

run_task(fw_spec)[source]

This method gets called when the Firetask is run. It can take in a Firework spec, perform some task using that data, and then return an output in the form of a FWAction.

Parameters:
fw_spec : dict

A Firework spec. This comes from the master spec. In addition, this spec contains a special “_fw_env” key that contains the env settings of the FWorker calling this method. This provides for abstracting out certain commands or settings. For example, “foo” may be named “foo1” in resource 1 and “foo2” in resource 2. The FWorker env can specify { “foo”: “foo1”}, which maps an abstract variable “foo” to the relevant “foo1” or “foo2”. You can then write a task that uses fw_spec[“_fw_env”][“foo”] that will work across all these multiple resources.

Returns:

(FWAction)

class mispr.gaussian.firetasks.parse_outputs.ESPtoDB(*args, **kwargs)[source]

Bases: FiretaskBase

Enter an ESP run into the database.

Parameters:
keys : list

List of keys of Gaussian runs in fw_spec to use in building the ESP document; e.g. these keys could correspond to optimization, frequency, and ESP jobs leading to the final result.

db : str or dict, optional

Database credentials to store the run; could be provided as the path to the “db.json” file or in the form of a dictionary.

save_to_db : bool, optional

Whether to insert the ESP dict to the ESP collection in the db.

save_to_file : bool, optional

Whether to save the ESP dict to a json file; if True, will save to a file named “esp.json”.

additional_prop_doc_fields : dict, optional

Additional fields to add to the final ESP dict.

solvent_gaussian_inputs : str, optional

Gaussian inputs for the implicit solvent model to add to the final ESP dict, if any.

solvent_properties : dict, optional

Implicit solvent properties to add to the final ESP dict, if any.

run_task(fw_spec)[source]

This method gets called when the Firetask is run. It can take in a Firework spec, perform some task using that data, and then return an output in the form of a FWAction.

Parameters:
fw_spec : dict

A Firework spec. This comes from the master spec. In addition, this spec contains a special “_fw_env” key that contains the env settings of the FWorker calling this method. This provides for abstracting out certain commands or settings. For example, “foo” may be named “foo1” in resource 1 and “foo2” in resource 2. The FWorker env can specify { “foo”: “foo1”}, which maps an abstract variable “foo” to the relevant “foo1” or “foo2”. You can then write a task that uses fw_spec[“_fw_env”][“foo”] that will work across all these multiple resources.

Returns:

(FWAction)

class mispr.gaussian.firetasks.parse_outputs.IPEAtoDB(*args, **kwargs)[source]

Bases: FiretaskBase

Insert a redox potential run into the database. Save both Gibbs free energies and redox potentials. If a calculation is performed in multiple steps, will save all intermediate energies.

Parameters:
num_electrons : int

Number of electrons transferred.

states : list

List of states used in the calculation; e.g. [“cation”] for oxidation, [“anion”] for reduction, or [“cation”, “anion”] for oxidation and reduction calculations.

phases : list

List of phases to involved in the calculations; e.g. [“solution”] for liquid phase, [“gas”] for gas phase, or [“gas”, “solution”] for the full thermodynamic cycle.

steps : str

Whether the redox potential calculation is performed in a single or multi step electron transfer process.

root_node_key : str

Key of the Gaussian run corresponding to the root node in fw_spec.

keys : list

List of keys of Gaussian runs in fw_spec to use in building the redox potential document; e.g. these keys could correspond to set of optimization and frequency jobs leading to the final result.

pcet : bool

Whether a PCET calculation is performed.

vertical : bool

Whether a vertical IP/EA calculation is performed.

db : str or dict, optional

Database credentials to store the run; could be provided as the path to the “db.json” file or in the form of a dictionary.

save_to_db : bool, optional

Whether to insert the redox potential dict to the redox potential collection in the db.

save_to_file : bool, optional

Whether to save the redox potential dict to a json file; if True, will save to a file named “ip_ea.json”.

solvent_gaussian_inputs : str, optional

Gaussian inputs for the implicit solvent model to add to the redox potential dict, if any.

solvent_properties : dict, optional

Implicit solvent properties to add to the final redox potential dict, if any.

electrode_potentials : dict, optional

Dictionary of additional electrode potentials to be used in converting the absolute oxidation and reduction potentials to commonly used potential scales; note that the hydrogen, lithium, and magnesium scales are already included; the dictionary should be in the form:

{
 "<metal>": {
            "potential": <float>,
            "ref": bibtex_parser("<ref_bib_file>", dir),
        }
}

Note

bibtexparser needs to be imported from mispr.gaussian.utilities.files.

additional_prop_doc_fields : dict, optional

Additional fields to add to the final redox potential dict.

gibbs_elec : float, optional

The electron gibbs free energy in Hartree.

gibbs_h : float, optional

The hydrogen gibbs free energy in Hartree.

run_task(fw_spec)[source]

This method gets called when the Firetask is run. It can take in a Firework spec, perform some task using that data, and then return an output in the form of a FWAction.

Parameters:
fw_spec : dict

A Firework spec. This comes from the master spec. In addition, this spec contains a special “_fw_env” key that contains the env settings of the FWorker calling this method. This provides for abstracting out certain commands or settings. For example, “foo” may be named “foo1” in resource 1 and “foo2” in resource 2. The FWorker env can specify { “foo”: “foo1”}, which maps an abstract variable “foo” to the relevant “foo1” or “foo2”. You can then write a task that uses fw_spec[“_fw_env”][“foo”] that will work across all these multiple resources.

Returns:

(FWAction)

class mispr.gaussian.firetasks.parse_outputs.NMRtoDB(*args, **kwargs)[source]

Bases: FiretaskBase

Enter an NMR run into the database.

Parameters:
keys : list

List of keys of Gaussian runs in fw_spec to use in building the NMR document; e.g. these keys could correspond to optimization, frequency, and NMR jobs leading to the final result.

db : str or dict, optional

Database credentials to store the run; could be provided as the path to the db.json file or in the form of a dictionary.

save_to_db : bool, optional

Whether to insert the NMR dict to the NMR collection in the db.

save_to_file : bool, optional

Whether to save the NMR dict to a json file; if True, will save to a file named “nmr.json”.

additional_prop_doc_fields : dict, optional

Additional fields to add to the final NMR dict.

solvent_gaussian_inputs : str, optional

Gaussian inputs for the implicit solvent model to add to the final NMR dict, if any.

solvent_properties : dict, optional

Implicit solvent properties to add to the final NMR dict, if any.

run_task(fw_spec)[source]

This method gets called when the Firetask is run. It can take in a Firework spec, perform some task using that data, and then return an output in the form of a FWAction.

Parameters:
fw_spec : dict

A Firework spec. This comes from the master spec. In addition, this spec contains a special “_fw_env” key that contains the env settings of the FWorker calling this method. This provides for abstracting out certain commands or settings. For example, “foo” may be named “foo1” in resource 1 and “foo2” in resource 2. The FWorker env can specify { “foo”: “foo1”}, which maps an abstract variable “foo” to the relevant “foo1” or “foo2”. You can then write a task that uses fw_spec[“_fw_env”][“foo”] that will work across all these multiple resources.

Returns:

(FWAction)

class mispr.gaussian.firetasks.parse_outputs.ProcessRun(*args, **kwargs)[source]

Bases: FiretaskBase

Process Gaussian output files from a single run. Enters the run to db and/or create a summary json file.

Parameters:
run : GaussianOutput, str, dict

The actual Gaussian run; type depends on the operation_type.

operation_type : str, optional

Type of operation to be performed; refer to mispr.gaussian.utilities.gout.process_run for supported ones.

db : str or dict, optional

Database credentials to store the run; could be provided as the path to the db.json file or in the form of a dictionary.

save_to_db : bool, optional

Whether to save the run to db.

save_to_file : bool, optional

Whether to save the run to a json file.

filename : str, optional

Name of the json file to save the run to; uses “run.json” if not provided.

input_file : str, optional

The input file for the run; used for adding Gaussian input parameters to the final Gaussian dictionary; if not specified, will get these parameters from the run itself, but in this case, “input_parameters” usually specified at the end of the Gaussian input file will not be saved since they are not easily retrieved from the Gaussian output file.

gout_key : str, optional

The key to use for the run in the mod_spec dict passed to FWAction; used when contents of the run are needed in other tasks.

format_chk : bool, optional

Whether to create a formatted check file from the Gaussian checkpoint file.

formchk_cmd : str, optional

The full command to use for formatting the checkpoint file; if not provided, will attempt to find one in the configuration files.

run_task(fw_spec)[source]

This method gets called when the Firetask is run. It can take in a Firework spec, perform some task using that data, and then return an output in the form of a FWAction.

Parameters:
fw_spec : dict

A Firework spec. This comes from the master spec. In addition, this spec contains a special “_fw_env” key that contains the env settings of the FWorker calling this method. This provides for abstracting out certain commands or settings. For example, “foo” may be named “foo1” in resource 1 and “foo2” in resource 2. The FWorker env can specify { “foo”: “foo1”}, which maps an abstract variable “foo” to the relevant “foo1” or “foo2”. You can then write a task that uses fw_spec[“_fw_env”][“foo”] that will work across all these multiple resources.

Returns:

(FWAction)

class mispr.gaussian.firetasks.parse_outputs.RetrieveGaussianOutput(*args, **kwargs)[source]

Bases: FiretaskBase

Get a Gaussian output dict from fw_spec or the database, convert it to a GaussianInput object, and add it to fw_spec.

Parameters:
db : str or dict, optional

Database credentials; could be provided as the path to the db.json file or in the form of a dictionary.

gaussian_input_params : dict, optional

Parameters to use in creating the GaussianInput object; if not provided, will use the ones in the passed or retrieved Gaussian output dict.

run_id : str, optional

ID of the run to retrieve from the database; e.g. “5e3737d9da0b1cbbd5d556f7”.

inchi : str, optional

InChI of the molecule; used as a query criteria to retrieve the run from the db.

functional : str, optional

Density functional of the run in the db; used as a query criteria.

basis : str, optional

Basis set of the run in the db; used as a query criteria.

type : str, optional

Type of the Gaussian job run in the db; e.g. “opt” or “freq”; used as a query criteria.

phase : str, optional

Phase of the run in the db; e.g. “gas” or “solution”; used as a query criteria.

tag : str, optional

Tag of the run in the db; used as a query criteria.

run_task(fw_spec)[source]

This method gets called when the Firetask is run. It can take in a Firework spec, perform some task using that data, and then return an output in the form of a FWAction.

Parameters:
fw_spec : dict

A Firework spec. This comes from the master spec. In addition, this spec contains a special “_fw_env” key that contains the env settings of the FWorker calling this method. This provides for abstracting out certain commands or settings. For example, “foo” may be named “foo1” in resource 1 and “foo2” in resource 2. The FWorker env can specify { “foo”: “foo1”}, which maps an abstract variable “foo” to the relevant “foo1” or “foo2”. You can then write a task that uses fw_spec[“_fw_env”][“foo”] that will work across all these multiple resources.

Returns:

(FWAction)

mispr.gaussian.firetasks.run_calc module

Define firetasks for running Gaussian calculations.

class mispr.gaussian.firetasks.run_calc.RunGaussianCustodian(*args, **kwargs)[source]

Bases: FiretaskBase

Run Gaussian using custodian.

Parameters:
input_file : str, optional

Name of the Gaussian input file.

output_file : str, optional

Name of the Gaussian output file.

gaussian_cmd : str, optional

Name of the full executable to run; if not provided, will attempt to find the command in the config file.

stderr_file : str, optional

Name of the file to direct standard error to.

job_type : str, optional

Type of job to run; supported options are (1) normal and (2) better_guess. Defaults to “normal”.

backup : bool, optional

Whether to backup the initial input file; if True, the input will be copied with a “.orig” appended. Defaults to True.

scf_max_cycles : int, optional

Maximum number of SCF cycles to run; defaults to 100.

opt_max_cycles : int, optional

Maximum number of optimization cycles to run; defaults to 100.

cart_coords : bool, optional

Whether to use cartesian coordinates; defaults to True.

max_errors : int, optional

Maximum number of errors to handle before giving up. Defaults to the number specified in mispr.gaussian.defaults.py.

lower_functional : str, optional

Lower level of theory to use if the optimization fails and job_type is set to “better_guess; this will attempt to generate a better initial guess of the geometry before running the job again at the higher level of theory.

lower_basis_set : str, optional

Less expensive basis set to use if the optimization fails and job_type is set to “better_guess; this will attempt to generate a better initial guess of the geometry before running the job again at the higher level of theory.

prefix : str, optional

Prefix to the files. Defaults to error, which means a series of error.1.tar.gz, error.2.tar.gz, … will be generated.

suffix : str, optional

A suffix to be appended to the final output; e.g., to rename all Gaussian output from mol.out to mol.out.1, provide “.1” as the suffix.

check_convergence : bool, optional

Whether to check convergence in an optimization job; this will also generate a plot with the convergence criteria as a function of the number of iterations. Defaults to True.

wall_time : int, optional

Wall time set to the job in seconds; if provided, will add the WallTimeErrorHandler, which will restart the job if it hits the wall time limit.

buffer_time : int, optional

Buffer time set to the job in seconds; if provided; if the remaining time for the job = buffer_time, the WallTimeErrorHandler will cancel the job and restart it; this is done because if the job hits wall time on its own and is cancelled, it will no longer be possible to restart it. Defaults to 300 seconds.

max_wall_time_corrections : int, optional

Maximum number of wall time corrections to make. Defaults to 3.

run_task(fw_spec)[source]

This method gets called when the Firetask is run. It can take in a Firework spec, perform some task using that data, and then return an output in the form of a FWAction.

Parameters:
fw_spec : dict

A Firework spec. This comes from the master spec. In addition, this spec contains a special “_fw_env” key that contains the env settings of the FWorker calling this method. This provides for abstracting out certain commands or settings. For example, “foo” may be named “foo1” in resource 1 and “foo2” in resource 2. The FWorker env can specify { “foo”: “foo1”}, which maps an abstract variable “foo” to the relevant “foo1” or “foo2”. You can then write a task that uses fw_spec[“_fw_env”][“foo”] that will work across all these multiple resources.

Returns:

(FWAction)

class mispr.gaussian.firetasks.run_calc.RunGaussianDirect(*args, **kwargs)[source]

Bases: FiretaskBase

Execute a command directly for running Gaussian (no custodian).

Parameters:
input_file : str, optional

Name of the Gaussian input file.

output_file : str, optional

Name of the Gaussian output file.

gaussian_cmd : str, optional

Name of the full executable to run; if not provided, will attempt to find the command in the config file.

run_task(fw_spec)[source]

This method gets called when the Firetask is run. It can take in a Firework spec, perform some task using that data, and then return an output in the form of a FWAction.

Parameters:
fw_spec : dict

A Firework spec. This comes from the master spec. In addition, this spec contains a special “_fw_env” key that contains the env settings of the FWorker calling this method. This provides for abstracting out certain commands or settings. For example, “foo” may be named “foo1” in resource 1 and “foo2” in resource 2. The FWorker env can specify { “foo”: “foo1”}, which maps an abstract variable “foo” to the relevant “foo1” or “foo2”. You can then write a task that uses fw_spec[“_fw_env”][“foo”] that will work across all these multiple resources.

Returns:

(FWAction)

class mispr.gaussian.firetasks.run_calc.RunGaussianFake(*args, **kwargs)[source]

Bases: FiretaskBase

Run a fake Gaussian calculation.

Parameters:
ref_dir : str

Path to reference Gaussian run directory with input and output files in the folder.

working_dir : str, optional

Directory where the fake calculation will be run.

input_file : str, optional

Name of the input file (both reference input and new input). Defaults to mol.com.

tolerance : float, optional

Tolerance for the comparison of the reference and user input file. Defaults to 0.0001.

run_task(fw_spec)[source]

This method gets called when the Firetask is run. It can take in a Firework spec, perform some task using that data, and then return an output in the form of a FWAction.

Parameters:
fw_spec : dict

A Firework spec. This comes from the master spec. In addition, this spec contains a special “_fw_env” key that contains the env settings of the FWorker calling this method. This provides for abstracting out certain commands or settings. For example, “foo” may be named “foo1” in resource 1 and “foo2” in resource 2. The FWorker env can specify { “foo”: “foo1”}, which maps an abstract variable “foo” to the relevant “foo1” or “foo2”. You can then write a task that uses fw_spec[“_fw_env”][“foo”] that will work across all these multiple resources.

Returns:

(FWAction)

mispr.gaussian.firetasks.write_inputs module

Define firetasks for writing Gaussian input files.

class mispr.gaussian.firetasks.write_inputs.WriteInput(*args, **kwargs)[source]

Bases: FiretaskBase

Write Gaussian input file for a molecule/cluster in the current working directory.

Parameters:
gaussian_input : GaussianInput, optional

A GaussianInput object to be written to a file; can either be provided directly or passed through fw_spec; if both are provided, will take the one provided directly.

molecule : Molecule, optional

A Molecule object to be used in creating Gaussian input file; can be provided as an optional parameter or passed through fw_spec; if both are provided, will check if their graphs are isomorphic; if they are isomorphic, will use the molecule passed through fw_spec, otherwise will take the user input; note that molecule is ignored if a gaussian_input is available.

gaussian_input_params : dict, optional

A dictionary of parameters to be used in creating the Gaussian input file; ignored if a gaussian_input is provided.

input_file : str, optional

Name of the input file to be written; default is “mol.com”.

cart_coords : bool, optional

Whether to write cartesian coordinates or not; default is True.

oxidation_states : dict, optional

A dictionary of element symbols and their oxidation states used in setting the charge on the molecule.

run_task(fw_spec)[source]

This method gets called when the Firetask is run. It can take in a Firework spec, perform some task using that data, and then return an output in the form of a FWAction.

Parameters:
fw_spec : dict

A Firework spec. This comes from the master spec. In addition, this spec contains a special “_fw_env” key that contains the env settings of the FWorker calling this method. This provides for abstracting out certain commands or settings. For example, “foo” may be named “foo1” in resource 1 and “foo2” in resource 2. The FWorker env can specify { “foo”: “foo1”}, which maps an abstract variable “foo” to the relevant “foo1” or “foo2”. You can then write a task that uses fw_spec[“_fw_env”][“foo”] that will work across all these multiple resources.

Returns:

(FWAction)

Module contents