Code Reference¶
-
class
yadage.stages.
JsonStage
(json, state_provider)¶ A stage that is defined via the JSON scheduler schemas
-
class
yadage.stages.
OffsetStage
(rule, offset=None, identifier=None)¶ A wrapper object around a scoped rule, so that it can be applied from a global p.o.v., i.e. as adage expects its rules.
-
applicable
(adageobj)¶ determin whether the rule is applicable. Evaluated within the offset. :param adageobj: the workflow object
-
apply
(adageobj)¶ applies a rule within the scope set by offset
Parameters: adageobj – the workflow object
-
-
class
yadage.stages.
ViewStageBase
(name, state_provider)¶ base class for workflow stages operating on workflow views, that may expose only a partial slice of an overall workflow. The class also provides common methods to ease modifying the workflow.
Implementations are required to provide * a ready() method to implement the predicate method * a schedule() method that is called upon apply
-
yadage.utils.
getinit_data
(initfiles, parameters)¶ get initial data from both a list of files and a list of ‘pname=pvalue’ strings as they are passed in the command line <pvalue> is assumed to be a YAML parsable string.
-
yadage.utils.
json_hash
(jsonable)¶ returns a content-based hash of a json-able structure (serialized with WithJsonRefEncoder)
Parameters: jsonable – a json-serializable object Returns: the hash
-
yadage.utils.
leaf_iterator
(jsonable)¶ generator function to yield leafs items of a JSON-like structure alongside their position in the structure as determined by a JSONPointer.
Parameters: jsonable – a json-serializable object Returns: tuples (jsonpointer, leaf value)
-
yadage.utils.
leaf_iterator_jsonlike
(jsonlike, path=None)¶ ‘ :param jsonlike: a jsonlike object (i.e. nested lists/arrays: leaf-types must not be JSONable) :return: iterator that yields (JSON path, leaf value) tuples
-
yadage.utils.
pointerize
(typedleafs, asref=False, stepid=None)¶ a helper method that replaces leaf nodes in a JSON object with a outputReference objects (~ a JSONPath) pointing to that leaf position useful to track access to leaf nodes later on.
-
yadage.utils.
set_backend
(dag, backend, proxymaker=None)¶ sets backend and proxies for each node in the DAG. proxymaker is a 1-ary function that takes the node object and returns a suitable result proxy
Parameters: - dag – the dag object (par of the workflow object)
- backend – the backend to associate with the nodes
- proxymaker – function object with signature f(node) to create result proxies