Python API

The following API was auto-generated from source code using Auto API.

Pipeline

pixelpipes.ArithmeticOperations
pixelpipes.ComparisonOperations
pixelpipes.ContextFields
pixelpipes.DataType
class pixelpipes.LazyLoadEnum(name)

Bases: Mapping

Special enum class used to load mappings from the core library when they are needed for the first time.

pixelpipes.LogicalOperations
class pixelpipes.Pipeline(data: Iterable[PipelineOperation], optimize: bool = None)

Bases: object

Wrapper for the C++ pipeline object, includes additional metadata. This wrapper should be used instead of interacting with the C++ object directly.

property metadata

Accesses the pipeline metadata storage.

Returns:

MappingProxyType: A string to string key-value storage.

property outputs

Returns description of the pipeline outputs.

Returns:

List[Tuple[str, “pixelpipes.types.Token”]]: List of tuples with output name and inferred type.

run(index: int)

Executes the pipeline for a given index and resturns result

Args:

index (int): Index of sample to generate. Starts with 1.

Returns:

Tuple[np.ndarray]: Generated sample, a sequence of NumPy objects.

pixelpipes.PipelineOperation
pixelpipes.evaluate_operation(name: str, inputs, arguments)
pixelpipes.include_dirs()

Returns a list of directories with C++ header files for pixelpipes core library. Useful when building pixelpipes modules.

Returns:

List[str]: List of directories

Returns a list of directories where a pixelpipe library can be found. Useful when building pixelpipes modules.

Returns:

List[str]: List of directories

pixelpipes.list_operations()

Returns a list of all available operations.

Returns:

List[str]: List of operation names.

pixelpipes.load_module(name)
pixelpipes.modules_path
pixelpipes.read_pipeline(filename: str)

Reads pipeline from a file.

Args:

filename (str): Filename to read from.

Returns: Pipeline object

pixelpipes.visualize_pipeline(pipeline: Pipeline)
pixelpipes.write_pipeline(filename: str, pipeline: Pipeline, compress: bool | None = True)

Serializes pipeline to a file with optional compression

Args:

filename (str): Filename to use. pipeline (Pipeline): Pipeline to serialize. compress (Optional[bool], optional): Use GZIP compression or not. Defaults to True.

Graph

class pixelpipes.graph.Constant(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)

Bases: Operation

Generates a constant in the pipeline

key()
operation()

Generates a operation construction data that is passed to the library

Returns:

typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.

static resolve_type(value)
value
class pixelpipes.graph.Context(**kwargs)

Bases: object

static get(key: str, default=None)
static snapshot()
pixelpipes.graph.ContextFields
class pixelpipes.graph.Copy(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)

Bases: Node

Copy node is a special node that copies the input to the output. It is not an operation or a macro, it is only used as a helper and is removed during compilation.

source
class pixelpipes.graph.Data

Bases: object

Abstract type base, represents description of token types accepted or returned by nodes.

abstract castable(typ: Data)

Can object of given input type description be casted to this type.

common(typ: Data)

Merge two types by finding their common type. By default this just looks if one type is castable into the other.

class pixelpipes.graph.Debug(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)

Bases: Operation

Debug operation enables low-level terminal output of the content that is provided to it. The token content will usually not be printed entierly, only its shape, the value will only be displayed for simple scalar types as well as strings.

Note that tese nodes will be passed to the pipeline only if the compiler is configered with debug flag, otherwise they will be stripped from the graph.

operation()

Generates a operation construction data that is passed to the library

Returns:

typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.

prefix
source
class pixelpipes.graph.EnumerationInput(options, default=None, description='')

Bases: Input

coerce(value, _)
dump(value)
class pixelpipes.graph.Graph(prefix: str | Reference | None = '')

Bases: object

add(node: Node, name: str | Reference | None = None)
static add_default(node: Node, name: str)
commit()
copy()
static default()
static has_default()
nodes()
pipeline(variables=None, output=None)
reference(node: Node)
remove(node: Node | Reference)
replace(oldnode: Node | Reference, newnode: Node)
subgraph(prefix: str | Reference | None = '')
class pixelpipes.graph.InferredReference(ref: str, data)

