fireworks.user_objects.firetasks package

Submodules

fireworks.user_objects.firetasks.fileio_tasks module

class fireworks.user_objects.firetasks.fileio_tasks.ArchiveDirTask(*args, **kwargs)

Bases: fireworks.core.firework.FireTaskBase

Wrapper around shutil.make_archive to make tar archives.

Args:

base_name (str): Name of the file to create, including the path, minus any

format-specific extension.
format (str): Optional. one of “zip”, “tar”, “bztar” or “gztar”.
Defaults to gztar.
optional_params = [u'format']
required_params = [u'base_name']
run_task(fw_spec)
class fireworks.user_objects.firetasks.fileio_tasks.CompressDirTask(*args, **kwargs)

Bases: fireworks.core.firework.FireTaskBase

Compress all files in a directory.

Args:

dest (str): Optional. Path to compress. compression (str): Optional. Can only be gz or bz2. Defaults to gz. ignore_errors (bool): Optional. Whether to ignore errors. Defaults to

False.
optional_params = [u'compression', u'dest', u'ignore_errors']
run_task(fw_spec)
class fireworks.user_objects.firetasks.fileio_tasks.DecompressDirTask(*args, **kwargs)

Bases: fireworks.core.firework.FireTaskBase

Decompress all files in a directory. Autodetects gz, bz2 and z file extensions.

Args:

dest (str): Optional. Path to decompress. ignore_errors (bool): Optional. Whether to ignore errors. Defaults to

False.
optional_params = [u'dest', u'ignore_errors']
run_task(fw_spec)
class fireworks.user_objects.firetasks.fileio_tasks.FileDeleteTask(*args, **kwargs)

Bases: fireworks.core.firework.FireTaskBase

A FireTask to delete files: Required params:

  • files_to_delete: ([str]) Filenames to delete
Optional params:
  • dest: (str) Shared path for files
  • ignore_errors (bool): Whether to ignore errors. Defaults to True.
required_params = [u'files_to_delete']
run_task(fw_spec)
class fireworks.user_objects.firetasks.fileio_tasks.FileTransferTask(*args, **kwargs)

Bases: fireworks.core.firework.FireTaskBase

A FireTask to Transfer files. Note that Required params:

  • mode: (str) - move, mv, copy, cp, copy2, copytree, copyfile, rtransfer
  • files: ([str]) or ([(str, str)]) - list of source files, or dictionary containing ‘src’ and ‘dest’ keys
  • dest: (str) destination directory, if not specified within files parameter
Optional params:
  • server: (str) server host for remote transfer
  • user: (str) user to authenticate with on remote server
  • key_filename: (str) optional SSH key location for remote transfer
  • max_retry: (int) number of times to retry failed transfers; defaults to 0 (no retries)
  • retry_delay: (int) number of seconds to wait between retries; defaults to 10
fn_list = {u'copyfile': <function copyfile at 0x101d76500>, u'cp': <function copy at 0x101d765f0>, u'copy2': <function copy2 at 0x101d76758>, u'move': <function move at 0x101dc1398>, u'mv': <function move at 0x101dc1398>, u'copytree': <function copytree at 0x101dbdaa0>, u'copy': <function copy at 0x101d765f0>}
required_params = [u'mode', u'files']
run_task(fw_spec)
class fireworks.user_objects.firetasks.fileio_tasks.FileWriteTask(*args, **kwargs)

Bases: fireworks.core.firework.FireTaskBase

A FireTask to write files: Required params:

  • files_to_write: ([{filename:(str), contents:(str)}]) List of dicts with filenames and contents
Optional params:
  • dest: (str) Shared path for files
required_params = [u'files_to_write']
run_task(fw_spec)

fireworks.user_objects.firetasks.script_task module

class fireworks.user_objects.firetasks.script_task.PyTask(*args, **kwargs)

Bases: fireworks.core.firework.FireTaskBase

Runs any python function! Extremely powerful, which allows you to essentially run any accessible method on the system.

Args:
func (str): Fully qualified python method. E.g., json.dump, or shutil
.copy, or some other function that is not part of the standard library!

args (list): List of args. Default is empty. kwargs (dict): Dictionary of keyword args. Default is empty. auto_kwargs (bool): If True, all other params not starting with “_” are supplied as keyword args stored_data_varname (str): Whether to store the output in

FWAction. If this is a string that does not evaluate to False, the output of the function will be stored as FWAction(stored_data={stored_data_varname: output}). The name is deliberately long to avoid potential name conflicts.
optional_params = [u'args', u'kwargs', u'auto_kwargs', u'stored_data_varname']
required_params = [u'func']
run_task(fw_spec)
class fireworks.user_objects.firetasks.script_task.ScriptTask(*args, **kwargs)

Bases: fireworks.core.firework.FireTaskBase

classmethod from_str(shell_cmd, parameters=None)
required_params = [u'script']
run_task(fw_spec)

fireworks.user_objects.firetasks.templatewriter_task module

class fireworks.user_objects.firetasks.templatewriter_task.TemplateWriterTask(*args, **kwargs)

Bases: fireworks.core.firework.FireTaskBase

Task to write templated files via Jinja2 library Required parameters:

  • template_file: (str) - path to template file
  • context: (dict) - variable replacements for the template file
  • output_file: (str) - output file
Optional parameters:
  • append: (bool) - append to output file (instead of overwrite)
  • template_dir: (str) - directory in which to find the template file
run_task(fw_spec)

fireworks.user_objects.firetasks.unittest_tasks module

class fireworks.user_objects.firetasks.unittest_tasks.ExportTestSerializer(a)

Bases: fireworks.utilities.fw_serializers.FWSerializable

__init__(a)
classmethod from_dict(m_dict)
to_dict()
class fireworks.user_objects.firetasks.unittest_tasks.TestSerializer(a, m_date)

Bases: fireworks.utilities.fw_serializers.FWSerializable

__init__(a, m_date)
classmethod from_dict(m_dict)
to_dict(*args, **kwargs)

Module contents