Changes from the Review

We can call _echo_finished just once.
skipped: bool = True
if transformed is not None:
_save_transformed(
transformed,
output_time_indices=output_time_index,
output_channel_indices=output_channel_indices,
output_position_path=output_position_path,
)
skipped = False
_echo_finished(
time_index=input_time_index,
channel_index=input_channel_indices,
skipped=skipped,
)
Originally posted by @srivarra in #301 (comment)

Adding a protocol here in addition to the runtime check would be nice. The protocol would be good for IDEs / static analysis. You could also house examples of functions following the protocol in the docstring here.
from typing import Protocol, runtime_checkable
@runtime_checkable
class TransformFunction(Protocol):
def __call__(
self,
data: NDArray,
input_time_index: int | None = None,
**kwargs: Any
) -> NDArray:
"""Transform image data.
Parameters
----------
data : NDArray
CZYX or TCZYX image data to transform
input_time_index : int, optional
Time index for time-dependent transformations
**kwargs
Additional transformation parameters
Returns
-------
NDArray
Transformed data with same shape as input
Examples
--------
>>> def double(data: NDArray, **kwargs) -> NDArray:
... return data * 2
"""
...
def _apply_transform_to_czyx(
func: TransformFunction,
...
Originally posted by @srivarra in #301 (comment)
Changes from the Review
We can call
_echo_finishedjust once.Originally posted by @srivarra in #301 (comment)
Adding a protocol here in addition to the runtime check would be nice. The protocol would be good for IDEs / static analysis. You could also house examples of functions following the protocol in the docstring here.
Originally posted by @srivarra in #301 (comment)