Bases: Reference, OperationProxy

A node reference with type or value already inferred. Used during compilation and in macro expansion.

property type
class pixelpipes.graph.Input(reftype: pixelpipes.types.Data, default: str | float | int | None = None, description: str | None = '')

Bases: attributee.Attribute

coerce(value, _)
dump(value)
reftype()
class pixelpipes.graph.Macro(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)

Bases: Node

Base class for all nodes in a computation graph.

property context
evaluate(**inputs)

Will not evaluate to a type, just return None

abstract expand(**inputs)
class pixelpipes.graph.Node(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)

Bases: attributee.Attributee, OperationProxy

Base class for all nodes in a computation graph.

duplicate(_name=None, _origin=None, **inputs)
evaluate(**inputs)
property frame
get_inputs()
classmethod hidden()
input_names()
input_types()
input_values()
classmethod name()
property origin

Only relevant for nodes generated during compilation, makes it easier to track original node from the source graph. Returns None in other cases.

exception pixelpipes.graph.NodeException(*args, node: Node | None = None)

Bases: Exception

Common base class for all non-exit exceptions.

property node
nodestack()
print_nodestack()
class pixelpipes.graph.NodeOperation(*args, **kwds)

Bases: enum.Enum

Create a collection of name/value pairs.

Example enumeration:

>>> class Color(Enum):
...     RED = 1
...     BLUE = 2
...     GREEN = 3

Access them by:

  • attribute access:

>>> Color.RED
<Color.RED: 1>
  • value lookup:

>>> Color(1)
<Color.RED: 1>
  • name lookup:

>>> Color['RED']
<Color.RED: 1>

Enumerations can be iterated over, and know how many members they have:

>>> len(Color)
3
>>> list(Color)
[<Color.RED: 1>, <Color.BLUE: 2>, <Color.GREEN: 3>]

Methods can be added to enumerations, and members can have their own attributes – see the documentation for details.

ADD
DIVIDE
EQUAL
GREATER
GREATER_EQUAL
INDEX
LENGTH
LOGICAL_AND
LOGICAL_NOT
LOGICAL_OR
LOWER
LOWER_EQUAL
MODULO
MULIPLY
NEGATE
NOT_EQUAL
POWER
SUBTRACT
class pixelpipes.graph.Operation(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)

Bases: Node

Base class of all atomic nodes that generate pipeline operations

operation()

Generates a operation construction data that is passed to the library

Returns:

typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.

class pixelpipes.graph.OperationProxy
static query_operation(operation: NodeOperation, *qargs: pixelpipes.types.Data)
static register_operation(operation: NodeOperation, generator: Callable, *args: pixelpipes.types.Data)
class pixelpipes.graph.Output(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)

Bases: Operation

Output node that accepts a single input, enables outputting tokens from the final pipeline. Tokens are returned as a tuple, their order is determined by the order of adding output nodes to the graph. Additionally you may also label outputs with non-unique lables that can be used to resolve outputs.

label
operation()

Generates a operation construction data that is passed to the library

Returns:

typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.

output
class pixelpipes.graph.RandomSeed(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)

Bases: Operation

Returns a pseudo-random number, useful for initializing pseudo-random operations. The seed itself is sampled from a pseudo-random generator that produces the same sequence of seeds for a specific position in the data sequence. This is the corner-stone of repeatability of the pipeline.

operation()

Generates a operation construction data that is passed to the library

Returns:

typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.

class pixelpipes.graph.ReadFile(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)

Bases: Operation

Read file from disk to memory buffer. File is read in binary mode.

filename
operation()

Generates a operation construction data that is passed to the library

Returns:

typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.

class pixelpipes.graph.Reference(ref: str | Reference)

Bases: object

property name
static parse(value)
class pixelpipes.graph.SampleIndex(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)

Bases: Operation

Returns current sample index. This information can be used instead of random seed to initialize random generators where sequential consistentcy is required.

