Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ricardoV94
Copy link
Member

@ricardoV94 ricardoV94 commented May 5, 2025

Alternative to #7730 that fixes #7721 and fixes #7724

@github-actions github-actions bot added the bug label May 5, 2025
Copy link

@Copilot Copilot AI 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 addresses issues with the progress bar when using nested compound step samplers. Key changes include:

  • Renaming update stats function(s) across several step method modules.
  • Revising the logic for accumulating and mapping progress stats.
  • Adjustments to support multiple update functions in the progress bar update routines.

Reviewed Changes

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

Show a summary per file
File Description
pymc/util.py Updates progress stats accumulation; renames update function
pymc/step_methods/slicer.py Replaces singular update function with a tuple of functions
pymc/step_methods/metropolis.py Updates update stats function to rename "accept" key appropriately
pymc/step_methods/hmc/nuts.py Uses new update functions pattern
pymc/step_methods/compound.py Refactors compound step update functions accordingly

for step_stats in chain_progress_stats:
for key, val in step_stats.items():
if key in all_step_stats:
continue
Copy link
Preview

Copilot AI May 5, 2025

Choose a reason for hiding this comment

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

The 'continue' statement immediately after checking if the key exists prevents the subsequent duplicate-key handling code (which calculates a new suffix) from ever executing. Consider removing 'continue' so that duplicate keys are properly renamed.

Suggested change
continue

Copilot uses AI. Check for mistakes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
1 participant