firetasks Package

firetasks Package

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 = ['format']
required_params = ['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:
compression: Optional. Can only be gz or bz2. Defaults to gz.
optional_params = ['compression']
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
required_params = ['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
  • key_filename: (str) optional SSH key location for remote transfer
fn_list = {'copyfile': <function copyfile at 0x105bbb8c0>, 'cp': <function copy at 0x105bbba28>, 'copy2': <function copy2 at 0x105bbbaa0>, 'move': <function move at 0x105bbbcf8>, 'mv': <function move at 0x105bbbcf8>, 'copytree': <function copytree at 0x105bbbb90>, 'copy': <function copy at 0x105bbba28>}
required_params = ['mode', '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 = ['files_to_write']
run_task(fw_spec)

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. 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.

All other params not starting with “_” are supplied as keyword args to the Python method.

optional_params = ['args', 'stored_data_varname']
required_params = ['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 = ['script']
run_task(fw_spec)

templatewriter_task Module

This module contains the TemplateWriterTask, which writes files based on a template file and a Context using Jinja2’s templating engine.

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)

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)

Table Of Contents

This Page