operation()

Generates a operation construction data that is passed to the library

Returns:

typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.

class pixelpipes.graph.SeedInput(description='')

Bases: Input

exception pixelpipes.graph.ValidationException(*args, node: Node | None = None)

Bases: NodeException

Common base class for all non-exit exceptions.

pixelpipes.graph.evaluate_operation(name: str, inputs, arguments)
pixelpipes.graph.hidden(node_class)
pixelpipes.graph.outputs(*inputs, label='default')
pixelpipes.graph.wrap_pybind_enum(bindenum)

Compiler

A compiler converts a graph to a sequence of operations.

class pixelpipes.compiler.Compiler(debug=False)

Bases: object

Compiler object contains utilities to validate a graph and compiles it to a pipeline (a sequence of operations, written in native code) that can be executed to obtain output variables.

build(graph: pixelpipes.graph.Graph, variables: Mapping[str, numbers.Number] | None = None, output: collections.abc.Container | Callable | None = None, optimize: bool = None)

Compiles the graph and builds a pipeline from it in one function.

Args:

graph (Graph): _description_ variables (typing.Optional[typing.Mapping[str, numbers.Number]], optional): _description_. Defaults to None. output (typing.Optional[typing.Union[Container, typing.Callable]], optional): _description_. Defaults to None. optimize (bool, optional): Optimize conditional operations by inserting jumps into the pipeline and using cache.

Returns:

Pipeline: Pipeline object

static build_graph(graph: pixelpipes.graph.Graph | Mapping[str, pixelpipes.graph.Node], variables: Mapping[str, numbers.Number] | None = None, output: str | None = None)
compile(graph: pixelpipes.graph.Graph, variables: Mapping[str, numbers.Number] | None = None, output: collections.abc.Container | Callable | None = None)

Compile a graph into a pipeline of native operations.

Args:

graph (Graph): Graph representation

Raises:

CompilerException: raised if graph is not valid

Returns:

engine.Pipeline: resulting pipeline

validate(graph: pixelpipes.graph.Graph | Mapping[str, pixelpipes.graph.Node])

Validates graph by interring input and output types for all nodes. An exception will be thrown if dependencies cannot be resolved or if output of a node is not compatible with an input specification of a dependant node.

Args:

graph (typing.Mapping or Graph): Graph representation

Raises:

ValidationException: Different validation errors share this exception type

Returns:

dict: resolved types of all nodes

exception pixelpipes.compiler.CompilerException

Bases: Exception

Common base class for all non-exit exceptions.

class pixelpipes.compiler.Conditional(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)

Bases: pixelpipes.graph.Operation

Node that executes conditional selection, output of branch “true” will be selected if the “condition” is not zero, otherwise output of branch “false” will be selected. Note that the inferred type of these two branches should match as much as possible, otherwise the inferred type of this node will cause problems with dependent nodes.

condition
false
operation()

Generates a operation construction data that is passed to the library

Returns:

typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.

true
class pixelpipes.compiler.Constant(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)

Bases: Operation

Generates a constant in the pipeline

key()
operation()

Generates a operation construction data that is passed to the library

Returns:

typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.

static resolve_type(value)
value
class pixelpipes.compiler.Copy(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)

Bases: Node

Copy node is a special node that copies the input to the output. It is not an operation or a macro, it is only used as a helper and is removed during compilation.

source
class pixelpipes.compiler.Debug(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)

Bases: Operation

Debug operation enables low-level terminal output of the content that is provided to it. The token content will usually not be printed entierly, only its shape, the value will only be displayed for simple scalar types as well as strings.

Note that tese nodes will be passed to the pipeline only if the compiler is configered with debug flag, otherwise they will be stripped from the graph.

operation()

Generates a operation construction data that is passed to the library

Returns:

typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.

prefix
source
class pixelpipes.compiler.Graph(prefix: str | Reference | None = '')

Bases: object

