Skip to content

Fix independent_rvs determination in vectorize_over_posterior #7890

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

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

Conversation

lucianopaz
Copy link
Member

@lucianopaz lucianopaz commented Aug 6, 2025

Description

This PR fixes the determination of independent_rvs RVs in vectorize_over_posterior. I think that the fixed check is much clearer now. It says that an rv is independent if it doesn't depend on an output, a needed_rv (a model freeRV that is replaced by its posterior samples), or another independent_rv. To make sure the check works correctly, the candidate rv nodes are searched in the order given by their topological sort.

Related Issue

Checklist

Type of change

  • New feature / enhancement
  • Bug fix
  • Documentation
  • Maintenance
  • Other (please specify):

📚 Documentation preview 📚: https://pymc--7890.org.readthedocs.build/en/7890/

Copy link

codecov bot commented Aug 6, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.94%. Comparing base (0960323) to head (dcb68e6).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #7890   +/-   ##
=======================================
  Coverage   92.94%   92.94%           
=======================================
  Files         116      116           
  Lines       18851    18851           
=======================================
+ Hits        17521    17522    +1     
+ Misses       1330     1329    -1     
Files with missing lines Coverage Δ
pymc/sampling/forward.py 96.73% <100.00%> (ø)

... and 1 file with indirect coverage changes

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

@lucianopaz lucianopaz requested a review from ricardoV94 August 6, 2025 09:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

vectorize_over_posterior fails to determine independent_rvs
1 participant