mrv.automation.qa

Epydoc: mrv.automation.qa

Specialization of workflow to provide quality assurance capabilities.

General Idiom of a quality assurance facility is to provide read-only checks for possibly quaility issues and possibly a fix for them.

The interface is determined by plugs that define the capabilities of the node implementing the checks.

The quality assurance framework is defined by:
  • QAWorkflow
  • QAProcessBase
  • QACheckResult
  • QACheckAttribute

They specialize the respective parts of the workflow

Functions

Classes

Epydoc: mrv.automation.qa

class mrv.automation.qa.Attribute(typeClass, flags, default=None)

Bases: object

Simple class defining the type of a plug and several flags that affect it. Additionally it can determine how well suited another attribute is

Flags:
exact_type: if True, derived classes of our typecls are not considered to be a valid type. i.e: basestring could be stored in a str attr if exact type is false - its less than we need, but still something. Putting a str into a basestring attribute will always work though, as it would be more than we need readonly: if True, the attribute’s plug cannot be written to. Read-only attributes can be used as storage that the user can read, but not write. You can write read-only plugs by directly setting its cache - this of course - is only for the node itself, but will never be done by the framework
computable:

Nodes are automatically computable if they are affected by another plug. If this is not the case, they are marked input only and are not computed. If this flag is true, even unaffeted plugs are computable. Plugs that affect something are automatically input plugs and will not be computed. If the plug does not affect anything and this flag is False, they are seen as input plugs anyway.

The system does not allow plugs to be input and output plugs at the same time, thus your compute cannot be triggered by your own compute

cls: if True, the plug requires classes to be set ( instances of ‘type’ ) , but no instances of these classes uncached: if False, computed values may be cached, otherwise they will always be recomputed. unconnectable: if True, the node cannot be the destination of a connection check_passing_values: check each value as it flows through a connection - usually compatability is only checked on connection and once values are set, but not if they flow through an existing connection

Default Values:
Although default values can be simple primitives are classes, a callable is specifically supported. It allows you to get a callback whenever a default value is required. The same result could be achieved by connected the plug in question, but dynamic defaults are a quick way to achive that. Your returned value will be type-checked against the required type if check_passing_values is set.
affinity(otherattr)

Compute affinity for otherattr.

Returns:rating from 0 to 255 defining how good the attribtues match each other in general - how good can we store values of otherattr ? Thus this comparison is directed.
Note:for checking connections, use connectionAffinity
compatabilityRate(value)

Compute value’s compatability rate

Returns:value between 0 and 255, 0 means no compatability, 255 a perfect match. if larger than 0, the plug can hold the value ( assumed the flags are set correctly ).
connectionAffinity(destinationattr)

Compute connection affinity for given destination attribute

Returns:rating from 0 to 255 defining the quality of the connection to otherplug. an affinity of 0 mean connection is not possible, 255 mean the connection is perfectly suited. The connection is a directed one from self -> otherplug
default()
Returns:default value stored for this attribute, or raise
Note:handles dynamic defaults, so you should not directly access the default member variable
Raises MissingDefaultValueError:
 if attribute does not have a default value
Raises TypeError:
 if value returned by dynamic attribute has incorrect type

Epydoc: mrv.automation.qa

class mrv.automation.qa.Event(**kwargs)

Bases: object

Descriptor allowing to easily setup callbacks for classes derived from EventSender

duplicate()
remove(eventfunc)
remove the given function from this event :note: will not raise if eventfunc does not exist
send(*args, **kwargs)

Send our event using the given args

Note:if an event listener is weak referenced and goes out of scope
Note:will catch all event exceptions trown by the methods called
Returns:False if at least one event call threw an exception, true otherwise

Epydoc: mrv.automation.qa

class mrv.automation.qa.EventSender

Bases: object

Base class for all classes that want to provide a common callback interface to supply event information to clients.

Usage: Derive from this class and define your callbacks like:

>>> event = Event()
>>> # Call it using
>>> self.event.send([*args][,**kwargs]])
>>> # Users register using
>>> yourinstance.event = callable
>>> # and deregister using
>>> yourinstance.event.remove(callable)
Note:if use_weakref is True, we will weakref the eventfunction, and deal properly with instance methods which would go out of scope immediatly otherwise
Note:using weak-references to ensure one does not keep objects alive, see Event.use_weakref
clearAllEvents()

Remove all event receivers for all events registered in this instance.

Note:This usually doesn’t need to be called directly, but might be useful in conjunction with other system that do not release your strongly bound instance
classmethod listEventNames()
Returns:list of event ids that exist on our class
sender()
Returns:instance which sent the event you are currently processing
Raises ValueError:
 if no event is currently in progress

Epydoc: mrv.automation.qa

class mrv.automation.qa.ProcessBase(id, *args, **kwargs)

Bases: mrv.dge.NodeBase

The base class for all processes, defining a common interface Inputs and Outputs of this node are statically described using plugs

Note:the process base is able to duplcate properly as it stores in constructor arguments accordingly
classmethod addSep(item, sep)
Returns:

item with separator added to it ( just once )

Note:

operates best on strings

Parameters:
  • item – item to add separator to
  • sep – the separator
basename()
Returns:basename of this path, ‘/hello/world’ -> ‘world’
children(predicate=<function <lambda> at 0x7f41dd7c2ed8>)
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
childrenDeep(order=1, predicate=<function <lambda> at 0x7f41dd7c5050>)
Returns:

list of all children of path, [ child1 , child2 ]

Parameters:
  • order – order enumeration
  • predicate – returns true if x may be returned
Note:

the child objects returned are supposed to be valid paths, not just relative paths

clearCache()
Clear the cache of all plugs on this node - this basically forces it to recompute the next time an output plug is being queried
compute(plug, mode)
connections(inpt, output)
Returns:

Tuples of input shells defining a connection of the given type from tuple( InputNodeOuptutShell, OurNodeInputShell ) for input connections and tuple( OurNodeOuptutShell, OutputNodeInputShell )

