kwcoco.util.delayed_ops.delayed_base module

Abstract nodes

class kwcoco.util.delayed_ops.delayed_base.DelayedOperation[source]

Bases: NiceRepr

nesting()[source]
Returns

Dict[str, dict]

as_graph()[source]
Returns

networkx.DiGraph

write_network_text(with_labels=True)[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. In general these should not be used, and may be deprecated.

Returns

ArrayLike

Notes

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

optimize()[source]
Returns

DelayedOperation2

class kwcoco.util.delayed_ops.delayed_base.DelayedNaryOperation(parts)[source]

Bases: DelayedOperation

For operations that have multiple input arrays

children()[source]
Yields

Any

class kwcoco.util.delayed_ops.delayed_base.DelayedUnaryOperation(subdata)[source]

Bases: DelayedOperation

For operations that have a single input array

children()[source]
Yields

Any

kwcoco.util.delayed_ops.delayed_base.DelayedOperation2

alias of DelayedOperation

kwcoco.util.delayed_ops.delayed_base.DelayedUnaryOperation2

alias of DelayedUnaryOperation

kwcoco.util.delayed_ops.delayed_base.DelayedNaryOperation2

alias of DelayedNaryOperation