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

Fix/rich progressbar visibility #19239

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

manascb1344
Copy link

@manascb1344 manascb1344 commented Jan 7, 2024

What does this PR do?

Summary of Change:
This commit introduces a dynamic progress bar color based on the system's color theme. The progress bar will now adjust its color depending on whether the terminal supports color and if it's a truecolor terminal. For dark themes, the progress bar color is set to green, while for light themes, it is set to blue. The RichProgressBarTheme is updated to allow customization of color values for both light and dark themes.

Dependencies:

  • The colored library is required for color support detection.

Fixes #17118

Before submitting
  • Was this discussed/agreed via a GitHub issue? (not for typos and docs)
  • [✔️] Did you read the contributor guideline, Pull Request section?
  • [✔️] Did you make sure your PR does only one thing, instead of bundling different changes together?
  • [] Did you make sure to update the documentation with your changes? (if necessary)
  • [] Did you write any new necessary tests? (not for typos and docs)
  • [✔️] Did you verify new and existing tests pass locally with your changes?
  • [✔️]Did you list all the breaking changes introduced by this pull request?
  • [] Did you update the CHANGELOG? (not for typos, docs, test updates, or minor internal changes/refactors)

PR review

Anyone in the community is welcome to review the PR.
Before you start reviewing, make sure you have read the review guidelines. In short, see the following bullet-list:

Reviewer checklist
  • Is this pull request ready for review? (if not, please submit in draft mode)
  • Check that all items from Before submitting are resolved
  • Make sure the title is self-explanatory and the description concisely explains the PR
  • Add labels and milestones (and optionally projects) to the PR so it can be classified

📚 Documentation preview 📚: https://pytorch-lightning--19239.org.readthedocs.build/en/19239/

@github-actions github-actions bot added pl Generic label for PyTorch Lightning package dependencies Pull requests that update a dependency file labels Jan 7, 2024
@manascb1344
Copy link
Author

Hey @Borda and @awaelchli, noticed my PR #19239 acting up during checks. 🤔 Any insights on why it failed and advice on the necessary tweaks to make it pass? Thanks a bunch! 🙏

@awaelchli awaelchli added progress bar: rich community This PR is from the community labels Jan 10, 2024
@@ -1,5 +1,6 @@
mypy==1.5.1
torch==2.1.0
colored
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@manascb1344 We can't add a dependency to Lightning like this. The rich package is optional for Lightning. Is there a different way to detect the color?

The progress bar will now adjust its color depending on whether the terminal supports color and if it's a truecolor terminal.

Could you check whether this feature is already supported in rich itself? It feels like this is probably something that the package already handles, we just haven't configured it properly. I'm not familiar with this unfortunately.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, isn't purple suitable both for light and dark?

Copy link

gitguardian bot commented Jan 16, 2024

️✅ There are no secrets present in this pull request anymore.

If these secrets were true positive and are still valid, we highly recommend you to revoke them.
Once a secret has been leaked into a git repository, you should consider it compromised, even if it was deleted immediately.
Find here more information about risks.


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

Our GitHub checks need improvements? Share your feedbacks!

@mergify mergify bot removed the has conflicts label Feb 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community This PR is from the community dependencies Pull requests that update a dependency file pl Generic label for PyTorch Lightning package progress bar: rich
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make RichProgressBar visible for both light and dark theme by default
3 participants