Parameters:
  • inpt – include input connections to this node
  • output – include output connections ( from this node to others )
copyFrom(other, *args, **kwargs)
Note: we have already given our args to the class during instance creation,
thus we do not copy args again
copyTo(instance, *args, **kwargs)

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
copyToOther(instance, *args, **kwargs)
As copyTo, but does only require the objects to have a common base. It will match the actually compatible base classes and call copyFrom if possible. As more checking is performed, this method performs worse than copyTo
createInstance(*args, **kwargs)
Create a copy of self and return it
duplicate(*args, **kwargs)

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:
  • args – passed to copyFrom and createInstance method to give additional directions
  • kwargs – see param args
evaluateState(plug, mode)
Returns:

an instance suitable to be stored in the given plug

Parameters:
  • plug – plug that triggered the computation - use it to compare against your classes plugs to see which output is required and return a result suitable to be stored in plug
  • mode

    bit flags as follows:

    is_state:
    your return value represents the current state of the process - your output will represent what actually is present. You may not alter the state of your environment, thus this operation is strictly read-only. According to your output, when called you need to setup a certain state and return the results according to that state. This flag means you are requrested to return everything that is right according to the state you shall create. If this state is disabled, you should not return the current state, but behave according to the other ones.
    target_state:
    your return value must represent the ‘should’ state - thus you must assure that the environment is left in a state that matches your plug state - the result of that operation will be returned. Usually, but not necessarily, the is_state is also requested so that the output represents the complete new is_state ( the new state after you changed the environment to match the plug_state )
    dirty_check:
    Always comes in conjunction with is_state. You are required to return the is_state but raise a DirtyException if your inputs would require you to adjust the environment to deliver the plug state. If the is_state if the environment is the plug_state as there is nothing to do for you, do not raise and simply return your output.

    The call takes place as there is no cache for plugType.

Note:

needs to be implemented by subclasses, but subclasses can just call their superclass for all unhandled plugs resulting in consistent error messages

classmethod filterCompatiblePlugs(plugs, attrOrValue, raise_on_ambiguity=False, attr_affinity=False, attr_as_source=True)
Returns:

sorted list of (rate,plug) tuples suitable to deal with the given attribute. Thus they could connect to it as well as get their value set. Most suitable plug comes first. Incompatible plugs will be pruned.

Parameters:
  • attrOrValue – either an attribute or the value you would like to set to the attr at the plug in question.
  • raise_on_ambiguity – if True, the method raises if a plug has the same rating as another plug already on the output list, thus it’s not clear anymore which plug should handle a request
  • attr_affinity – if True, it will not check connection affinity, but attribute affinity only. It checks how compatible the attributes of the plugs are, disregarding whether they can be connected or not Only valid if attrOrValue is an attribute
  • attr_as_source – if True, attrOrValue will be treated as the source of a connection or each plug would need to take its values. if False, attrOrValue is the destination of a connection and it needs to take values of the given plugs or they would connect to it. Only used if attrOrValue is an attribute.
Raises TypeError:
 

if ambiguous input was found

fullChildName(childname)
Add the given name to the string version of our instance :return: string with childname added like name _sep childname
id()
Returns:ID of this instance
inputPlugs(**kwargs)
Returns:list of plugs suitable as input
Note:convenience method
classmethod inputPlugsStatic(**kwargs)
Returns:list of static plugs suitable as input
Note:convenience method
isPartOf(other)
Returns:True if self is a part of other, and thus can be found in other
Note:operates on strings only
isRoot()
Returns:True if this path is the root of the DAG
isRootOf(other)
Returns:True other starts with self
Note:operates on strings
Note:we assume other has the same type as self, thus the same separator
iterParents(predicate=<function <lambda> at 0x7f41dd7c5230>)
Returns:generator retrieving all parents up to the root
Parameter:predicate – returns True for all x that you want to be returned
outputPlugs(**kwargs)
Returns:list of plugs suitable to deliver output
Note:convenience method
classmethod outputPlugsStatic(**kwargs)
Returns:list of static plugs suitable to deliver output
Note:convenience method
parent()
Returns:parent of this path, ‘/hello/world’ -> ‘/hello’ or None if this path is the dag’s root
parentDeep()
Returns:all parents of this path, ‘/hello/my/world’ -> [ ‘/hello/my’,’/hello’ ]
plugs(predicate=<function <lambda> at 0x2ed1668>)
Returns:list of dynamic plugs as defined on this node - they are usually retrieved on class level, but may be overridden on instance level
Parameter:predicate – return static plug only if predicate is true
classmethod plugsStatic(predicate=<function <lambda> at 0x2ed1578>)
Returns:list of static plugs as defined on this node - they are class members
Parameter:predicate – return static plug only if predicate is true
Note:Use this method only if you do not have an instance - there are nodes that actually have no static plug information, but will dynamically generate them. For this to work, they need an instance - thus the plugs method is an instance method and is meant to be the most commonly used one.
prepareProcess()
Will be called on all processes of the workflow once before a target is actually being queried by someone It should be used to do whatever you think is required to work as process. This uauslly is a special case for most preocesses
root()
Returns:the root of the DAG - it has no further parents
setID(newID)
Set id of this node to newiD :return: previously assigned id
shellcls
alias of _PlugShell
supportedTargetTypes()
Returns:list target types that can be output
Note:targetTypes are classes, not instances
supports(interface_type)
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
targetRating(target, check_input_plugs=True, **kwargs)
Returns:

tuple( int, PlugShell ) int between 0 and 255 - 255 means target matches perfectly, 0 means complete incompatability. Any inbetweens indicate the target can be achieved, but maybe just in a basic way

If rate is 0, the object will be None, otherwise its a plugShell to the input attribute that can take target as input. In process terms this means that at least one output plug exists that produces the target.

Parameters:
  • target – instance or class of target to check for compatability
  • check_input_plugs – if True, input plugs will be checked for compatability of target, otherwise the output plugs
Raises TypeError:
 

if the result is ambiguous and raise_on_ambiguity = 1

