Skip to content

Docs revamp#692

Closed
ricardoV94 wants to merge 3 commits into
pymc-devs:mainfrom
ricardoV94:docs_revamp
Closed

Docs revamp#692
ricardoV94 wants to merge 3 commits into
pymc-devs:mainfrom
ricardoV94:docs_revamp

Conversation

@ricardoV94

Copy link
Copy Markdown
Member

Includes commits from #688

Redesign marginalization around two concepts:

1. marginalize(model) creates MarginalSubgraph markers at build time,
   resolved to typed MarginalRVs (e.g. MarginalFiniteDiscreteRV) via
   an EquilibriumDB of logprob rewrites.

2. conditional(model) replaces marginalized variables with their
   conditional posterior distributions as free RVs, returning a
   standard PyMC model that works with compile_logp and
   sample_posterior_predictive.

recover_marginals now uses conditional() + sample_posterior_predictive
internally.

Other changes:
- Remove the deprecated MarginalModel class
- Split marginal_model.py into model.py, distributions/, rewrites.py
- Support sequential marginalize via unwrap_inner_marginal_rv rewrite
@codecov-commenter

codecov-commenter commented Jun 12, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.26917% with 29 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.04%. Comparing base (86fac3c) to head (fbd8539).
⚠️ Report is 7 commits behind head on main.

Files with missing lines Patch % Lines
pymc_extras/model/marginal/model.py 93.95% 15 Missing ⚠️
pymc_extras/model/marginal/rewrites.py 92.98% 12 Missing ⚠️
..._extras/model/marginal/distributions/enumerable.py 97.87% 1 Missing ⚠️
pymc_extras/model/marginal/distributions/normal.py 97.43% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##             main     #692       +/-   ##
===========================================
+ Coverage   51.60%   91.04%   +39.44%     
===========================================
  Files          73       88       +15     
  Lines        8003     8301      +298     
===========================================
+ Hits         4130     7558     +3428     
+ Misses       3873      743     -3130     
Files with missing lines Coverage Δ
pymc_extras/__init__.py 71.42% <100.00%> (ø)
pymc_extras/inference/INLA/inla.py 100.00% <100.00%> (ø)
pymc_extras/marginal.py 100.00% <100.00%> (ø)
pymc_extras/model/marginal/__init__.py 100.00% <100.00%> (ø)
...mc_extras/model/marginal/distributions/__init__.py 100.00% <100.00%> (ø)
pymc_extras/model/marginal/distributions/core.py 100.00% <100.00%> (ø)
...ymc_extras/model/marginal/distributions/laplace.py 100.00% <100.00%> (ø)
pymc_extras/model/marginal/graph_analysis.py 97.67% <100.00%> (+81.20%) ⬆️
..._extras/model/marginal/distributions/enumerable.py 94.66% <97.87%> (ø)
pymc_extras/model/marginal/distributions/normal.py 97.43% <97.43%> (ø)
... and 2 more

... and 29 files with indirect coverage changes

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

@ricardoV94 ricardoV94 closed this Jun 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants