Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve ProgressBar docstring to clarify usage of increments and completion #1456

Merged
merged 2 commits into from
Jan 9, 2025

Conversation

QuentinFuxa
Copy link
Contributor

Summary

This pull request refines the documentation for the ProgressBar(Protocol) in _progressbar.py:

  1. Clarifies usage of n vs. completed:

    • Emphasizes that n is generally used for page-based increments.
    • Explains that completed is especially useful for percentage-based tracking.
  2. Adds a Short Example:

    • Demonstrates a simple implementation showcasing both incremental and absolute completion updates for a plugin
  3. Expands the Docstrings:

    • More information about the args used in __init__

Rationale

  • Better Guidance: A clearer protocol for developers who need to customize or create their own progress bars.
  • Forward Compatibility: Stresses ignoring unrecognized **kwargs so it won’t break on future OCRmyPDF releases.
  • Improved Examples: The code snippet helps illustrate how to combine n increments and completed values.

Testing

  • Documentation-Only: No production logic is changed, so minimal risk.

Additional Notes

  • Please review for style consistency with project standards.
  • Suggestions or improvements are always welcome, first PR here!

Copy link

codecov bot commented Jan 9, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.51%. Comparing base (6edc749) to head (dda64ce).
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1456   +/-   ##
=======================================
  Coverage   85.51%   85.51%           
=======================================
  Files          95       95           
  Lines        7120     7120           
  Branches      729      729           
=======================================
  Hits         6089     6089           
  Misses        818      818           
  Partials      213      213           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jbarlow83 jbarlow83 merged commit 66bc4a3 into ocrmypdf:main Jan 9, 2025
15 of 28 checks passed
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.

2 participants