Skip to content

feat: selectively re-export Distributions instead of full re-export#2825

Closed
ArpanC6 wants to merge 5 commits into
TuringLang:mainfrom
ArpanC6:fix/selective-distributions-reexport
Closed

feat: selectively re-export Distributions instead of full re-export#2825
ArpanC6 wants to merge 5 commits into
TuringLang:mainfrom
ArpanC6:fix/selective-distributions-reexport

Conversation

@ArpanC6
Copy link
Copy Markdown
Contributor

@ArpanC6 ArpanC6 commented May 11, 2026

Resolves #2682

What

In previous releases @reexport with Distributions meant exporting all 200+ symbols of Distributions.jl via Turing. With the change in Distributions usage an explicitly curated list of exported symbols is provided instead.

Why

Distributions.jl exports lots of internal helper symbols which do not have any use to the users of Turing (for instance sqmahal, qqbuild, nsamples, EdgeworthMean). Exporting such symbols can cause namespace pollution and unintentionally break functionality in some cases.

What is included

All distribution symbols (Normal, Beta, Gamma, and so on)
Core functions: logpdf, pdf, cdf, truncated, censored, product_distribution, insupport, fit, params, mean, var, std, and others.

What is removed

Internal helper functions: sqmahal, qqbuild, QQPair, nsamples, EdgeworthMean/Sum/Z, pdfsquared

@codecov
Copy link
Copy Markdown

codecov Bot commented May 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.61%. Comparing base (18eedab) to head (7f0940c).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2825   +/-   ##
=======================================
  Coverage   84.61%   84.61%           
=======================================
  Files          23       23           
  Lines        1514     1514           
=======================================
  Hits         1281     1281           
  Misses        233      233           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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

@ArpanC6
Copy link
Copy Markdown
Contributor Author

ArpanC6 commented May 11, 2026

The remaining failure (test mcmc/gibbs on macos latest) appears to be a segmentation fault (signal 11) that is unrelated to this PR the same test passes on Ubuntu and Windows. The test at test/mcmc/Inference.jl 634 directly references Distributions as a module which currently requires @reexport using Distributions. I have restored this for now.

However to support a fully selective export approach would it be better to explicitly include using Distributions in the test file instead?

@yebai
Copy link
Copy Markdown
Member

yebai commented May 12, 2026

@ArpanC6 #2682 is not planned. Feel free to work on some other items if you like.

@ArpanC6 ArpanC6 closed this May 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.

Stop re-exporting all of Distributions

2 participants