-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Implement CustomProgress that does not output empty divs when disabled #7290
Conversation
Some tests are failing, it's because there's something I missed in the child class I created. |
@ricardoV94 this is ready to be reviewed |
@tomicapretto you seem to have picked commits from main, can you rebase? Hard to review otherwise |
0affee2
to
4fd6f32
Compare
I think I did not the cleanest thing but I think it does not show anything from main now |
The You can use the example in #7278 to test for (2). |
@fonnesbeck I'll test some ideas / combinations and update on my findings |
FYI: This has also affected doctests in CausalPy, see pymc-labs/CausalPy#323 Would be very pleased to see a fix :) |
Not to be a bummer, but should we revert to the old progessbar? @fonnesbeck @zaxtax ? |
I'm not sure what was the reason to move away from the old one. But definitely the goodness from rich are not for free. |
I can dig into it a bit later today. If it comes down to color differences, I'm fine with it. If its deeper than that then we probably should seek alternatives (including reverting). |
As I noticed in nutpie, it is also surprisingly easy to build a custom progress bar. We could also adapt something like the nutpie one into pymc if that makes sense. |
@aseyboldt you are using |
Not anymore. This included an updated progressbar: pymc-devs/nutpie#105 It's not released yet though. |
After testing this for a bit, I'm inclined to blame VS Code here rather than rich. The Python interactive pane is very buggy, not just here but in a variety of settings. Buttons on the toolbar often do not work, the input field occasionally gets resized so you can't read the text in it, and so on. Its VS Code's responsibility to have its Jupyter interface behave like a Jupyter notebook, and it often does not. |
In the meantime, should we at least go ahead and merge some version of this PR? It clearly fixes things for a lot of people. |
I agree. I've seen the speed being a lot worse just because of the progressbar. So this is already something. |
The outstanding failure appears to be related to Jax versioning(?) Its complaining about using |
It's blackjax fault: #7317 |
@tomicapretto can you rebase this to get the fix in #7320 ? |
a735896
to
292dae9
Compare
@fonnesbeck I think rebased correctly, but I'm not 100% as I don't find myself doing it often. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #7290 +/- ##
==========================================
+ Coverage 91.84% 92.50% +0.65%
==========================================
Files 102 102
Lines 17149 17177 +28
==========================================
+ Hits 15751 15889 +138
+ Misses 1398 1288 -110
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
pymc-devs#7290) * Replace Progress with CustomProgress * Add update method to CustomProgress * remove unused import * Replace Progress with CustomProgress * Add update method to CustomProgress * Remove some refreshes that slow things down * Remove some 'refresh' and make sure progress goes to 100%
Description
This PR adds a new class
CustomProgress
that inherits fromrich.progress.Progress
. I overloaded the necessary methods to make it not output anything when we disable the progress bar. I feel it's a bit hacky so I would like to know what others think about this modification.This problem is noticeable especially in VS Code. It's not such a big issue in Jupyter Notebook. Some screenshots:
VS Code
progressbar=True
(before and after we get the same result, I cannot get rid of those empty spaces)VS Code
progressbar=False
before the changesVS Code
progressbar=False
after the changesJupyter Notebook after the changes
Update
In the terminal, after the change
Related Issue
📚 Documentation preview 📚: https://pymc--7290.org.readthedocs.build/en/7290/