dataeval.protocols.ProgressCallback¶
- class dataeval.protocols.ProgressCallback¶
Protocol for a callable progress callback function.
Examples
Creating a simple progress callback:
>>> from dataeval.protocols import ProgressCallback >>> >>> class PrintProgress: ... def __call__( ... self, ... step: int, ... *, ... total: int | None = None, ... desc: str | None = None, ... extra_info: dict[str, Any] | None = None, ... ) -> None: ... pct = f" ({step}/{total})" if total else "" ... prefix = f"{desc}: " if desc else "" ... print(f"{prefix}Step {step}{pct}") >>> >>> callback = PrintProgress() >>> isinstance(callback, ProgressCallback) True