add(node: Node, name: str | Reference | None = None)
static add_default(node: Node, name: str)
commit()
copy()
static default()
static has_default()
nodes()
pipeline(variables=None, output=None)
reference(node: Node)
remove(node: Node | Reference)
replace(oldnode: Node | Reference, newnode: Node)
subgraph(prefix: str | Reference | None = '')
class pixelpipes.compiler.InferredReference(ref: str, data)

Bases: Reference, OperationProxy

A node reference with type or value already inferred. Used during compilation and in macro expansion.

property type
class pixelpipes.compiler.Macro(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)

Bases: Node

Base class for all nodes in a computation graph.

property context
evaluate(**inputs)

Will not evaluate to a type, just return None

abstract expand(**inputs)
class pixelpipes.compiler.Node(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)

Bases: attributee.Attributee, OperationProxy

Base class for all nodes in a computation graph.

duplicate(_name=None, _origin=None, **inputs)
evaluate(**inputs)
property frame
get_inputs()
classmethod hidden()
input_names()
input_types()
input_values()
classmethod name()
property origin

Only relevant for nodes generated during compilation, makes it easier to track original node from the source graph. Returns None in other cases.

exception pixelpipes.compiler.NodeException(*args, node: Node | None = None)

Bases: Exception

Common base class for all non-exit exceptions.

property node
nodestack()
print_nodestack()
class pixelpipes.compiler.Operation(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)

Bases: Node

Base class of all atomic nodes that generate pipeline operations

operation()

Generates a operation construction data that is passed to the library

Returns:

typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.

class pixelpipes.compiler.Output(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)

Bases: Operation

Output node that accepts a single input, enables outputting tokens from the final pipeline. Tokens are returned as a tuple, their order is determined by the order of adding output nodes to the graph. Additionally you may also label outputs with non-unique lables that can be used to resolve outputs.

label
operation()

Generates a operation construction data that is passed to the library

Returns:

typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.

output
class pixelpipes.compiler.Pipeline(data: Iterable[PipelineOperation], optimize: bool = None)

Bases: object

Wrapper for the C++ pipeline object, includes additional metadata. This wrapper should be used instead of interacting with the C++ object directly.

property metadata

Accesses the pipeline metadata storage.

Returns:

MappingProxyType: A string to string key-value storage.

property outputs

Returns description of the pipeline outputs.

Returns:

List[Tuple[str, “pixelpipes.types.Token”]]: List of tuples with output name and inferred type.

run(index: int)

Executes the pipeline for a given index and resturns result

Args:

index (int): Index of sample to generate. Starts with 1.

Returns:

Tuple[np.ndarray]: Generated sample, a sequence of NumPy objects.

pixelpipes.compiler.PipelineOperation
class pixelpipes.compiler.RandomSeed(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)

Bases: Operation

Returns a pseudo-random number, useful for initializing pseudo-random operations. The seed itself is sampled from a pseudo-random generator that produces the same sequence of seeds for a specific position in the data sequence. This is the corner-stone of repeatability of the pipeline.

operation()

Generates a operation construction data that is passed to the library

Returns:

typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.

class pixelpipes.compiler.Reference(ref: str | Reference)

Bases: object

property name
static parse(value)
class pixelpipes.compiler.SampleIndex(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)

Bases: Operation

Returns current sample index. This information can be used instead of random seed to initialize random generators where sequential consistentcy is required.

operation()

Generates a operation construction data that is passed to the library

Returns:

typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.

exception pixelpipes.compiler.ValidationException(*args, node: Node | None = None)

Bases: NodeException

Common base class for all non-exit exceptions.

pixelpipes.compiler.infer_type(node: pixelpipes.graph.Reference | str, graph: pixelpipes.graph.Graph = None, type_cache: Mapping[str, pixelpipes.types.Data] = None)

Computes output type for a given node by recursively computing types of its dependencies and calling validate method of a node with the information about their computed output types.

Args:

node (typing.Union[Reference, typing.Type[Node]]): Reference of the node or raw value graph (Graph): Mapping of all nodes in the graph type_cache (typing.Mapping[str, types.Type], optional): Optional cache for already computed types. Makes repetititve calls much faster. Defaults to None.

