Skip to content

feat: add IterationSpeedColumn to progress#4157

Open
PierreLapolla wants to merge 3 commits into
Textualize:masterfrom
PierreLapolla:master
Open

feat: add IterationSpeedColumn to progress#4157
PierreLapolla wants to merge 3 commits into
Textualize:masterfrom
PierreLapolla:master

Conversation

@PierreLapolla
Copy link
Copy Markdown

Type of changes

  • Bug fix
  • New feature
  • Documentation / docstrings
  • Tests
  • Other

AI?

  • AI was used to generate this PR

Generated with Claude Sonnet 4.6 via Claude Code, with human supervision and design decisions throughout.

Checklist

  • I've run the latest black with default args on new code.
  • I've updated CHANGELOG.md and CONTRIBUTORS.md where appropriate.
  • I've added tests for new code.
  • I accept that @willmcgugan may be pedantic in the code review.

Description

Adds IterationSpeedColumn, a progress column that displays iteration speed
(e.g. 1.2 it/s). For slow tasks (speed < 1 it/s), it displays inverted
time-per-iteration (e.g. 2.0 s/it), matching tqdm's behaviour. An optional
unit parameter (default "it") allows custom labels such as "sample/s" or
"epoch/s".

This feature was already approved and merged by @willmcgugan in #3332, then
reverted solely due to dynamic setattr on the Task dataclass
(task.last_speed = ...), which breaks static type checkers. This
implementation avoids that entirely — Task is never mutated. The column reads
task.finished_speed or task.speed, both existing fields already tracked by
the framework.

TaskProgressColumn.render_speed is also enhanced (backward compatibly) with
the same slow-task inversion and a style parameter, so unbounded tasks using
show_speed=True benefit too.

Related:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant