core Package

firework Module

A FireWork defines a workflow step.

An FWorkflow connects FireWorks by their fw_ids.

A Launch is a describes a FireWork’s run on a computing resource. The same Launch might apply to multiple FireWorks, e.g. if they are identical.

A FWAction encapsulates the output of that launch.

class fireworks.core.firework.FWAction(command, stored_data=None, mod_spec=None)

TODO: add docs

commands = ['CONTINUE', 'DEFUSE', 'MODIFY', 'DETOUR', 'CREATE', 'PHOENIX', 'BREAK']
classmethod from_dict(*args, **kwargs)
to_dict(*args, **kwargs)
class fireworks.core.firework.FireTaskBase(parameters=None)

Bases: fireworks.utilities.fw_serializers.FWSerializable

TODO: add docs

classmethod from_dict(*args, **kwargs)
run_task(fw)
to_dict(*args, **kwargs)
class fireworks.core.firework.FireWork(tasks, spec=None, fw_id=-1, launches=None, state='WAITING', created_at=None)

Bases: fireworks.utilities.fw_serializers.FWSerializable

classmethod from_dict(*args, **kwargs)
to_db_dict()
to_dict(*args, **kwargs)
class fireworks.core.firework.Launch(fworker, fw_id, launch_dir=None, host=None, ip=None, action=None, start=None, end=None, state=None, launch_id=None)

Bases: fireworks.utilities.fw_serializers.FWSerializable

classmethod from_dict(m_dict)
time_secs
to_db_dict()
to_dict(*args, **kwargs)

fw_constants Module

A set of global constants for FireWorks (Python code as a config file)

fireworks.core.fw_constants.DATETIME_HANDLER(obj)

fworker Module

This module contains classes relevant for a FireWorker (worker computing resource)

class fireworks.core.fworker.FWorker(name='anonymous worker', category='general worker', query=None, params=None)

Bases: fireworks.utilities.fw_serializers.FWSerializable

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

launchpad Module

The LaunchPad manages the FireWorks database.

class fireworks.core.launchpad.LaunchPad(host='localhost', port=27017, name='fireworks', username=None, password=None, logdir=None, strm_lvl=None)

Bases: fireworks.utilities.fw_serializers.FWSerializable

The LaunchPad manages the FireWorks database.

add_wf(wf)
Parameters:wf – a Workflow object.
classmethod from_dict(d)
get_fw_by_id(fw_id)

Given a FireWork id, give back a FireWork object

Parameters:fw_id – FireWork id (int)
Returns:FireWork object
get_fw_ids(query=None, sort=False)

Return all the fw ids that match a query, :param query: a dict representing a Mongo query

get_launch_by_id(launch_id)

Given a Launch id, return details of the Launch

Parameters:launch_id – launch id
Returns:Launch object
get_new_fw_id()

Checkout the next FireWork id

get_new_launch_id()

Checkout the next Launch id

get_wf_by_fw_id(fw_id)

Given a FireWork id, give back the Workflow containing that FireWork :param fw_id: :return: A Workflow object

maintain()
reset(password, require_password=True)

Create a new FireWorks database. This will overwrite the existing FireWorks database! To safeguard against accidentally erasing an existing database, a password must be entered.

Parameters:
  • password – A String representing today’s date, e.g. ‘2012-12-31’
  • require_password – Whether a password is required to reset the DB. Highly recommended to leave this set to True, otherwise you are inviting disaster!
run_exists()

Checks to see if the database contains any FireWorks that are ready to run :return: (T/F)

to_dict()

Note: usernames/passwords are exported as unencrypted Strings!

rocket Module

TODO: add docs

class fireworks.core.rocket.Rocket(launchpad, fworker, fw_id)

The Rocket fetches a workflow step from the FireWorks database and executes it.

run()

Run the rocket (actually check out a job from the database and execute it)

rocket_launcher Module

fireworks.core.rocket_launcher.launch_rocket(launchpad, fworker=None, logdir=None, strm_lvl=None, fw_id=None)

Run a single rocket in the current directory :param launchpad: a LaunchPad object :param fworker: a FWorker object

fireworks.core.rocket_launcher.rapidfire(launchpad, fworker=None, m_dir=None, logdir=None, strm_lvl=None, infinite=False, sleep_time=60)

Keeps running Rockets in m_dir until we reach an error. Automatically creates subdirectories for each Rocket. Usually stops when we run out of FireWorks from the LaunchPad.

Parameters:
  • launchpad – a LaunchPad object
  • fworker – a FWorker object
  • m_dir – the directory in which to loop Rocket running

workflow Module

class fireworks.core.workflow.Workflow(fireworks, links_dict=None, metadata={})

Bases: fireworks.utilities.fw_serializers.FWSerializable

Bases: dict, fireworks.utilities.fw_serializers.FWSerializable

classmethod from_dict(m_dict)
nodes
to_db_dict()
to_dict()
Workflow.apply_action(action, fw_id)
classmethod Workflow.from_FireWork(fw)
classmethod Workflow.from_dict(m_dict)
classmethod Workflow.from_tarfile(tar_filename)
Workflow.refresh(fw_id, updated_ids=None)
Workflow.root_fw_ids
Workflow.to_db_dict()
Workflow.to_dict()
Workflow.to_tarfile(f_name='fwf.tar', f_format='json')

Table Of Contents

This Page