Raises:

ValidationException: Contains information about the error during node validation process.

Returns:

types.Type: Computed type for the given node.

pixelpipes.compiler.toposort(data)

Dependencies are expressed as a dictionary whose keys are items and whose values are a set of dependent items. Output is a list of sets in topological order. The first set consists of items with no dependences, each subsequent set consists of items that depend upon items in the preceeding sets.

Sinks

Sink is a utility class that execute a pipeline in multiple threads and stack sample outputs to batches.

class pixelpipes.sink.AbstractDataLoader(batch: int, workers: int | WorkerPool | None = None, offset: int = 0)

Bases: object

benchmark(n=100)
class pixelpipes.sink.BatchIterator(commit, size: int, offset: int = 0)

Bases: object

Abstract batch iterator base with most functionality for consumer agnostic multithreaded batching of samples.

class pixelpipes.sink.Pipeline(data: Iterable[PipelineOperation], optimize: bool = None)

Bases: object

Wrapper for the C++ pipeline object, includes additional metadata. This wrapper should be used instead of interacting with the C++ object directly.

property metadata

Accesses the pipeline metadata storage.

Returns:

MappingProxyType: A string to string key-value storage.

property outputs

Returns description of the pipeline outputs.

Returns:

List[Tuple[str, “pixelpipes.types.Token”]]: List of tuples with output name and inferred type.

run(index: int)

Executes the pipeline for a given index and resturns result

Args:

index (int): Index of sample to generate. Starts with 1.

Returns:

Tuple[np.ndarray]: Generated sample, a sequence of NumPy objects.

class pixelpipes.sink.PipelineDataLoader(pipeline: pixelpipes.Pipeline, batch: int, workers: int | WorkerPool | None = None, offset: int | None = 0)

Bases: AbstractDataLoader

property pipeline
class pixelpipes.sink.WorkerPool(max_workers: int = 1)

Bases: concurrent.futures.ThreadPoolExecutor

This is an abstract base class for concrete asynchronous executors.

Utilities

Utilites for more efficient common usecases.

class pixelpipes.utilities.Counter

Bases: object

Object based counter, each time it is called it returns a value greater by 1

class pixelpipes.utilities.Node(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)

Bases: attributee.Attributee, OperationProxy

Base class for all nodes in a computation graph.

duplicate(_name=None, _origin=None, **inputs)
evaluate(**inputs)
property frame
get_inputs()
classmethod hidden()
input_names()
input_types()
input_values()
classmethod name()
property origin

Only relevant for nodes generated during compilation, makes it easier to track original node from the source graph. Returns None in other cases.

exception pixelpipes.utilities.NodeException(*args, node: Node | None = None)

Bases: Exception

Common base class for all non-exit exceptions.

property node
nodestack()
print_nodestack()
class pixelpipes.utilities.Output(*args, _name: str = None, _auto: bool = True, _origin: Node = None, **kwargs)

Bases: Operation

Output node that accepts a single input, enables outputting tokens from the final pipeline. Tokens are returned as a tuple, their order is determined by the order of adding output nodes to the graph. Additionally you may also label outputs with non-unique lables that can be used to resolve outputs.

label
operation()

Generates a operation construction data that is passed to the library

Returns:

typing.Tuple: A tuple of library arguments, the first one being the name of the operation and the rest its construction arguments.

output
class pixelpipes.utilities.PersistentDict(root: str)

A dictionary interface to a folder, with memory caching.

class pixelpipes.utilities.Pipeline(data: Iterable[PipelineOperation], optimize: bool = None)

Bases: object

Wrapper for the C++ pipeline object, includes additional metadata. This wrapper should be used instead of interacting with the C++ object directly.

property metadata

Accesses the pipeline metadata storage.

Returns:

MappingProxyType: A string to string key-value storage.

property outputs

Returns description of the pipeline outputs.

Returns:

List[Tuple[str, “pixelpipes.types.Token”]]: List of tuples with output name and inferred type.

