Workflow

Work flow module that could add pre and post functions to workflows

jobbergate.workflow.logic(func=None, *, name=None, prepost=None)

A decorator that registers functions as either pre or post to workflows.

Parameters:name – (optional) Descriptive name that is used when choosing workflow

Hooking a pre-function to eigen implicit by function name:

# Hooking pre function to `eigen` implicit by function name
@logic
def pre_eigen(data):
    print("Pre function to `eigen` questions")

Explicit hooking post function to eigen workflow:

@logic(name="eigen", prepost="post")
def myfunction(data):
    print("Post function to `eigen` questions")

Pre and post that are run before and after all questions, respectively:

@logic
def pre_(data):
    print("Pre function that runs before any question")

@logic()
def post_(data):
    print("Post function that is run after all questions")