IoMap

class imagepypelines.IoMap(io_map)[source]

Bases: tuple

mapping object to determine the output of block IoMaps are used to predict the output of a block given a certain type of input. Every block contains an IoMap located under block.io_map :param io_map: dictionary that describes the input outputs of the

block. Of the form: io_map[input_type] = output_type
non_arrays

mapping of non-array input-outputs for this io_map

Type:tuple
arrays

mapping of array input-outputs for this io_map

Type:tuple
inputs

tuple of inputs for this io map

Type:tuple
outputs

tuple of outputs for this io map

Type:tuple

Methods Summary

count(value)
index(value, [start, [stop]]) Raises ValueError if the value is not present.
output(input_types) gets the given output(s) of this IoMap given a input type or types :param input_types: tuple or set of input types :type input_types: tuple,set
reduce(i, o) reduces ArrayTypes with multiple shapes to multiple single shape ArrayTypes ArrayType(shape1,shape2) –> ArrayType(shape1), ArrayType(shape2) :param i: block input :type i: ArrayType :param o: block output :type o: ArrayType
shape_comparison(input_array, acceptable_array) compares ArrayType shapes and returns a boolean to indicate compatability :param input_array: input ArrayType :type input_array: tuple :param acceptable_array: acceptable ArrayTypes :type acceptable_array: tuple

Methods Documentation

count(value) → integer -- return number of occurrences of value
index(value[, start[, stop]]) → integer -- return first index of value.

Raises ValueError if the value is not present.

output(input_types)[source]

gets the given output(s) of this IoMap given a input type or types :param input_types: tuple or set of input types :type input_types: tuple,set

Returns:
tuple of output types this block produces given the
input_types
Return type:outputs(set)
static reduce(i, o)[source]

reduces ArrayTypes with multiple shapes to multiple single shape ArrayTypes ArrayType(shape1,shape2) –> ArrayType(shape1), ArrayType(shape2) :param i: block input :type i: ArrayType :param o: block output :type o: ArrayType

Returns:mapping of reduced types ((i1,o1),(i2,o2)…)
Return type:tuple
static shape_comparison(input_array, acceptable_array)[source]

compares ArrayType shapes and returns a boolean to indicate compatability :param input_array: input ArrayType :type input_array: tuple :param acceptable_array: acceptable ArrayTypes :type acceptable_array: tuple

Returns:
whether or the input shape is compatible with
this block
Return type:compatible(bool)