Initialise a graph node from an executor.
More...
|
| | _flattenSet (self, startSet) |
| | Take a list and return all simple members plus the members of any list/tuples in the set (i.e., flatten out multiple input tuples)
|
Initialise a graph node from an executor.
Definition at line 530 of file trfGraph.py.
◆ result
◆ __init__()
| python.trfGraph.executorNode.__init__ |
( |
| self, |
|
|
| executor = None, |
|
|
| weight = None ) |
executorNode constructor
- Note
- This is just a wrapper to call the parent class's constructor with the extracted input and output data types
- Parameters
-
| executor | Executor used to make this node |
| weight | Weight specifier |
Definition at line 536 of file trfGraph.py.
536 def __init__(self, executor = None, weight = None):
537 super(executorNode, self).__init__(executor.name, executor.inData, executor.outData, weight)
◆ __repr__()
| python.trfGraph.graphNode.__repr__ |
( |
| self | ) |
|
|
inherited |
Definition at line 525 of file trfGraph.py.
525 def __repr__(self):
526 return '{0} (dataIn {1}, weights {2}; dataOut {3}; connect {4})'.format(self._name, self._inData, self._inWeights, self._outData, self._connections)
527
528
◆ __str__()
| python.trfGraph.graphNode.__str__ |
( |
| self | ) |
|
|
inherited |
Definition at line 522 of file trfGraph.py.
522 def __str__(self):
523 return '{0} (dataIn {1} -> dataOut {2})'.format(self._name, self._inData, self._outData)
524
◆ _flattenSet()
| python.trfGraph.graphNode._flattenSet |
( |
| self, |
|
|
| startSet ) |
|
protectedinherited |
Take a list and return all simple members plus the members of any list/tuples in the set (i.e., flatten out multiple input tuples)
Definition at line 513 of file trfGraph.py.
513 def _flattenSet(self, startSet):
515 for data in startSet:
516 if isinstance(data, (list, tuple)):
517 flatData.update(data)
518 else:
519 flatData.update([data])
520 return flatData
521
◆ addConnection()
| python.trfGraph.graphNode.addConnection |
( |
| self, |
|
|
| toExe, |
|
|
| data, |
|
|
| direction = 'out' ) |
|
inherited |
Add a new edge connection for this node.
- Parameters
-
c toExe Other node for this edge
- Parameters
-
c data Data which connects these nodes (iterable), converted to set object
- Parameters
-
c direction If this is an incoming or outgoing edge for this node
Definition at line 498 of file trfGraph.py.
498 def addConnection(self, toExe, data, direction = 'out'):
499 self._connections[direction][toExe] =
set(data)
500
◆ connections()
| python.trfGraph.graphNode.connections |
( |
| self | ) |
|
|
inherited |
Definition at line 487 of file trfGraph.py.
487 def connections(self):
488 return self._connections
489
◆ delConnection()
| python.trfGraph.graphNode.delConnection |
( |
| self, |
|
|
| toExe, |
|
|
| direction = 'out' ) |
|
inherited |
Delete a connection from this node.
- Parameters
-
c toExe Other node for this vertex
- Parameters
-
c direction If this is an incoming or outgoing edge for this node
Definition at line 504 of file trfGraph.py.
504 def delConnection(self, toExe, direction = 'out'):
505 del self._connections[direction][toExe]
506
◆ inData()
| python.trfGraph.graphNode.inData |
( |
| self | ) |
|
|
inherited |
Definition at line 471 of file trfGraph.py.
471 def inData(self):
472 return self._inData
473
◆ inputDataTypes()
| python.trfGraph.graphNode.inputDataTypes |
( |
| self | ) |
|
|
inherited |
Definition at line 479 of file trfGraph.py.
479 def inputDataTypes(self):
480 return self._flattenSet(self.inData)
481
◆ name()
| python.trfGraph.graphNode.name |
( |
| self | ) |
|
|
inherited |
Definition at line 467 of file trfGraph.py.
467 def name(self):
468 return self._name
469
◆ outData()
| python.trfGraph.graphNode.outData |
( |
| self | ) |
|
|
inherited |
Definition at line 475 of file trfGraph.py.
475 def outData(self):
476 return self._outData
477
◆ outputDataTypes()
| python.trfGraph.graphNode.outputDataTypes |
( |
| self | ) |
|
|
inherited |
Definition at line 483 of file trfGraph.py.
483 def outputDataTypes(self):
484 return self._flattenSet(self._outData)
485
◆ resetConnections()
| python.trfGraph.graphNode.resetConnections |
( |
| self | ) |
|
|
inherited |
Delete all connections.
Definition at line 508 of file trfGraph.py.
508 def resetConnections(self):
509 self._connections = {'in': {}, 'out': {}}
510
◆ weights()
| python.trfGraph.graphNode.weights |
( |
| self | ) |
|
|
inherited |
Definition at line 491 of file trfGraph.py.
492 return self._inWeights
493
◆ _connections
| python.trfGraph.graphNode._connections = {'in': {}, 'out': {}} |
|
protectedinherited |
◆ _inData
| python.trfGraph.graphNode._inData = set(inData) |
|
protectedinherited |
◆ _inputDataTypes
| python.trfGraph.graphNode._inputDataTypes = self._flattenSet(self._inData) |
|
protectedinherited |
◆ _inWeights
| python.trfGraph.graphNode._inWeights = {} |
|
protectedinherited |
- Note
_inWeights takes the form of a dictionary, keyed by input data type and giving the relative cost of executing this node with those input data types.
Definition at line 446 of file trfGraph.py.
◆ _name
| python.trfGraph.graphNode._name = name |
|
protectedinherited |
◆ _outData
◆ _outputDataTypes
| python.trfGraph.graphNode._outputDataTypes = self._flattenSet(self._outData) |
|
protectedinherited |
◆ inData
| python.trfGraph.graphNode.inData |
|
inherited |
The documentation for this class was generated from the following file: