priops.classes

priops.InstanceNode

class priops.classes.InstanceNode(item=None, items=None, node=None)[source]

Bases: priops.node.Node

This Node tells that it fulfils the specifications of another Node if all elements of self are instances of the classes in the other node.

__init__(item=None, items=None, node=None)

Initialises the Node from either one item or many items. One of item or items must be given, but not both. If both item and items are None, it is assumed that item is given as None, and that items is not specified.

Alternatively, the Node can be initialised from another Node instance node. This is needed by derived classes in some cases to provide e.g. slicing operations based on this class’es slicing operation. If node is given, it overrides all other parameters.

fulfils_specification(other_node)[source]

If the lengthes of self and other_node mismatch, then the node does not fulfil the other_node specification. Else, self fulfils the other_node specification, if each element of self is an instance of the corresponding element of other_node. None wildcards in other_node are respected.

__getitem__(key)[source]

If a slice is requested, a sub-InstanceNode is returned. Else, the element is returned.

priops.ClassNode

class priops.classes.ClassNode(item=None, items=None, node=None)[source]

Bases: priops.node.Node

This node tells that it fulfils another specification if all elements of self are subclasses of the corresponding element in the other node.

__init__(item=None, items=None, node=None)

Initialises the Node from either one item or many items. One of item or items must be given, but not both. If both item and items are None, it is assumed that item is given as None, and that items is not specified.

Alternatively, the Node can be initialised from another Node instance node. This is needed by derived classes in some cases to provide e.g. slicing operations based on this class’es slicing operation. If node is given, it overrides all other parameters.

fulfils_specification(other_node)[source]

If the lengthes of self and other_node mismatch, then the node does not fulfil the other_node specification. Else, self fulfils the other_node specification, if each element of self is a subclass of the corresponding element of other_node. None wildcards in other_node are respected.

__getitem__(key)[source]

If a slice is requested, a sub-ClassNode is returned. Else, the element is returned.

priops.ClassPathfinder

class priops.classes.ClassPathfinder(priop, output_node, max_components=None, max_weight=None, scalar=None)[source]

Bases: priops.pathfinder.Pathfinder

This Pathfinder can be called, and the input node will be constructed from InstanceNode.

__init__(priop, output_node, max_components=None, max_weight=None, scalar=None)[source]

Initialises the pathfinding algorith, and arranges for searching for output nodes output_node. output_node might contain None wildcards.

scalar determines how to handle the argument tuple to the call of the object. If true, the call must happen with exactly one argument, and a scalar input node will be used. Else, the input node will be non-scalar, and an arbitrary number of arguments is allowed. The default is False.

get_path(*arguments)[source]

Finds a path to process the arguments.

__call__(*arguments)[source]

Processes non-internode data to non-internode data. The arguments are seen as non-internode data of the corresponding input node. Returned is the non-internode data as returned by self.output_node.

Table Of Contents

Previous topic

priops.callable

Next topic

priops.test

This Page