atomate.common.firetasks package

Submodules

atomate.common.firetasks.glue_tasks module

class atomate.common.firetasks.glue_tasks.CopyFiles(*args, **kwargs)

Bases: fireworks.core.firework.FiretaskBase

Task to copy the given list of files from the given directory to the destination directory. To customize override the setup_copy and copy_files methods.

Optional params:
from_dir (str): path to the directory containing the files to be copied. to_dir (str): path to the destination directory filesystem (str) files_to_copy (list): list of file names. exclude_files (list): list of file names to be excluded.
copy_files()

Defines the copy operation. Override this to customize copying.

optional_params = [u'from_dir', u'to_dir', u'filesystem', u'files_to_copy', u'exclude_files']
run_task(fw_spec)
setup_copy(from_dir, to_dir=None, filesystem=None, files_to_copy=None, exclude_files=None, from_path_dict=None)

setup the copy i.e setup the from directory, filesystem, destination directory etc.

Args:

from_dir (str) to_dir (str) filesystem (str) files_to_copy (list): if None all the files in the from_dir will be copied exclude_files (list) from_path_dict (dict): dict specification of the path. If specified must contain atleast

the key “path” that specifies the path to the from_dir.
class atomate.common.firetasks.glue_tasks.PassCalcLocs(*args, **kwargs)

Bases: fireworks.core.firework.FiretaskBase

Passes information about where the current calculation is located for the next FireWork. This is achieved by passing a key to the fw_spec called “calc_locs” with this information.

Required params:
name (str): descriptive name for this calculation file/dir
Optional params:
filesystem (str or custom user format): name of filesystem. Supports env_chk.
defaults to None
path (str): The path to the directory containing the calculation. defaults to
current working directory.
optional_params = [u'filesystem', u'path']
required_params = [u'name']
run_task(fw_spec)
class atomate.common.firetasks.glue_tasks.PassResult(*args, **kwargs)

Bases: fireworks.core.firework.FiretaskBase

Passes properties and corresponding user-specified data resulting from a run from parent to child fireworks. Uses a string syntax similar to Mongo-style queries to designate values of output file dictionaries to retrieve. For example, one could specify a task to pass the stress from the current calculation using:

PassResult(pass_dict={‘stress’: “>>ionic_steps.-1.stress”})

Required params:
pass_dict (dict): dictionary designating keys and values to pass
to child fireworks. If value is a string beginning with ‘>>’, the firework will search the parsed VASP output dictionary for the designated property by following the sequence of keys separated with periods, e. g. “>>ionic_steps.-1.stress” is used to designate the stress from the last ionic_step. If the value is not a string or does not begin with “>>”, it is passed as is.
parse_class (str): string representation of complete path to a class
with which to parse the output, e. g. pymatgen.io.vasp.Vasprun or pymatgen.io.feff.LDos.from_file, class must be MSONable
parse_kwargs (str): dict of kwargs for the parse class,
e. g. {“filename”: “vasprun.xml”, “parse_dos”: False, “parse_eigen”: False}
Optional params:
calc_dir (str): path to dir that contains VASP output files, defaults
to ‘.’, e. g. current directory
mod_spec_cmd (str): command to issue for mod_spec, e. g. “_set” or “_push”,
defaults to “_set”
mod_spec_key (str): key to pass to mod_spec _set dictmod command, defaults
to “prev_calc_result”
optional_params = [u'calc_dir', u'mod_spec_cmd', u'mod_spec_key']
required_params = [u'pass_dict', u'parse_class', u'parse_kwargs']
run_task(fw_spec)
atomate.common.firetasks.glue_tasks.get_calc_loc(target_name, calc_locs)

This is a helper method that helps you pick out a certain calculation from an array of calc_locs.

There are three modes:
  • If you set target_name to a String, search for most recent calc_loc

    with matching nameget_

  • Otherwise, return most recent calc_loc overall

Args:
target_name: (bool or str) If str, will search for calc_loc with
matching name, else use most recent calc_loc

calc_locs: (dict) The dictionary of all calc_locs

Returns:
(dict) dict with subkeys path, filesystem, and name

atomate.common.firetasks.parse_outputs module

class atomate.common.firetasks.parse_outputs.ToDbTask(*args, **kwargs)

Bases: fireworks.core.firework.FiretaskBase

General task to parse output data via a Drone and either (i) write to JSON file or (ii) insert into a database.

Required params:
drone (AbstractDrone): Drone to convert the data to dict
Optional params:
db_file (str): path to file containing the database credentials. Supports env_chk.
Default is None, which will write data to JSON file.

mmdb (MMDb) (str): If db_file, sets the type of MMDb, e.g. “atomate.vasp.database.MMVaspDb” calc_dir (str): path to dir (on current filesystem) that contains calculation output files.

Default: use current working directory.
calc_loc (str OR bool): if True will set most recent calc_loc. If str search for the most
recent calc_loc with the matching name

options (dict): dict of options to pass into the Drone additional_fields (dict): dict of additional fields to add

optional_params = [u'mmdb', u'db_file', u'calc_dir', u'calc_loc', u'additional_fields', u'options']
required_params = [u'drone']
run_task(fw_spec)

atomate.common.firetasks.run_calc module

class atomate.common.firetasks.run_calc.RunCommand(*args, **kwargs)

Bases: fireworks.core.firework.FiretaskBase

Execute a command directly (no custodian).

Required params:
cmd (str): the name of the full executable to run. Supports env_chk.
Optional params:
expand_vars (str): Set to true to expand variable names in the cmd.
optional_params = [u'expand_vars']
required_params = [u'cmd']
run_task(fw_spec)
class atomate.common.firetasks.run_calc.RunCustodianFromObjects(*args, **kwargs)

Bases: fireworks.core.firework.FiretaskBase

Run VASP using custodian in a generic manner using built-in custodian objects

Required params:
jobs: ([Job]) - a list of custodian jobs to run handlers: ([ErrorHandler]) - a list of error handlers
Optional params:
validators: ([Validator]) - a list of Validators custodian_params ({}) - dict of all other custodian parameters
optional_params = [u'validators', u'custodian_params']
required_params = [u'jobs', u'handlers']
run_task(fw_spec)

Module contents