delayed_image.delayed_base module

Abstract nodes

class delayed_image.delayed_base.DelayedOperation[source]

Bases: NiceRepr

nesting()[source]
Returns

Dict[str, dict]

as_graph(fields='auto')[source]

Builds the underlying graph structure as a networkx graph with human readable labels.

Parameters

fields (str | List[str]) – Add the specified fields as labels. If ‘auto’ then does somthing “reasonable”. If ‘all’ then shows everything. TODO: only implemented for “auto” and “all”, implement general field selection (PR Wanted).

Returns

networkx.DiGraph

print_graph(fields='auto', with_labels=True, rich='auto')[source]

Alias for write_network_text

write_network_text(fields='auto', with_labels=True, rich='auto')[source]
property shape

Returns: None | Tuple[int | None, …]

children()[source]
Yields

Any

prepare()[source]

If metadata is missing, perform minimal IO operations in order to prepopulate metadata that could help us better optimize the operation tree.

Returns

DelayedOperation2

finalize(prepare=True, optimize=True, **kwargs)[source]

Evaluate the operation tree in full.

Parameters
  • prepare (bool) – ensure prepare is called to ensure metadata exists if possible before optimizing. Defaults to True.

  • optimize (bool) – ensure the graph is optimized before loading. Default to True.

  • **kwargs – for backwards compatibility, these will allow for in-place modification of select nested parameters.

Returns

ArrayLike

Notes

Do not overload this method. Overload DelayedOperation2._finalize() instead.

optimize()[source]
Returns

DelayedOperation2

class delayed_image.delayed_base.DelayedNaryOperation(parts)[source]

Bases: DelayedOperation

For operations that have multiple input arrays

children()[source]
Yields

Any

class delayed_image.delayed_base.DelayedUnaryOperation(subdata)[source]

Bases: DelayedOperation

For operations that have a single input array

children()[source]
Yields

Any