fireworks.user_objects.firetasks package — FireWorks 1.4.4 documentation

# fireworks.user_objects.firetasks package

## Subpackages

- fireworks.user_objects.firetasks.tests package
  - Submodules
  - fireworks.user_objects.firetasks.tests.test_fileio_tasks module
  - fireworks.user_objects.firetasks.tests.test_filepad_tasks module
  - fireworks.user_objects.firetasks.tests.test_script_task module
  - fireworks.user_objects.firetasks.tests.test_templatewriter_task module
  - Module contents

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

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

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

  Parameters: | 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 (else optional)

  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>, u'cp': <function copy>, u'copy2': <function copy2>, u'move': <function move>, u'mv': <function move>, u'copytree': <function copytree>, u'copy': <function copy>}
  `optional_params` = [u'server', u'user', u'key_filename', u'max_retry', u'retry_delay']
  `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.filepad_tasks module

class `fireworks.user_objects.firetasks.filepad_tasks.` `AddFilesTask`(*args, **kwargs)

  Bases: `fireworks.core.firework.FiretaskBase`

  A Firetask to add files to the filepad.

  Required params:
    - paths (list/str): either list of paths or a glob pattern string.
  Optional params:
    - identifiers ([str]): list of identifiers, one for each file in the paths list
    - directory (str): path to directory where the pattern matching is to be done.
    - filepad_file (str): path to the filepad db config file
    - compress (bool): whether or not to compress the file before inserting to gridfs
    - metadata (dict): metadata to store along with the file, stored in ‘metadata’ key
  `optional_params` = [u'identifiers', u'directory', u'filepad_file', u'compress', u'metadata']
  `required_params` = [u'paths']
  `run_task`(fw_spec)

class `fireworks.user_objects.firetasks.filepad_tasks.` `DeleteFilesTask`(*args, **kwargs)

  Bases: `fireworks.core.firework.FiretaskBase`

  A Firetask to delete files from the filepad

  Required params:
    - identifiers ([str]): identifiers of files to delete
  Optional params:
    - filepad_file (str): path to the filepad db config file
  `optional_params` = [u'filepad_file']
  `required_params` = [u'identifiers']
  `run_task`(fw_spec)

class `fireworks.user_objects.firetasks.filepad_tasks.` `GetFilesTask`(*args, **kwargs)

  Bases: `fireworks.core.firework.FiretaskBase`

  A Firetask to fetch files from the filepad and write it to specified directory(current working directory if not specified)

  Required params:
    - identifiers ([str]): identifiers of files to fetch
  Optional params:
    - filepad_file (str): path to the filepad db config file
    - dest_dir (str): destination directory, default is the current working directory
    - new_file_names ([str]): if provided, the retrieved files will be renamed
  `optional_params` = [u'filepad_file', u'dest_dir', u'new_file_names']
  `required_params` = [u'identifiers']
  `run_task`(fw_spec)

`fireworks.user_objects.firetasks.filepad_tasks.` `get_fpad`(fpad_file)

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

  Parameters: | 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`

  classmethod `from_dict`(m_dict)
  `to_dict`()

class `fireworks.user_objects.firetasks.unittest_tasks.` `TestSerializer`(a, m_date)

  Bases: `fireworks.utilities.fw_serializers.FWSerializable`

  classmethod `from_dict`(m_dict)
  `to_dict`(*args, **kwargs)

## Module contents