Epydoc: mrv.automation.workflow
Contains workflow classes that conenct processes in a di - graph
Epydoc: mrv.automation.workflow
Bases: networkx.classes.digraph.DiGraph, mrv.interface.iDuplicatable
Holds the nodes and their connections
Nodes are kept in a separate list whereas the plug connections are kept in the underlying DiGraph
| Returns: | item with separator added to it ( just once ) |
|---|---|
| Note: | operates best on strings |
| Parameters: |
|
| Returns: | basename of this path, ‘/hello/world’ -> ‘world’ |
|---|
| Returns: | list of intermediate children of path, [ child1 , child2 ] |
|---|---|
| Parameter: | predicate – return True to include x in result |
| Note: | the child objects returned are supposed to be valid paths, not just relative paths |
| Returns: | list of all children of path, [ child1 , child2 ] |
|---|---|
| Parameters: |
|
| Note: | the child objects returned are supposed to be valid paths, not just relative paths |
Connect this plug to destinationshell such that destinationshell is an input plug for our output
| Parameters: |
|
|---|---|
| Returns: | self on success, allows chained connections |
| Raises PlugAlreadyConnected: | |
if destinationshell is connected and force is False |
|
| Raises PlugIncompatible: | |
if destinationshell does not appear to be compatible to this one |
|
Copy the values of ourselves onto the given instance which must be an instance of our class to be compatible. Only the common classes will be copied to instance
| Returns: | altered instance |
|---|---|
| Note: | instance will be altered during the process |
Implements a c-style copy constructor by creating a new instance of self and applying the copyFrom methods from base to all classes implementing the copyfrom method. Thus we will call the method directly on the class
| Parameters: |
|
|---|
| Returns: | True if the node is in this graph, false otherwise |
|---|
| Returns: | the connected input plug of plugshell or None if there is no such connection |
|---|---|
| Note: | input plugs have on plug at most, output plugs can have more than one connected plug |
| Returns: | True if self is a part of other, and thus can be found in other |
|---|---|
| Note: | operates on strings only |
| Returns: | True if this path is the root of the DAG |
|---|
| Returns: | True other starts with self |
|---|---|
| Note: | operates on strings |
| Note: | we assume other has the same type as self, thus the same separator |
| Returns: | generator returning all nodes that are connected in this graph, in no particular order. For an ordered itereration, use iterShells. |
|---|---|
| Parameter: | predicate – if True for node, it will be returned |
| Returns: | generator returning all nodes in this graph |
|---|---|
| Parameter: | predicate – if True for node, it will be returned |
| Note: | there is no particular order |
| Returns: | generator retrieving all parents up to the root |
|---|---|
| Parameter: | predicate – returns True for all x that you want to be returned |
| Returns: | instance of a node according to the given node id |
|---|---|
| Raises NameError: | |
| if no such node exists in graph | |
| Returns: | immutable copy of the nodes used in the graph |
|---|
| Returns: | number of nodes in the graph |
|---|
| Returns: | a list of plugs being the destination of the connection to plugshell |
|---|---|
| Parameter: | predicate – plug will only be returned if predicate is true for it - shells will be passed in |
| Returns: | parent of this path, ‘/hello/world’ -> ‘/hello’ or None if this path is the dag’s root |
|---|
| Returns: | all parents of this path, ‘/hello/my/world’ -> [ ‘/hello/my’,’/hello’ ] |
|---|
| Returns: | the root of the DAG - it has no further parents |
|---|
| Returns: | True if this instance supports the interface of the given type |
|---|---|
| Parameter: | interface_type – Type of the interface you require this instance to support |
| Note: | Must be used in case you only have a weak reference of your interface instance or proxy which is a case where the ordinary isinstance( obj, iInterface ) will not work |
Epydoc: mrv.automation.workflow.Workflow
Bases: mrv.dge.Graph
Implements a workflow as connected processes
| Note: | if you have to access the processes directly, use the DiGraph methods |
|---|
Bases: networkx.classes.digraph.DiGraph
Simple wrapper storing a call graph, keeping the root at which the call started
| Note: | this class is specialized to be used by workflows, its not general for that purpose |
|---|
| Returns: | root at which the call started |
|---|
| Returns: | length of the callstack |
|---|
End the call start started previously
| Parameter: | result – the result of the call |
|---|
| Returns: | flattened version of graph as list of ProcessData edges in call order , having the root as last element of the list |
|---|---|
| Parameters: |
|
Bases: object
Allows to store additional information with each process called during the workflow
| Returns: | time to process the call |
|---|
| Returns: | result stored in this instance, or None if it is not present or not alive |
|---|
Set the given result
| Note: | uses weak references as the tracking structure should not cause a possible mutation of the program flow ( as instances stay alive although code expects it to be deleted |
|---|
| Returns: | item with separator added to it ( just once ) |
|---|---|
| Note: | operates best on strings |
| Parameters: |
|
| Returns: | basename of this path, ‘/hello/world’ -> ‘world’ |
|---|
| Returns: | current callgraph instance |
|---|---|
| Note: | its strictly read-only and may not be changed |
| Returns: | list of intermediate children of path, [ child1 , child2 ] |
|---|---|
| Parameter: | predicate – return True to include x in result |
| Note: | the child objects returned are supposed to be valid paths, not just relative paths |
| Returns: | list of all children of path, [ child1 , child2 ] |
|---|---|
| Parameters: |
|
| Note: | the child objects returned are supposed to be valid paths, not just relative paths |
Connect this plug to destinationshell such that destinationshell is an input plug for our output
| Parameters: |
|
|---|---|
| Returns: | self on success, allows chained connections |
| Raises PlugAlreadyConnected: | |
if destinationshell is connected and force is False |
|
| Raises PlugIncompatible: | |
if destinationshell does not appear to be compatible to this one |
|
Copy the values of ourselves onto the given instance which must be an instance of our class to be compatible. Only the common classes will be copied to instance
| Returns: | altered instance |
|---|---|
| Note: | instance will be altered during the process |
Create a report instance that describes how the previous target was made
| Parameter: | reportType – Report to populate with information - it must be a Plan based class that can be instantiated and populated with call information. A report analyses the call dependency graph generated during dg evaluation and presents it. |
|---|---|
| Returns: | report instance whose makeReport method can be called to retrieve it |
Implements a c-style copy constructor by creating a new instance of self and applying the copyFrom methods from base to all classes implementing the copyfrom method. Thus we will call the method directly on the class
| Parameters: |
|
|---|
| Returns: | True if the node is in this graph, false otherwise |
|---|
| Returns: | the connected input plug of plugshell or None if there is no such connection |
|---|---|
| Note: | input plugs have on plug at most, output plugs can have more than one connected plug |
| Returns: | True if self is a part of other, and thus can be found in other |
|---|---|
| Note: | operates on strings only |
| Returns: | True if this path is the root of the DAG |
|---|
| Returns: | True other starts with self |
|---|---|
| Note: | operates on strings |
| Note: | we assume other has the same type as self, thus the same separator |
| Returns: | generator returning all nodes that are connected in this graph, in no particular order. For an ordered itereration, use iterShells. |
|---|---|
| Parameter: | predicate – if True for node, it will be returned |
| Returns: | generator returning all nodes in this graph |
|---|---|
| Parameter: | predicate – if True for node, it will be returned |
| Note: | there is no particular order |
| Returns: | generator retrieving all parents up to the root |
|---|---|
| Parameter: | predicate – returns True for all x that you want to be returned |
| Returns: | list of tuple( shell, DirtyReport|None ) If a process ( shell.node ) is dirty, a dirty report will be given explaining why the process is dirty and needs an update |
|---|---|
| Parameters: |
|
| Parameter: | target – target to make - can be class or instance |
|---|---|
| Returns: | result when producing the target |
batch module compatible method allowing to make mutliple targets at once
| Parameters: |
|
|---|
| Returns: | instance of a node according to the given node id |
|---|---|
| Raises NameError: | |
| if no such node exists in graph | |
| Returns: | immutable copy of the nodes used in the graph |
|---|
| Returns: | number of nodes in the graph |
|---|
| Returns: | a list of plugs being the destination of the connection to plugshell |
|---|---|
| Parameter: | predicate – plug will only be returned if predicate is true for it - shells will be passed in |
| Returns: | parent of this path, ‘/hello/world’ -> ‘/hello’ or None if this path is the dag’s root |
|---|
| Returns: | all parents of this path, ‘/hello/my/world’ -> [ ‘/hello/my’,’/hello’ ] |
|---|
| Returns: | the root of the DAG - it has no further parents |
|---|
| Returns: | True if this instance supports the interface of the given type |
|---|---|
| Parameter: | interface_type – Type of the interface you require this instance to support |
| Note: | Must be used in case you only have a weak reference of your interface instance or proxy which is a case where the ordinary isinstance( obj, iInterface ) will not work |
| Returns: | int range(0,255) indicating how well a target can be made 0 means not at all, 255 means perfect. Return value is tuple ( rate, PlugShell ), containing the process and plug with the highest rating or None if rate is 0 Walk the dependency graph such that leaf nodes have higher ratings than non-leaf nodes |
|---|---|
| Note: | you can use the process.ProcessBase enumeration for comparison |
| Returns: | list of all supported target type |
|---|---|
| Note: | this method is for informational purposes only |
Epydoc: mrv.automation.workflow
Bases: exceptions.Exception
Thrown if the computation done by a plug failed by an unknown exception It will be passed on in the exception
Epydoc: mrv.automation.workflow.DirtyException
Bases: exceptions.Exception
Exception thrown when system is in dirty query mode and the process detects that it is dirty.
The exception can also contain a report that will be returned using the makeReport function.
| Note: | Thus exeption class must NOT be derived from ComputeError as it will be caught by the DG engine and mis-interpreted - unknown exceptions will just be passed on by it |
|---|
| Returns: | printable report, usually a string or some object that responds to str() appropriately |
|---|