feat: selectively re-export Distributions instead of full re-export#2825
Closed
ArpanC6 wants to merge 5 commits into
Closed
feat: selectively re-export Distributions instead of full re-export#2825ArpanC6 wants to merge 5 commits into
ArpanC6 wants to merge 5 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
Contributor
Author
|
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 However to support a fully selective export approach would it be better to explicitly include using Distributions in the test file instead? |
Member
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #2682
What
In previous releases
@reexportwith 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