woom.workflow.Workflow

woom.workflow.Workflow#

class woom.workflow.Workflow(cfgfile, taskmanager)[source]#
__init__(cfgfile, taskmanager)[source]#

Initialize a workflow

Parameters:
  • cfgfile (str or configobj.ConfigObj) – Path to workflow configuration file or configuration object

  • taskmanager (TaskManager) – Task manager instance

Attributes

config

Workflow ConfigObj configuration instance

context

Context to be used for rendering

cycles

List of Cycle

host

Current Host instance

jobmanager

Current job manager instance

members

List of Member

nmembers

Number of ensemble members

output_directories

paths

dict of standard paths that must be prepended

submission_dirs

Generator of submission directories computed from the task tree

task_tree

Current TaskTree

taskmanager

Current TaskManager instance

workflow_dir

Where we are running the workflow

Methods

clean([submission_dirs, log_files, ...])

Remove working files and directories

clean_task(task_name[, cycle, member])

Remove job specific files for this task

fill_templates()

Fill template file of a task in a context

get_app_path([sep])

Typically app/conf/exp or ''

get_artifacts([task_name, cycle, member])

Get artifacts as a pandas.DataFrame

get_context([task_name, cycle, member, ...])

Get an instance of woom.context.Context task rendering

get_cycle(cycle)

Get a valid Cycle instance from a token string

get_member(member)

Get a valid Member instance from its :attr:`~woom.iters.Member.label ` string .

get_run_dirs()

Get the run directories as pandas.DataFrame

get_status([running, colorize])

Get the workflow task status as a pandas.DataFrame

get_submission_dirs()

Get the submission directories as pandas.DataFrame

get_task(task_name)

Shortcut to self.taskmanager.get_task(task_name)

get_task_artifact_paths(artifact_name, task_name)

Get the paths of an artifact of a given task across cycles and members

get_task_artifacts(task_name[, cycle, ...])

Get the paths of all artifacts of a given task across cycles and members

get_task_cycle(task_name, cycle)

Like get_cycle() but check that it is compatible with a given task

get_task_items(getter, task_name[, cycle, ...])

Loop on cycles and members to retreive task items

get_task_member(task_name, member)

Like get_member() but check that it is compatible with a given task

get_task_members(task_name)

Get the list of members if applicable or None

get_task_path(task_name[, cycle, member, sep])

Concatenate the app_path, the cycle and, task_name and the member label

get_task_run_dir(task_name[, cycle, member, ...])

Get where the command lines are executed in the script

get_task_status(task_name[, cycle, member])

Get the job status of a task

get_task_submission_dir(task_name[, cycle, ...])

Where the batch script is created and submitted

is_task_blocking(task_name)

Is this task blocking?

is_task_skipped(task_name)

Is this task skipped?

kill([jobid, task_name, cycle, member])

Kill all running jobs specific to this workflow

run([dry, force, skip])

Run the workflow by submiting all tasks

set_context([task_name, cycle, member, ...])

Get and set the context used for rendering

show_artifacts([tablefmt])

Show the status of all the tasks of the wokflow

show_overview()

Display an overview of the workflow, like its task tree and cycles

show_run_dirs([tablefmt])

Show the run directory of all the tasks of the wokflow

show_status([running, tablefmt, colorize])

Show the status of all the tasks of the wokflow

show_submission_dirs([tablefmt])

Show the submission directory of all the tasks of the wokflow

submit_sentinel()

Submit a sentinel job that regularly checks the status of all task jobs

submit_task([depend, blocking])

Submit a task

submit_task_fake([depend, blocking])

Don't submit a task, just display it

terminate_blocking_jobs()

Terminate blocking jobs

to_json_entry()