Skip to content

Conversation

NichtJens
Copy link

@NichtJens NichtJens commented Oct 22, 2024

Type of changes

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

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

I was looking for a generic speed column for Progress preferably with customizable units. I only found #926, which hinted at TransferSpeedColumn being a good example, but did not have a resolution.

This PR adds SpeedColumn, which may be used like this:

SpeedColumn() # default units="it/s"
SpeedColumn(units="Hz")

I reuse TaskProgressColumn.render_speed for consistency and extended both TaskProgressColumn.render_speed and TaskProgressColumn itself to also accept custom units.

Regarding the unit tests, I added a line mimicking the test for TransferSpeedColumn as well as extending test_task_progress_column_speed to test TaskProgressColumn.render_speed with custom units. Is there more desired here?


I believe, I also fixed a documentation bug in TaskProgressColumn.render_speed, which referred to:

  • task (Task): A Task object.

as argument, where it should have been:

  • speed (float): Current value of the speed.

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