run(index: int)

Executes the pipeline for a given index and resturns result

Args:

index (int): Index of sample to generate. Starts with 1.

Returns:

Tuple[np.ndarray]: Generated sample, a sequence of NumPy objects.

class pixelpipes.utilities.Reference(ref: str | Reference)

Bases: object

property name
static parse(value)
pixelpipes.utilities.change_environment(*remove, **update)

Temporarily updates the os.environ dictionary in-place and restores it upon exit.

Args:

remove: Environment variables to remove. update: Dictionary of environment variables and values to add/update.

pixelpipes.utilities.collage(pipeline: pixelpipes.Pipeline, index: int, rows: int, columns: int, offset: int | None = 0)
pixelpipes.utilities.find_nodes(module=None)

Find all nodes in a given module. Returns a list of classes

Args:

module (_type_, optional): _description_. Defaults to None.

Returns:

_type_: _description_

pixelpipes.utilities.graph(constructor)
pixelpipes.utilities.limit(pipeline: pixelpipes.Pipeline, field: int | str)

Returns a bounded generator for the pipeline, in every iteration a given field value is compared to the current sample number, if the value is reached or supassed the generation is interrupted.

Args:

pipeline (Pipeline): Original pipeline property (typing.Union[int, str]): Either field label or field index

Yields:

Tuple: Sample from a pipeline sequence.

pixelpipes.utilities.pipeline(variables=None, debug=False)

Types

Token type representation wrapper.

class pixelpipes.types.Anything

Bases: Data

Denotes type that accepts all inputs.

castable(typ: Data)

Can object of given input type description be casted to this type.

pixelpipes.types.Boolean()
pixelpipes.types.BooleanList(length=None)
pixelpipes.types.Buffer(length=None)
pixelpipes.types.Char()
class pixelpipes.types.Data

Bases: object

Abstract type base, represents description of token types accepted or returned by nodes.

abstract castable(typ: Data)

Can object of given input type description be casted to this type.

common(typ: Data)

Merge two types by finding their common type. By default this just looks if one type is castable into the other.

pixelpipes.types.Float()
pixelpipes.types.FloatList(length=None)
pixelpipes.types.Image(width: int | None = None, height: int | None = None, channels: int | None = None, depth: str | None = None)

Represents an image type. This type can be specialized with image width, height, number of channels as well as bit-depth.

pixelpipes.types.Integer()
pixelpipes.types.IntegerList(length=None)
pixelpipes.types.List(element=None, length=None)

Type that represents a list of elements.

pixelpipes.types.Point()
pixelpipes.types.Points(length=None)
pixelpipes.types.Rectangle()
pixelpipes.types.Short()
pixelpipes.types.String(length=None)
class pixelpipes.types.Token(element=None, *shape)

Bases: Data

Abstract type base, represents description of token types accepted or returned by nodes.

castable(typ: Data)

Can object of given input type description be casted to this type.

common(typ: Data)

Merge two types by finding their common type. By default this just looks if one type is castable into the other.

property element
pop()
push(length=None)
property rank
squeeze()
exception pixelpipes.types.TypeException

Bases: Exception

Common base class for all non-exit exceptions.

class pixelpipes.types.Union(*args: Data)

Bases: Data

Denotes type that accepts any of the given inputs. Do not nest unions.

castable(typ: Data)

Can object of given input type description be casted to this type.

common(typ: Data)

Merge two types by finding their common type. By default this just looks if one type is castable into the other.

pixelpipes.types.UnsignedChar()
pixelpipes.types.UnsignedShort()
pixelpipes.types.View()
class pixelpipes.types.Wildcard(element=None, mindim=None, maxdim=None)

Bases: Token

Abstract type base, represents description of token types accepted or returned by nodes.

castable(typ: Data)

Can object of given input type description be casted to this type.

common(typ: Data)

Merge two types by finding their common type. By default this just looks if one type is castable into the other.

pixelpipes.types.cast_element(source: str, destination: str)
pixelpipes.types.convert_element(element)