-
-
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
Log SMC progress via Python logger when progress bar deactivated #7410
base: main
Are you sure you want to change the base?
Conversation
Output terminals that do not support cursor movement ANSI control sequences do not support rich ProgressBars, and thus need progressbar=false. However, it is still very worthy to know how the SMC tasks are progressing. Therefore, when progress bars are deactivated, any chance to the state of the chains is logged to the default logger, using the exact same state dictionary as used for the progressbars. The fact we only log when a change happens means we do not flood the log. The use of the logging facility also allows the called to add timestamps in the logging handlers for a sense of elapsing time.
@fonnesbeck That might be of interest to you :) |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #7410 +/- ##
=======================================
Coverage 92.18% 92.18%
=======================================
Files 103 103
Lines 17258 17270 +12
=======================================
+ Hits 15909 15921 +12
Misses 1349 1349
|
@zaxtax @ricardoV94 Would you please be able to review, given how you were the reviewers for #7233 and thus already know that part of the code? Thank you :) |
I'm still not convinced the change to rich progressbar was a net positive :) |
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!
@aloctavodia @ricardoV94 @aseyboldt Sorry to nudge, but do you think this could be merged, please? |
That sounds reasonable!
…On Sun, 11 Aug 2024, 20:30 Julien Cornebise, ***@***.***> wrote:
@aloctavodia <https://github.com/aloctavodia> @ricardoV94
<https://github.com/ricardoV94> @aseyboldt <https://github.com/aseyboldt>
Do you think this could be merged, please?
—
Reply to this email directly, view it on GitHub
<#7410 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAACCUNA3CU62J427ET2ZRDZQ6USXAVCNFSM6AAAAABKVNWFZWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOBSHA2DQMBWGE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
👋 Any help merging this please? I believe @ricardoV94 requested a review by @aseyboldt on July 12th, but I imagine Adrian is possibly swamped with less trivial PRs :) Any chance to merge this please? |
Is PyMC log info showing by default? Asking because usually progressbar is disabled when people don't want any output. |
Good point, thanks for raising it. I believe the
Seems logical: besides the pretty display of a progressbar, any other information is just part of the use of the standard logging facility, and can be muted or filtered using the core library's logging module. So if anything, we could argue that I should maybe modify this PR to log to the logger even if
|
Description
Output terminals that do not support cursor movement ANSI control sequences behave very badly with Rich ProgressBars, and thus need progressbar=false. See discussion in #7233 (comment)
However, even in those cases it is still very worthy to know how the SMC tasks are progressing.
Therefore, in this PR, when progress bars are deactivated, any change to the state of the chains is logged to the default logger, using the exact same state dictionary as used for the progressbars. The fact we only log when a change happens means we do not flood the log.
The use of the logging facility also allows the caller to add timestamps in the logging handlers for a sense of elapsing time, or to filter out these progress updates.
Related Issue
Checklist
Included tests that prove the fix is effective or that the new feature works(no test for logging)Added necessary documentation (docstrings and/or example notebooks)(no documentation necessary)Type of change
📚 Documentation preview 📚: https://pymc--7410.org.readthedocs.build/en/7410/