seamless_transformer.transformation_class
Transformation class
Transformation
- kind:
class - signature:
Transformation
Resolve and evaluate transformation checksums, sync or async.
Lifecycle: - .construct() / await .construction(): Evaluate dependencies and builds the transformation dict - .compute() / await .computation() : Run the transformation dict and return the result checksum. - .run() / await .task() : compute, then resolve the result checksum into a value.
Transformation.allow_input_fingertip
- kind:
method - signature:
allow_input_fingertip(self)
If True, inputs may be fingertipped when resolving their buffers.
Transformation.buffer
- kind:
method - signature:
buffer(self)
No docstring.
Transformation.celltype
- kind:
method - signature:
celltype(self)
No docstring.
Transformation.clear_exception
- kind:
method - signature:
clear_exception(self)
No docstring.
Transformation.computation
- kind:
method - signature:
computation(self, require_value)
Run the transformation and return the checksum.
First, constructs the transformation; then, evaluate its result. Returns the result checksum In case of failure, set .exception and return None.
If require_value is True, it is made sure that the value will be available too. (If only the checksum is available, the transformation will be recomputed.)
Transformation.compute
- kind:
method - signature:
compute(self)
Run the transformation and return the checksum.
First, constructs the transformation; then, evaluate its result. Returns the result checksum In case of failure, set .exception and return None.
It is made sure that the result checksum is fingertippable (resolvable or recomputable).
Transformation.construct
- kind:
method - signature:
construct(self)
Evaluate dependencies and calculate the transformation checksum from the inputs In case of failure, set .exception and return None
Transformation.construction
- kind:
method - signature:
construction(self)
Evaluate dependencies and calculate the transformation checksum from the inputs In case of failure, set .exception and return None
Transformation.exception
- kind:
method - signature:
exception(self)
No docstring.
Transformation.logs
- kind:
method - signature:
logs(self)
No docstring.
Transformation.meta
- kind:
method - signature:
meta(self, meta)
No docstring.
Transformation.result_checksum
- kind:
method - signature:
result_checksum(self)
No docstring.
Transformation.run
- kind:
method - signature:
run(self)
Run the transformation and returns the result,
First runs .compute, then fingertip the result checksum into a value. Raise RuntimeError in case of an exception.
Transformation.scratch
- kind:
method - signature:
scratch(self, value)
No docstring.
Transformation.start
- kind:
method - signature:
start(self, *, loop)
Ensure the computation task is scheduled; return self for chaining.
Transformation.status
- kind:
method - signature:
status(self)
No docstring.
Transformation.task
- kind:
method - signature:
task(self)
Create a Task Run the transformation and returns the result,
First runs .compute, then resolve the result checksum into a value. Raise RuntimeError in case of an exception.
Transformation.transformation_checksum
- kind:
method - signature:
transformation_checksum(self)
No docstring.
Transformation.value
- kind:
method - signature:
value(self)
No docstring.
TransformationError
- kind:
class - signature:
TransformationError
No docstring.
_compute_executor_max_workers
- kind:
function - signature:
_compute_executor_max_workers()
No docstring.
_dask_available
- kind:
function - signature:
_dask_available()
No docstring.
_ensure_loop_running
- kind:
function - signature:
_ensure_loop_running(loop)
Run the given event loop in a background thread if it is not already running.
_format_exception
- kind:
function - signature:
_format_exception(exc)
No docstring.
compute_transformation_sync
- kind:
function - signature:
compute_transformation_sync(transformation, *, require_value)
No docstring.
loop_is_nested
- kind:
function - signature:
loop_is_nested(loop)
No docstring.
running_in_jupyter
- kind:
function - signature:
running_in_jupyter()
Function to detect Jupyter-like environments:
-
That have default running event loop. This prevents sync evaluation because that blocks on coroutines running in the same loop
-
That support top-level await as a go-to alternative
transformation_from_dict
- kind:
function - signature:
transformation_from_dict(transformation_dict, *, meta, scratch, tf_dunder)
Build a Transformation from an already-prepared transformation dict.
transformation_from_pretransformation
- kind:
function - signature:
transformation_from_pretransformation(pre_transformation, *, upstream_dependencies, meta, scratch, tf_dunder)
Build a Transformation from a PreTransformation