toShell(plug)
Returns:a plugshell as suitable to for this class
toShells(plugs)
Returns:list of shells made from plugs and our node
workflow()
Returns:the workflow instance we are connected with. Its used to query global data

Epydoc: mrv.automation.qa.QACheck

class mrv.automation.qa.QACheck(*args, **kwargs)

Bases: mrv.dge.plug

Defines a test suitable to be run and computed by a QAProcessBase It’s nothing more than a convenience class as the actual information is held by the respective QACheckAttribute. All non-plug calls are passed on to the underlying attribute, allowing it to be treated like one

affected()
Returns:tuple containing affected plugs ( plugs that are affected by our value )
affectedBy()
Returns:tuple containing plugs that affect us ( plugs affecting our value )
affects(otherplug)
Set an affects relation ship between this plug and otherplug, saying that this plug affects otherplug.
check_attribute_cls
alias of QACheckAttribute
name()
Returns:name of plug
providesInput()
Returns:True if this is an input plug that will never cause computations
providesOutput()
Returns:True if this is an output plug that can trigger computations
setName(name)
Set the name of this plug - can be set only once

Epydoc: mrv.automation.qa.QACheckAttribute

class mrv.automation.qa.QACheckAttribute(annotation, has_fix=False, flags=4)

Bases: mrv.dge.Attribute

The Test Attribute represents an interface to a specific test as implemented by the parent QAProcessBase. The QA Attribute returns specialized quality assurance results and provides additional information about the respective test

Note:as this class holds meta information about the respective test ( see QACheck ) user interfaces may use it to adjust it’s display
Note:this class depends on unknown mel implementations - on error we abort but do not throw as this would cause class creation to fail and leave the whole qa system unusable
affinity(otherattr)

Compute affinity for otherattr.

Returns:rating from 0 to 255 defining how good the attribtues match each other in general - how good can we store values of otherattr ? Thus this comparison is directed.
Note:for checking connections, use connectionAffinity
compatabilityRate(value)

Compute value’s compatability rate

Returns:value between 0 and 255, 0 means no compatability, 255 a perfect match. if larger than 0, the plug can hold the value ( assumed the flags are set correctly ).
connectionAffinity(destinationattr)

Compute connection affinity for given destination attribute

Returns:rating from 0 to 255 defining the quality of the connection to otherplug. an affinity of 0 mean connection is not possible, 255 mean the connection is perfectly suited. The connection is a directed one from self -> otherplug
default()
Returns:default value stored for this attribute, or raise
Note:handles dynamic defaults, so you should not directly access the default member variable
Raises MissingDefaultValueError:
 if attribute does not have a default value
Raises TypeError:
 if value returned by dynamic attribute has incorrect type

Epydoc: mrv.automation.qa.QACheckResult

class mrv.automation.qa.QACheckResult(fixed_items=None, failed_items=None, header='')

Bases: object

Wrapper class declaring test results as a type that provides a simple interface to retrieve the test results

