rich icon indicating copy to clipboard operation
rich copied to clipboard

Update progress.rst

Open vikasharma005 opened this issue 2 years ago • 0 comments

Type of changes

  • [ ] Bug fix
  • [ ] New feature
  • [x] Documentation / docstrings
  • [ ] Tests
  • [ ] Other

Checklist

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

Here is the pull request description formatted in Markdown:

Description

This PR improves the documentation around usage of the start() method in the Progress class.

The changes include:

  • Calling out in Basic Usage that start() is required before updating
To initialize the Progress renderer, you must call `start()` before updating:

progress = Progress()
progress.start()
  • Adding examples both with and without a context manager
# Without context manager

progress = Progress()
progress.start()

# With context manager

with Progress() as progress:
  # no need to call start() 
  • Adding Troubleshooting section mentioning start() for no output
If you are not seeing any output from Progress, ensure you called `start()` on the instance before updating.
  • Raising a warning in __init__ if start() not called

  • Updating FAQ with relevant question

This is intended to address #3240 and improve the documentation based on user feedback in #2758

Usage of start() was not clearly documented before, which led to confusion when the display did not update. These updates should clarify the requirement and guide users to call start().

vikasharma005 avatar Dec 31 '23 06:12 vikasharma005