62 lines
1.1 KiB
Python
62 lines
1.1 KiB
Python
"""Bar-less progress reporter: narration lines only (terminals without
|
|
rich, CI logs, JSON-adjacent consumers)."""
|
|
from ..eval.registry import EvalRegistry
|
|
|
|
PROGRESS_REGISTRY = EvalRegistry('progress reporter')
|
|
|
|
|
|
def register_progress(name: str):
|
|
def decorator(cls):
|
|
PROGRESS_REGISTRY.register(name, cls)
|
|
return cls
|
|
|
|
return decorator
|
|
|
|
|
|
@register_progress('plain')
|
|
class PlainProgress:
|
|
name = 'plain'
|
|
|
|
def __init__(self, console=None):
|
|
self.console = console
|
|
|
|
def log(self, message):
|
|
print(message, flush=True)
|
|
|
|
# the rest are no-ops: no bars, no per-sample accounting
|
|
def set_overall(self, *a, **k):
|
|
pass
|
|
|
|
def advance_overall(self):
|
|
pass
|
|
|
|
def start(self, *a, **k):
|
|
pass
|
|
|
|
def reset_samples(self, *a, **k):
|
|
pass
|
|
|
|
def set_bench_tag(self, *a, **k):
|
|
pass
|
|
|
|
def set_phase(self, *a, **k):
|
|
pass
|
|
|
|
def begin_sample(self, *a, **k):
|
|
pass
|
|
|
|
def rollback(self):
|
|
pass
|
|
|
|
def advance(self, *a, **k):
|
|
pass
|
|
|
|
def pause(self):
|
|
pass
|
|
|
|
def resume(self):
|
|
pass
|
|
|
|
def close(self):
|
|
pass
|