Unified duration format: elapsed/cur use the same tiered format as eta
115m39s next to eta 2h51m01s read inconsistently; all durations now render as 45s / 7m15s / 1h55m39s / 2h51m01s / 3d02h00m. Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
7b40ecc733
commit
f4ab4b4416
@ -182,7 +182,7 @@ class RichTerminalProgress:
|
||||
description=f'[green]{self.bench_tag}{self.bench_name} · scoring[/green]',
|
||||
total=total, completed=min(done, total), new='',
|
||||
rate=f'{done / elapsed:.2f}', inflight=0, cur='0s',
|
||||
elapsed=_fmt(elapsed),
|
||||
elapsed=_fmt_eta(elapsed),
|
||||
eta=_fmt_eta((total - done) * elapsed / done) if done and total > done else '-')
|
||||
|
||||
def set_bench_tag(self, tag: str):
|
||||
@ -267,7 +267,7 @@ class RichTerminalProgress:
|
||||
new=self._new_txt(completed),
|
||||
rate=f"{fresh / elapsed:.2f}",
|
||||
inflight=self._inflight_txt(), cur='0s',
|
||||
elapsed=_fmt(elapsed),
|
||||
elapsed=_fmt_eta(elapsed),
|
||||
eta=_fmt_eta((task.total - completed) * elapsed / fresh)
|
||||
if fresh and task.total and task.total > completed else '-',
|
||||
)
|
||||
@ -279,8 +279,7 @@ class RichTerminalProgress:
|
||||
try:
|
||||
while self.task_id is not None:
|
||||
e = time.monotonic() - self.started
|
||||
upd = {'elapsed': f'{int(e) // 60}m{int(e) % 60:02d}s' if e >= 60
|
||||
else f'{int(e)}s'}
|
||||
upd = {'elapsed': _fmt_eta(e)}
|
||||
if self.inflight:
|
||||
secs = int(time.monotonic() - self.current_started)
|
||||
upd['cur'] = (f'{secs // 60}m{secs % 60:02d}s'
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user