Note:test results are only reqtrieved by QACheckAttribute plugs
failedItems()
Returns:( list( Item, ... ) list of failed items being items that could not be fixed and are not yet in the desired state
fixedItems()
Returns:list( Item , ... ) list of items ( the exact type may differ depending on the actual test ) which have been fixed so they represent the desired state
isNull()
Returns:True if the test result is empty, and thus resembles a null value
isSuccessful()
Returns:True if the check is successful, and False if there are at least some failed objects

Epydoc: mrv.automation.qa.QAProcessBase

class mrv.automation.qa.QAProcessBase(id, *args, **kwargs)

Bases: mrv.automation.process.ProcessBase

Quality Assurance Process including a specialized QA interface

classmethod addSep(item, sep)
Returns:

item with separator added to it ( just once )

Note:

operates best on strings

Parameters:
  • item – item to add separator to
  • sep – the separator
assureQuality(check, mode, *args, **kwargs)

Called when the test identified by plug should be handled

Parameters:
  • check – QACheck to be checked for issues
  • mode – mode of the computation, see QAProcessBase.eMode
Returns:

QACheckResult instance keeping information about the outcome of the test

basename()
Returns:basename of this path, ‘/hello/world’ -> ‘world’
children(predicate=<function <lambda> at 0x7f41dd7c2ed8>)
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
childrenDeep(order=1, predicate=<function <lambda> at 0x7f41dd7c5050>)
Returns:

list of all children of path, [ child1 , child2 ]

Parameters:
  • order – order enumeration
  • predicate – returns true if x may be returned
Note:

the child objects returned are supposed to be valid paths, not just relative paths

clearCache()
Clear the cache of all plugs on this node - this basically forces it to recompute the next time an output plug is being queried
compute(plug, mode)
connections(inpt, output)
Returns:

Tuples of input shells defining a connection of the given type from tuple( InputNodeOuptutShell, OurNodeInputShell ) for input connections and tuple( OurNodeOuptutShell, OutputNodeInputShell )

Parameters:
  • inpt – include input connections to this node
  • output – include output connections ( from this node to others )
copyFrom(other, *args, **kwargs)
Note: we have already given our args to the class during instance creation,
thus we do not copy args again
copyTo(instance, *args, **kwargs)

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
copyToOther(instance, *args, **kwargs)
As copyTo, but does only require the objects to have a common base. It will match the actually compatible base classes and call copyFrom if possible. As more checking is performed, this method performs worse than copyTo
createInstance(*args, **kwargs)
Create a copy of self and return it
duplicate(*args, **kwargs)

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:
  • args – passed to copyFrom and createInstance method to give additional directions
  • kwargs – see param args
evaluateState(plug, mode, *args, **kwargs)
Prepares the call to the actual quality check implemenetation and assuring test identified by plug can actually be run in the given mode
classmethod filterCompatiblePlugs(plugs, attrOrValue, raise_on_ambiguity=False, attr_affinity=False, attr_as_source=True)
Returns:

sorted list of (rate,plug) tuples suitable to deal with the given attribute. Thus they could connect to it as well as get their value set. Most suitable plug comes first. Incompatible plugs will be pruned.

Parameters:
  • attrOrValue – either an attribute or the value you would like to set to the attr at the plug in question.
  • raise_on_ambiguity – if True, the method raises if a plug has the same rating as another plug already on the output list, thus it’s not clear anymore which plug should handle a request
  • attr_affinity – if True, it will not check connection affinity, but attribute affinity only. It checks how compatible the attributes of the plugs are, disregarding whether they can be connected or not Only valid if attrOrValue is an attribute
  • attr_as_source – if True, attrOrValue will be treated as the source of a connection or each plug would need to take its values. if False, attrOrValue is the destination of a connection and it needs to take values of the given plugs or they would connect to it. Only used if attrOrValue is an attribute.
Raises TypeError:
 

if ambiguous input was found

fullChildName(childname)
Add the given name to the string version of our instance :return: string with childname added like name _sep childname
id()
Returns:ID of this instance
inputPlugs(**kwargs)
Returns:list of plugs suitable as input
Note:convenience method
classmethod inputPlugsStatic(**kwargs)
Returns:list of static plugs suitable as input
Note:convenience method
isPartOf(other)
Returns:True if self is a part of other, and thus can be found in other
Note:operates on strings only
isRoot()
Returns:True if this path is the root of the DAG
isRootOf(other)
Returns:True other starts with self
Note:operates on strings
Note:we assume other has the same type as self, thus the same separator
iterParents(predicate=<function <lambda> at 0x7f41dd7c5230>)
Returns:generator retrieving all parents up to the root
Parameter:predicate – returns True for all x that you want to be returned
listChecks(**kwargs)
Returns:list( QACheck, ... ) list of our checks
Parameter:kwargs – see QAWorkflow.filterChecks
outputPlugs(**kwargs)
Returns:list of plugs suitable to deliver output
Note:convenience method
classmethod outputPlugsStatic(**kwargs)
Returns:list of static plugs suitable to deliver output
Note:convenience method
parent()
Returns:parent of this path, ‘/hello/world’ -> ‘/hello’ or None if this path is the dag’s root
parentDeep()
Returns:all parents of this path, ‘/hello/my/world’ -> [ ‘/hello/my’,’/hello’ ]
plugs(predicate=<function <lambda> at 0x2ed1668>)
Returns:list of dynamic plugs as defined on this node - they are usually retrieved on class level, but may be overridden on instance level
Parameter:predicate – return static plug only if predicate is true
classmethod plugsStatic(predicate=<function <lambda> at 0x2ed1578>)
Returns:list of static plugs as defined on this node - they are class members
Parameter:predicate – return static plug only if predicate is true
Note:Use this method only if you do not have an instance - there are nodes that actually have no static plug information, but will dynamically generate them. For this to work, they need an instance - thus the plugs method is an instance method and is meant to be the most commonly used one.
prepareProcess()
Will be called on all processes of the workflow once before a target is actually being queried by someone It should be used to do whatever you think is required to work as process. This uauslly is a special case for most preocesses
root()
Returns:the root of the DAG - it has no further parents
setID(newID)
Set id of this node to newiD :return: previously assigned id
shellcls
alias of _PlugShell
supportedTargetTypes()
Returns:list target types that can be output
Note:targetTypes are classes, not instances
supports(interface_type)
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
targetRating(target, check_input_plugs=True, **kwargs)
Returns:

tuple( int, PlugShell ) int between 0 and 255 - 255 means target matches perfectly, 0 means complete incompatability. Any inbetweens indicate the target can be achieved, but maybe just in a basic way

If rate is 0, the object will be None, otherwise its a plugShell to the input attribute that can take target as input. In process terms this means that at least one output plug exists that produces the target.

Parameters:
  • target – instance or class of target to check for compatability
  • check_input_plugs – if True, input plugs will be checked for compatability of target, otherwise the output plugs
Raises TypeError:
 

if the result is ambiguous and raise_on_ambiguity = 1

toShell(plug)
Returns:a plugshell as suitable to for this class
toShells(plugs)
Returns:list of shells made from plugs and our node
workflow()
Returns:the workflow instance we are connected with. Its used to query global data

Epydoc: mrv.automation.qa.QAWorkflow

class mrv.automation.qa.QAWorkflow(*args, **kwargs)

Bases: mrv.automation.workflow.Workflow, mrv.util.EventSender

Represents a workflow of QAProcessBase instances and allows to query them more conveniently

class CallGraph

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
add_cycle(nlist, **attr)
add_edge(u, v, attr_dict=None, **attr)
add_edges_from(ebunch, attr_dict=None, **attr)
add_node(n, attr_dict=None, **attr)
add_nodes_from(nodes, **attr)
add_path(nlist, **attr)
add_star(nlist, **attr)
add_weighted_edges_from(ebunch, **attr)
adjacency_iter()
adjacency_list()
callRoot()
Returns:root at which the call started
callstackSize()
Returns:length of the callstack
clear()
copy()
degree(nbunch=None, with_labels=False, weighted=False)
degree_iter(nbunch=None, weighted=False)
edges(nbunch=None, data=False)
edges_iter(nbunch=None, data=False)
endCall(result)

End the call start started previously

Parameter:result – the result of the call
get_edge_data(u, v, default=None)
has_edge(u, v)
has_node(n)
has_predecessor(u, v)
has_successor(u, v)
in_degree(nbunch=None, with_labels=False, weighted=False)
in_degree_iter(nbunch=None, weighted=False)
in_edges(nbunch=None, data=False)
in_edges_iter(nbunch=None, data=False)
is_directed()
is_multigraph()
nbunch_iter(nbunch=None)
neighbors(n)
neighbors_iter(n)
nodes(data=False)
nodes_iter(data=False)
nodes_with_selfloops()
number_of_edges(u=None, v=None)
number_of_nodes()
number_of_selfloops()
order()
out_degree(nbunch=None, with_labels=False, weighted=False)
out_degree_iter(nbunch=None, weighted=False)
out_edges(nbunch=None, data=False)
out_edges_iter(nbunch=None, data=False)
predecessors(n)
predecessors_iter(n)
remove_edge(u, v)
remove_edges_from(ebunch)
remove_node(n)
remove_nodes_from(nbunch)
reverse(copy=True)
selfloop_edges(data=False)
size(weighted=False)
startCall(pdata)
Add a call of a process
subgraph(nbunch, copy=True)
successors(n)
successors_iter(n)
toCallList(reverse=True, pruneIfTrue=<function <lambda> at 0x3445f50>)
Returns:

flattened version of graph as list of ProcessData edges in call order , having the root as last element of the list

Parameters:
  • pruneIfTrue – Function taking ProcessData to return true if the node should be pruned from the result
  • reverse – if true, the calllist will be properly reversed ( taking childre into account
to_directed()
to_undirected()
class QAWorkflow.ProcessData(process, plug, mode)

Bases: object

Allows to store additional information with each process called during the workflow

elapsed()
Returns:time to process the call
endtime
exception
index
mode
plug
process
result()
Returns:result stored in this instance, or None if it is not present or not alive
setResult(result)

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
starttime
QAWorkflow.addNode(node)
Add a new node instance to the graph :note: node membership is exclusive, thus node instances can only be in one graph at a time :return: self, for chained calls
classmethod QAWorkflow.addSep(item, sep)
Returns:

item with separator added to it ( just once )

Note:

operates best on strings

Parameters:
  • item – item to add separator to
  • sep – the separator
QAWorkflow.add_cycle(nlist, **attr)
QAWorkflow.add_edge(u, v, attr_dict=None, **attr)
QAWorkflow.add_edges_from(ebunch, attr_dict=None, **attr)
QAWorkflow.add_node(n, attr_dict=None, **attr)
QAWorkflow.add_nodes_from(nodes, **attr)
QAWorkflow.add_path(nlist, **attr)
QAWorkflow.add_star(nlist, **attr)
QAWorkflow.add_weighted_edges_from(ebunch, **attr)
QAWorkflow.adjacency_iter()
QAWorkflow.adjacency_list()
QAWorkflow.basename()
Returns:basename of this path, ‘/hello/world’ -> ‘world’
QAWorkflow.callgraph()
Returns:current callgraph instance
Note:its strictly read-only and may not be changed
QAWorkflow.children(predicate=<function <lambda> at 0x7f41dd7c2ed8>)
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
QAWorkflow.childrenDeep(order=1, predicate=<function <lambda> at 0x7f41dd7c5050>)
Returns:

list of all children of path, [ child1 , child2 ]

Parameters:
  • order – order enumeration
  • predicate – returns true if x may be returned
Note:

the child objects returned are supposed to be valid paths, not just relative paths

QAWorkflow.clear()
QAWorkflow.clearAllEvents()

Remove all event receivers for all events registered in this instance.

Note:This usually doesn’t need to be called directly, but might be useful in conjunction with other system that do not release your strongly bound instance
QAWorkflow.clearCache()
Clear the cache of all nodes in the graph - this forces the graph to reevaluate on the next request
QAWorkflow.connect(sourceshell, destinationshell, force=False)

Connect this plug to destinationshell such that destinationshell is an input plug for our output

Parameters:
  • sourceshell – PlugShell being source of the connection
  • destinationshell – PlugShell being destination of the connection
  • force – if False, existing connections to destinationshell will not be broken, but an exception is raised if True, existing connection may be broken
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

QAWorkflow.copy()
QAWorkflow.copyFrom(other)
Only mode is required
QAWorkflow.copyTo(instance, *args, **kwargs)

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
QAWorkflow.copyToOther(instance, *args, **kwargs)
As copyTo, but does only require the objects to have a common base. It will match the actually compatible base classes and call copyFrom if possible. As more checking is performed, this method performs worse than copyTo
QAWorkflow.createInstance()
Create a copy of self and return it
QAWorkflow.createReportInstance(reportType)

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
QAWorkflow.degree(nbunch=None, with_labels=False, weighted=False)
QAWorkflow.degree_iter(nbunch=None, weighted=False)
QAWorkflow.disconnect(sourceshell, destinationshell)
Remove the connection between sourceshell to destinationshell if they are connected :note: does not raise if no connection is present
QAWorkflow.duplicate(*args, **kwargs)

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:
  • args – passed to copyFrom and createInstance method to give additional directions
  • kwargs – see param args
QAWorkflow.e_checkError
Descriptor allowing to easily setup callbacks for classes derived from EventSender
QAWorkflow.e_postCheck
Descriptor allowing to easily setup callbacks for classes derived from EventSender
QAWorkflow.e_preCheck
Descriptor allowing to easily setup callbacks for classes derived from EventSender
QAWorkflow.edges(nbunch=None, data=False)
QAWorkflow.edges_iter(nbunch=None, data=False)
static QAWorkflow.fIsQAPlug(p)
static QAWorkflow.fIsQAProcessBase(n)
QAWorkflow.filterChecks(processes, predicate=<function <lambda> at 0x345fd70>)

As listChecks, but allows you do define the processes to use

Parameter:predicate – func( p ) for plug p returns True for it to be included in the result
QAWorkflow.fullChildName(childname)
Add the given name to the string version of our instance :return: string with childname added like name _sep childname
QAWorkflow.get_edge_data(u, v, default=None)
QAWorkflow.hasNode(node)
Returns:True if the node is in this graph, false otherwise
QAWorkflow.has_edge(u, v)
QAWorkflow.has_node(n)
QAWorkflow.has_predecessor(u, v)
QAWorkflow.has_successor(u, v)
QAWorkflow.in_degree(nbunch=None, with_labels=False, weighted=False)
QAWorkflow.in_degree_iter(nbunch=None, weighted=False)
QAWorkflow.in_edges(nbunch=None, data=False)
QAWorkflow.in_edges_iter(nbunch=None, data=False)
QAWorkflow.input(plugshell)
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
QAWorkflow.isPartOf(other)
Returns:True if self is a part of other, and thus can be found in other
Note:operates on strings only
QAWorkflow.isRoot()
Returns:True if this path is the root of the DAG
QAWorkflow.isRootOf(other)
Returns:True other starts with self
Note:operates on strings
Note:we assume other has the same type as self, thus the same separator
QAWorkflow.is_directed()
QAWorkflow.is_multigraph()
QAWorkflow.iterConnectedNodes(predicate=<function <lambda> at 0x2ed0aa0>)
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
QAWorkflow.iterNodes(predicate=<function <lambda> at 0x2ed09b0>)
Returns:generator returning all nodes in this graph
Parameter:predicate – if True for node, it will be returned
Note:there is no particular order
QAWorkflow.iterParents(predicate=<function <lambda> at 0x7f41dd7c5230>)
Returns:generator retrieving all parents up to the root
Parameter:predicate – returns True for all x that you want to be returned
QAWorkflow.listChecks(predicate=<function <lambda> at 0x345fe60>)

List all checks as supported by QAProcessBase es in this QA Workflow

Parameter:predicate – include check c in result if func( c ) returns True
classmethod QAWorkflow.listEventNames()
Returns:list of event ids that exist on our class
QAWorkflow.listQAProcessBasees(predicate=<function <lambda> at 0x345fc80>)
Returns:list( Process, ... ) list of QA Processes known to this QA Workflow
Parameter:predicate – include process p in result if func( p ) returns True
QAWorkflow.makeDirtyReport(target, mode='single')
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:
  • target – target you which to check for it’s dirty state
  • mode
    • single - only the process assigned to evaluate target will be checked
    • multi - as single, but the whole callgraph will be checked, starting
      at the first node, stepping down the callgraph. This gives a per node dirty report.
    • deep - try to evaluate target, but fail if one process in the target’s
      call history is dirty
QAWorkflow.makeTarget(target)
Parameter:target – target to make - can be class or instance
Returns:result when producing the target
QAWorkflow.makeTargets(targetList, errstream=None, donestream=None)

batch module compatible method allowing to make mutliple targets at once

Parameters:
  • targetList – iterable providing the targets to make
  • errstream – object with file interface allowing to log errors that occurred during operation
  • donestream – if list, targets successfully done will be appended to it, if it is a stream, the string representation will be wrtten to it
QAWorkflow.nbunch_iter(nbunch=None)
QAWorkflow.neighbors(n)
QAWorkflow.neighbors_iter(n)
QAWorkflow.nodeByID(nodeID)
Returns:instance of a node according to the given node id
Raises NameError:
 if no such node exists in graph
QAWorkflow.nodes()
Returns:immutable copy of the nodes used in the graph
QAWorkflow.nodes_iter(data=False)
QAWorkflow.nodes_with_selfloops()
QAWorkflow.numNodes()
Returns:number of nodes in the graph
QAWorkflow.number_of_edges(u=None, v=None)
QAWorkflow.number_of_nodes()
QAWorkflow.number_of_selfloops()
QAWorkflow.order()
QAWorkflow.out_degree(nbunch=None, with_labels=False, weighted=False)
QAWorkflow.out_degree_iter(nbunch=None, weighted=False)
QAWorkflow.out_edges(nbunch=None, data=False)
QAWorkflow.out_edges_iter(nbunch=None, data=False)
QAWorkflow.outputs(plugshell, predicate=<function <lambda> at 0x2ed0e60>)
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
QAWorkflow.parent()
Returns:parent of this path, ‘/hello/world’ -> ‘/hello’ or None if this path is the dag’s root
QAWorkflow.parentDeep()
Returns:all parents of this path, ‘/hello/my/world’ -> [ ‘/hello/my’,’/hello’ ]
QAWorkflow.predecessors(n)
QAWorkflow.predecessors_iter(n)
QAWorkflow.removeNode(node)
Remove the given node from the graph ( if it exists in it )
QAWorkflow.remove_edge(u, v)
QAWorkflow.remove_edges_from(ebunch)
QAWorkflow.remove_node(n)
QAWorkflow.remove_nodes_from(nbunch)
QAWorkflow.reverse(copy=True)
QAWorkflow.root()
Returns:the root of the DAG - it has no further parents
QAWorkflow.runChecks(checks, mode=query, clear_result=True)

Run the given checks in the given mode and return their results

Parameters:
  • checks – list( QACheckShell, ... ) as retrieved by listChecks
  • modeQAProcessBase.eMode
  • clear_result – if True, the plug’s cache will be removed forcing a computation if False, you might get a cached value depending on the plug’s setup
Returns:

list( tuple( QACheckShell, QACheckResult ), ... ) list of pairs of QACheckShells and the check’s result. The test result will be empty if the test did not run or failed with an exception

Note:

Sends the following events: e_preCheck , e_postCheck, e_checkError e_checkError may set the abort_on_error variable to True to cause the operation not to proceed with other checks

QAWorkflow.selfloop_edges(data=False)
QAWorkflow.sender()
Returns:instance which sent the event you are currently processing
Raises ValueError:
 if no event is currently in progress
QAWorkflow.size(weighted=False)
QAWorkflow.subgraph(nbunch, copy=True)
QAWorkflow.successors(n)
QAWorkflow.successors_iter(n)
QAWorkflow.supports(interface_type)
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
QAWorkflow.targetRating(target)
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

QAWorkflow.targetSupportList()
Returns:list of all supported target type
Note:this method is for informational purposes only
QAWorkflow.to_directed()
QAWorkflow.to_undirected()
QAWorkflow.writeDot(fileOrPath)
Write the connections in self to the given file object or path :todo: remove if no longer needed

Epydoc: mrv.automation.qa

class mrv.automation.qa.Workflow(**kwargs)

Bases: mrv.dge.Graph

Implements a workflow as connected processes

Note:if you have to access the processes directly, use the DiGraph methods
class CallGraph

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
add_cycle(nlist, **attr)
add_edge(u, v, attr_dict=None, **attr)
add_edges_from(ebunch, attr_dict=None, **attr)
add_node(n, attr_dict=None, **attr)
add_nodes_from(nodes, **attr)
add_path(nlist, **attr)
add_star(nlist, **attr)
add_weighted_edges_from(ebunch, **attr)
adjacency_iter()
adjacency_list()
callRoot()
Returns:root at which the call started
callstackSize()
Returns:length of the callstack
clear()
copy()
degree(nbunch=None, with_labels=False, weighted=False)
degree_iter(nbunch=None, weighted=False)
edges(nbunch=None, data=False)
edges_iter(nbunch=None, data=False)
endCall(result)

End the call start started previously

Parameter:result – the result of the call
get_edge_data(u, v, default=None)
has_edge(u, v)
has_node(n)
has_predecessor(u, v)
has_successor(u, v)
in_degree(nbunch=None, with_labels=False, weighted=False)
in_degree_iter(nbunch=None, weighted=False)
in_edges(nbunch=None, data=False)
in_edges_iter(nbunch=None, data=False)
is_directed()
is_multigraph()
nbunch_iter(nbunch=None)
neighbors(n)
neighbors_iter(n)
nodes(data=False)
nodes_iter(data=False)
nodes_with_selfloops()
number_of_edges(u=None, v=None)
number_of_nodes()
number_of_selfloops()
order()
out_degree(nbunch=None, with_labels=False, weighted=False)
out_degree_iter(nbunch=None, weighted=False)
out_edges(nbunch=None, data=False)
out_edges_iter(nbunch=None, data=False)
predecessors(n)
predecessors_iter(n)
remove_edge(u, v)
remove_edges_from(ebunch)
remove_node(n)
remove_nodes_from(nbunch)
reverse(copy=True)
selfloop_edges(data=False)
size(weighted=False)
startCall(pdata)
Add a call of a process
subgraph(nbunch, copy=True)
successors(n)
successors_iter(n)
toCallList(reverse=True, pruneIfTrue=<function <lambda> at 0x3445f50>)
Returns:

flattened version of graph as list of ProcessData edges in call order , having the root as last element of the list

Parameters:
  • pruneIfTrue – Function taking ProcessData to return true if the node should be pruned from the result
  • reverse – if true, the calllist will be properly reversed ( taking childre into account
to_directed()
to_undirected()
class Workflow.ProcessData(process, plug, mode)

Bases: object

Allows to store additional information with each process called during the workflow

elapsed()
Returns:time to process the call
endtime
exception
index
mode
plug
process
result()
Returns:result stored in this instance, or None if it is not present or not alive
setResult(result)

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
starttime
Workflow.addNode(node)
Add a new node instance to the graph :note: node membership is exclusive, thus node instances can only be in one graph at a time :return: self, for chained calls
classmethod Workflow.addSep(item, sep)
Returns:

item with separator added to it ( just once )

Note:

operates best on strings

Parameters:
  • item – item to add separator to
  • sep – the separator
Workflow.add_cycle(nlist, **attr)
Workflow.add_edge(u, v, attr_dict=None, **attr)
Workflow.add_edges_from(ebunch, attr_dict=None, **attr)
Workflow.add_node(n, attr_dict=None, **attr)
Workflow.add_nodes_from(nodes, **attr)
Workflow.add_path(nlist, **attr)
Workflow.add_star(nlist, **attr)
Workflow.add_weighted_edges_from(ebunch, **attr)
Workflow.adjacency_iter()
Workflow.adjacency_list()
Workflow.basename()
Returns:basename of this path, ‘/hello/world’ -> ‘world’
Workflow.callgraph()
Returns:current callgraph instance
Note:its strictly read-only and may not be changed
Workflow.children(predicate=<function <lambda> at 0x7f41dd7c2ed8>)
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
Workflow.childrenDeep(order=1, predicate=<function <lambda> at 0x7f41dd7c5050>)
Returns:

list of all children of path, [ child1 , child2 ]

Parameters:
  • order – order enumeration
  • predicate – returns true if x may be returned
Note:

the child objects returned are supposed to be valid paths, not just relative paths

Workflow.clear()
Workflow.clearCache()
Clear the cache of all nodes in the graph - this forces the graph to reevaluate on the next request
Workflow.connect(sourceshell, destinationshell, force=False)

Connect this plug to destinationshell such that destinationshell is an input plug for our output

Parameters:
  • sourceshell – PlugShell being source of the connection
  • destinationshell – PlugShell being destination of the connection
  • force – if False, existing connections to destinationshell will not be broken, but an exception is raised if True, existing connection may be broken
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

Workflow.copy()
Workflow.copyFrom(other)
Only mode is required
Workflow.copyTo(instance, *args, **kwargs)

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
Workflow.copyToOther(instance, *args, **kwargs)
As copyTo, but does only require the objects to have a common base. It will match the actually compatible base classes and call copyFrom if possible. As more checking is performed, this method performs worse than copyTo
Workflow.createInstance()
Create a copy of self and return it
Workflow.createReportInstance(reportType)

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
Workflow.degree(nbunch=None, with_labels=False, weighted=False)
Workflow.degree_iter(nbunch=None, weighted=False)
Workflow.disconnect(sourceshell, destinationshell)
Remove the connection between sourceshell to destinationshell if they are connected :note: does not raise if no connection is present
Workflow.duplicate(*args, **kwargs)

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:
  • args – passed to copyFrom and createInstance method to give additional directions
  • kwargs – see param args
Workflow.edges(nbunch=None, data=False)
Workflow.edges_iter(nbunch=None, data=False)
Workflow.fullChildName(childname)
Add the given name to the string version of our instance :return: string with childname added like name _sep childname
Workflow.get_edge_data(u, v, default=None)
Workflow.hasNode(node)
Returns:True if the node is in this graph, false otherwise
Workflow.has_edge(u, v)
Workflow.has_node(n)
Workflow.has_predecessor(u, v)
Workflow.has_successor(u, v)
Workflow.in_degree(nbunch=None, with_labels=False, weighted=False)
Workflow.in_degree_iter(nbunch=None, weighted=False)
Workflow.in_edges(nbunch=None, data=False)
Workflow.in_edges_iter(nbunch=None, data=False)
Workflow.input(plugshell)
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
Workflow.isPartOf(other)
Returns:True if self is a part of other, and thus can be found in other
Note:operates on strings only
Workflow.isRoot()
Returns:True if this path is the root of the DAG
Workflow.isRootOf(other)
Returns:True other starts with self
Note:operates on strings
Note:we assume other has the same type as self, thus the same separator
Workflow.is_directed()
Workflow.is_multigraph()
Workflow.iterConnectedNodes(predicate=<function <lambda> at 0x2ed0aa0>)
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
Workflow.iterNodes(predicate=<function <lambda> at 0x2ed09b0>)
Returns:generator returning all nodes in this graph
Parameter:predicate – if True for node, it will be returned
Note:there is no particular order
Workflow.iterParents(predicate=<function <lambda> at 0x7f41dd7c5230>)
Returns:generator retrieving all parents up to the root
Parameter:predicate – returns True for all x that you want to be returned
Workflow.makeDirtyReport(target, mode='single')
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:
  • target – target you which to check for it’s dirty state
  • mode
    • single - only the process assigned to evaluate target will be checked
    • multi - as single, but the whole callgraph will be checked, starting
      at the first node, stepping down the callgraph. This gives a per node dirty report.
    • deep - try to evaluate target, but fail if one process in the target’s
      call history is dirty
Workflow.makeTarget(target)
Parameter:target – target to make - can be class or instance
Returns:result when producing the target
Workflow.makeTargets(targetList, errstream=None, donestream=None)

batch module compatible method allowing to make mutliple targets at once

Parameters:
  • targetList – iterable providing the targets to make
  • errstream – object with file interface allowing to log errors that occurred during operation
  • donestream – if list, targets successfully done will be appended to it, if it is a stream, the string representation will be wrtten to it
Workflow.nbunch_iter(nbunch=None)
Workflow.neighbors(n)
Workflow.neighbors_iter(n)
Workflow.nodeByID(nodeID)
Returns:instance of a node according to the given node id
Raises NameError:
 if no such node exists in graph
Workflow.nodes()
Returns:immutable copy of the nodes used in the graph
Workflow.nodes_iter(data=False)
Workflow.nodes_with_selfloops()
Workflow.numNodes()
Returns:number of nodes in the graph
Workflow.number_of_edges(u=None, v=None)
Workflow.number_of_nodes()
Workflow.number_of_selfloops()
Workflow.order()
Workflow.out_degree(nbunch=None, with_labels=False, weighted=False)
Workflow.out_degree_iter(nbunch=None, weighted=False)
Workflow.out_edges(nbunch=None, data=False)
Workflow.out_edges_iter(nbunch=None, data=False)
Workflow.outputs(plugshell, predicate=<function <lambda> at 0x2ed0e60>)
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
Workflow.parent()
Returns:parent of this path, ‘/hello/world’ -> ‘/hello’ or None if this path is the dag’s root
Workflow.parentDeep()
Returns:all parents of this path, ‘/hello/my/world’ -> [ ‘/hello/my’,’/hello’ ]
Workflow.predecessors(n)
Workflow.predecessors_iter(n)
Workflow.removeNode(node)
Remove the given node from the graph ( if it exists in it )
Workflow.remove_edge(u, v)
Workflow.remove_edges_from(ebunch)
Workflow.remove_node(n)
Workflow.remove_nodes_from(nbunch)
Workflow.reverse(copy=True)
Workflow.root()
Returns:the root of the DAG - it has no further parents
Workflow.selfloop_edges(data=False)
Workflow.size(weighted=False)
Workflow.subgraph(nbunch, copy=True)
Workflow.successors(n)
Workflow.successors_iter(n)
Workflow.supports(interface_type)
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
Workflow.targetRating(target)
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

Workflow.targetSupportList()
Returns:list of all supported target type
Note:this method is for informational purposes only
Workflow.to_directed()
Workflow.to_undirected()
Workflow.writeDot(fileOrPath)
Write the connections in self to the given file object or path :todo: remove if no longer needed

Epydoc: mrv.automation.qa

class mrv.automation.qa.plug(attribute)

Bases: mrv.dge.iPlug

Defines an interface allowing to compare compatabilies according to types.

Plugs are implemented as descriptors, thus they will be defined on node class level, and all static information will remain static

As descriptors, they are defined statically on the class, and some additional information such as connectivity, is stored on the respective class instance. These special methods are handled using NodeBase class

Plugs are implemented as descriptors as all type information can be kept per class, whereas only connection information changes per node instance.

Plugs can either be input plugs or output plugs - output plugs affect no other plug on a node, but are affected by 0 or more plugs

Note:class is lowercase as it is used as descriptor ( acting more like a function )
affected()
Returns:tuple containing affected plugs ( plugs that are affected by our value )
affectedBy()
Returns:tuple containing plugs that affect us ( plugs affecting our value )
affects(otherplug)
Set an affects relation ship between this plug and otherplug, saying that this plug affects otherplug.
name()
Returns:name of plug
providesInput()
Returns:True if this is an input plug that will never cause computations
providesOutput()
Returns:True if this is an output plug that can trigger computations
setName(name)
Set the name of this plug - can be set only once

Exceptions

Epydoc: mrv.automation.qa.CheckIncompatibleError

class mrv.automation.qa.CheckIncompatibleError

Bases: mrv.dge.ComputeFailed

Raised if a check cannot accomdate the requested mode and thus cannot run

args
message

Epydoc: mrv.automation.qa

class mrv.automation.qa.ComputeFailed

Bases: mrv.dge.ComputeError

Raised by the derived class computing a value if the computational goal cannot be achieved ( anymore )

args
message

Table Of Contents

Previous topic

mrv.automation.attributes

Next topic

mrv.cmd.base

This Page