Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix progressbar with nested compound step samplers#7776

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
jessegrabowski merged 7 commits intopymc-devs:mainfromricardoV94:fix_progress_bar
Jul 16, 2025

Conversation

@ricardoV94
Copy link
Member

@ricardoV94ricardoV94 commentedMay 5, 2025
edited
Loading

Alternative to#7730 thatfixes#7721 andfixes#7724

This comment was marked as outdated.

@aloctavodia
Copy link
Member

Currently, PyMC-BART works without this. However, a recent PR, which allows multiple BART RVs, fails without this. I have not tried with the alternative#7730.

Copy link

CopilotAI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors and centralizes progress bar functionality, updates sampling step methods to use the new API, and adds a regression test for nested compound samplers.

  • MoveCustomProgress,RecolorOnFailureBarColumn,ProgressBarManager, and related logic frompymc/util.py into a newpymc/progress_bar.py module.
  • Update all imports to point topymc.progress_bar and adjust references to the new_make_progressbar_update_functions API.
  • Add an integration test (test_progressbar_nested_compound) to guard against regressions in nestedCompoundStep progress bars.

Reviewed Changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 1 comment.

Show a summary per file
FileDescription
tests/test_progress_bar.pyAdd regression test for nested compound-step sampling progress.
pymc/variational/inference.pyUpdate imports to use newCustomProgress location.
pymc/util.pyRemove old progress-bar classes and imports.
pymc/tuning/starting.pyUpdate progress-bar import to new module.
pymc/step_methods/slicer.pyRename update-stats API to_make_progressbar_update_functions.
pymc/step_methods/metropolis.pyRename and adjust update-stats API.
pymc/step_methods/hmc/*.pyRename and adjust update-stats API in HMC and NUTS.
pymc/step_methods/compound.pyRename and aggregate update-stat functions.
pymc/smc/sampling.pyUpdate progress-bar import.
pymc/sampling/*.pyUpdate progress-bar imports in various sampling pathways.
pymc/progress_bar.pyNew module consolidating progress-bar logic and classes.
.github/workflows/tests.ymlInclude the new test file in CI.
Comments suppressed due to low confidence (1)

pymc/progress_bar.py:37

  • [nitpick] Consider adding unit tests forCustomProgress (e.g., togglingdisable andinclude_headers) to verify that tasks are added, updated, or suppressed as expected.
class CustomProgress(Progress):

@codecov
Copy link

codecovbot commentedJul 9, 2025
edited
Loading

Codecov Report

❌ Patch coverage is95.12195% with10 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.99%. Comparing base (dea3aef) to head (2b50d67).
⚠️ Report is 30 commits behind head on main.

Files with missing linesPatch %Lines
pymc/progress_bar.py93.37%10 Missing⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@##             main    #7776      +/-   ##==========================================+ Coverage   89.19%   92.99%   +3.80%==========================================  Files         107      108       +1       Lines       18313    18327      +14     ==========================================+ Hits        16334    17043     +709+ Misses       1979     1284     -695
Files with missing linesCoverage Δ
pymc/backends/arviz.py95.78% <100.00%> (+0.01%)⬆️
pymc/logprob/abstract.py97.05% <100.00%> (+7.50%)⬆️
pymc/sampling/forward.py96.75% <100.00%> (+0.01%)⬆️
pymc/sampling/mcmc.py91.37% <100.00%> (+0.01%)⬆️
pymc/sampling/parallel.py87.12% <100.00%> (+0.04%)⬆️
pymc/sampling/population.py70.83% <100.00%> (ø)
pymc/smc/sampling.py99.30% <100.00%> (+<0.01%)⬆️
pymc/step_methods/compound.py97.87% <100.00%> (+2.51%)⬆️
pymc/step_methods/hmc/base_hmc.py92.25% <100.00%> (+0.34%)⬆️
pymc/step_methods/hmc/hmc.py94.59% <100.00%> (+1.04%)⬆️
... and7 more

... and18 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member

@jessegrabowskijessegrabowski left a comment

Choose a reason for hiding this comment

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

@ricardoV94 can you give the changes i pushed a final once over then we can merge this

@ricardoV94
Copy link
MemberAuthor

@aloctavodia can you check if this also fixes the problem on your end?

@ricardoV94
Copy link
MemberAuthor

@jessegrabowski I cleanup a bit the PR, if tests pass I think we're good. Wanna take a last look?

jessegrabowski reacted with thumbs up emoji

Copy link
Member

@jessegrabowskijessegrabowski left a comment

Choose a reason for hiding this comment

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

One docstring out of date, and a small issue I want to bring to your attention.

@ricardoV94
Copy link
MemberAuthor

Oops my PR got merged stale and a test is failing

@ricardoV94
Copy link
MemberAuthor

The other failure is ours

@jessegrabowski
Copy link
Member

There was a test with a hardcoded list of expected stats. It should pass now (not sure about the pre-commit problem)

@ricardoV94
Copy link
MemberAuthor

pre-commit seems legit

@aloctavodia
Copy link
Member

I can confirm that this fixes the problem in PyMC-BART

ricardoV94 reacted with thumbs up emoji

ricardoV94and others added2 commitsJuly 16, 2025 12:03
Every step sampler can now decide whether sampling is failing or not by setting "failing" in the returned update dict
@jessegrabowskijessegrabowski merged commit8a436d8 intopymc-devs:mainJul 16, 2025
25 checks passed
@ricardoV94ricardoV94 deleted the fix_progress_bar branchJuly 16, 2025 14:06
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

Copilot code reviewCopilotCopilot left review comments

@jessegrabowskijessegrabowskijessegrabowski approved these changes

Assignees

No one assigned

Labels

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

BUG: Indexing TypeError when sampling with missing observations BUG: Progress bar throws error when nested CompoundSteps are present.

3 participants

@ricardoV94@aloctavodia@jessegrabowski

[8]ページ先頭

©2009-2025 Movatter.jp