-
Notifications
You must be signed in to change notification settings - Fork 225
Clean up exports #2474
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
Clean up exports #2474
Conversation
3eec503
to
6a8d318
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## breaking #2474 +/- ##
============================================
+ Coverage 85.53% 86.03% +0.49%
============================================
Files 21 21
Lines 1466 1454 -12
============================================
- Hits 1254 1251 -3
+ Misses 212 203 -9 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
d71170e
to
ebf8bf3
Compare
Pull Request Test Coverage Report for Build 12885951319Details
💛 - Coveralls |
abc1f9b
to
d4c3547
Compare
I think I agree with all the changes listed in OP, although Rather than merging straight to master, should we bundle this with #2458 to form a new breaking release to go out when we feel like is the right moment? |
Happy to release both PRs together! I can't say I feel particularly bad about LogDensityFunction tbh, it's still accessible via DynamicPPL with the same functionality, so we're really just asking people to import it from where it should be imported. |
There's still the wholesale export of MCMCChains which I don't dare to touch. MCMCChains exports a lot of stuff. https://github.com/TuringLang/MCMCChains.jl/blob/master/src/MCMCChains.jl |
8fd6095
to
2409aa1
Compare
2409aa1
to
6c9093f
Compare
6c9093f
to
e9c7cb5
Compare
I changed my mind on LogDensityFunction, it can stay exported. I suspect that over the course of AbstractMCMC refactoring it'll also start to play a larger role. I think it's almost ready for review, will let CI run before requesting one though, as I'm not sure if there are still some imports I need to fix in the test suite. Docs preview: https://turinglang.org/Turing.jl/previews/PR2474/api/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Could we get a HISTORY.md entry? Maybe merge the base branch first before writing it.
Other than that, I still need to build the docs to see how they look but I'm happy otherwise.
src/essential/Essential.jl
Outdated
AutoMooncake, | ||
@logprob_str, | ||
@prob_str | ||
@varname, AutoForwardDiff, AutoReverseDiff, AutoMooncake, @logprob_str, @prob_str |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this the auto-formatter, but it's quite ugly. Any setting we should set to stop this from happening? It bothers me locally too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tldr is no: domluna/JuliaFormatter.jl#358
We could try doing
export a
export b
export c
instead. Part of me might actually prefer this (even though the keyword export is spammed) because it's more resistant towards moving lines up/down (you can't have a trailing comma at the end of the export list, so
export
a,
b,
c,
doesn't work)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't mind spamming export
either, or having a few per line that relate to each other if they fit on one line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed it to
export @model
export @varname
export AutoForwardDiff, AutoReverseDiff, AutoMooncake
and JuliaFormatter seems happy
(Also removed that stray logprob_str and prob_str, oops.)
Co-authored-by: Markus Hauru <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Built docs look good except for one link.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some proposed changes to HISTORY.md, feel free to reject or edit.
Co-authored-by: Markus Hauru <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Penny!
* Bump minor version to v0.37 * Remove selector/space stuff (#2458) * Remove selector stuff from ESS * Remove selector stuff from MH * Remove selector stuff from HMC * Remove selector stuff from Emcee * Remove selector stuff from IS * Add missing getspace methods * Remove selector stuff for particle methods * Fix an HMC selector bug * Code style * Fix Emcee selector bug * Fix typo in ESS tests * Fix some constructor overwrites * Remove unnecessary tests * Remove selector stuff from SGHMC * Remove drop_space and other non-longer-necessary deprecation measures * Bump minor version 0.37. Add a HISTORY.md entry * Apply suggestions from code review Co-authored-by: Penelope Yong <[email protected]> * Remove unnecessary type parameters Co-authored-by: Penelope Yong <[email protected]> * Simplify constructors in particle_mcmc.jl * Remove calls to setgid and updategid --------- Co-authored-by: Penelope Yong <[email protected]> * Bump Mooncake compat to 0.4.95 * Support for DynamicPPL v0.35 (#2488) * Progress towards compat with DPPL v0.35 * More fixing of DPPL v0.35 stuff * Fix LogDensityFunction argument order * More minor bugfixes * [TEMP] Commit Manifest pointing to DynamicPPL#release-0.35 * remove LogDensityProblemsAD (#2490) * Remove LogDensityProblemsAD, part 1 * update Optimisation code to not use LogDensityProblemsAD * Fix field name change * Don't put chunksize=0 * Remove LogDensityProblemsAD dep * Improve OptimLogDensity docstring * Remove unneeded model argument to _optimize * Fix more tests * Remove essential/ad from the list of CI groups * Fix HMC function * more test fixes (#2491) * Remove LogDensityProblemsAD, part 1 * update Optimisation code to not use LogDensityProblemsAD * Fix field name change * Don't put chunksize=0 * Remove LogDensityProblemsAD dep * Improve OptimLogDensity docstring * Remove unneeded model argument to _optimize * Fix more tests * Remove essential/ad from the list of CI groups * Fix HMC function * More test fixes * Remove Manifest * More fixes for DynamicPPL 0.35 (#2494) * Remove test/dynamicppl/compiler.jl * Remove old regression tests * Remove vdemo2 * Fix last test * Add HISTORY.md entry about DPPL 0.35 * Allow ESS to sample variables with different symbols * Update a TODO note --------- Co-authored-by: Penelope Yong <[email protected]> * Fix call to DynamicPPL.initialize_parameters!! * Remove `Zygote` (#2505) * Remove `Zygote`; fix #2504 * Update test/test_utils/ad_utils.jl Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Add HISTORY.md entry about removing support for Zygote --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Markus Hauru <[email protected]> Co-authored-by: Penelope Yong <[email protected]> Co-authored-by: Markus Hauru <[email protected]> * Fix a Gibbs test * Clean up exports (#2474) * Regroup exports by package * Export DynamicPPL.returned and DynamicPPL.prefix * Stop exporting @logprob_str and @prob_str * Remove DynamicPPL module export * Remove DynamicPPL.LogDensityFunction re-export * Remove BernoulliLogit, drop support for Distributions < 0.25.77 * Stop blanket re-exporting Libtask and Bijectors * Manually specify AbstractMCMC exports * Format Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Remove Bijectors.ordered export * Re-export LinearAlgebra.I * Replace Turing.Model -> DynamicPPL.Model * Format * Keep exporting LogDensityFunction * Add note in docs * Align Turing exports with docs API page * Fix things like `predict` on docs API page * Fix a Gibbs test * Format * Fix missing Bijectors import * Update docs/src/api.md Co-authored-by: Markus Hauru <[email protected]> * Update docs/src/api.md Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Clean up broken docs links, remove unneeded deps * Format * Add changelog entry for exports * Clean up exports in essential/Essential * Apply suggestions from code review Co-authored-by: Markus Hauru <[email protected]> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Markus Hauru <[email protected]> Co-authored-by: Markus Hauru <[email protected]> --------- Co-authored-by: Penelope Yong <[email protected]> Co-authored-by: Hong Ge <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Closes #2481
Closes #2468
As mentioned in #2468, I don't think we need to export so many things. I've done a bunch of cuts here, with the intention that if we don't feel comfortable cutting something, we can easily revert specific commits. In my opinion, though, even though it looks like many sweeping changes, I don't think any of these are hugely controversial on their own.
Concretely, this PR does the following:
Stops re-exporting the DynamicPPL module.
Stops re-exporting
@logprob_str
and@prob_str
, which were deprecated several months ago (we've killed off deprecated stuff in far shorter timespans)Stops re-exportingDynamicPPL.LogDensityFunction
, this is an implementation detail that users probably don't need to construct themselves.Bumps the Distributions.jl compat bound (from 0.23 to 0.25.77) and removes code that was required to support old versions of Distributions. Note that DynamicPPL already requires Distributions 0.25.
Removes the blanket re-export of Bijectors and Libtask, as well as the export of
Bijectors.ordered
.ordered
is used in the Gaussian mixture model tutorial, but even there it's imported directly from Bijectors, and I don't think it's unfair to expect users to manually import Bijectors if they want to use this function.Removes the blanket re-export of AbstractMCMC, replacing it with an explicit export list of
sample
,MCMCThreads
,MCMCDistributed
, andMCMCSerial
. Note that these are the only four identifiers which AbstractMCMC itself exports (https://github.com/TuringLang/AbstractMCMC.jl/blob/master/src/AbstractMCMC.jl) so the only change is that the module name itself (AbstractMCMC) is no longer accessible asTuring.AbstractMCMC
.For convenience, re-exports
LinearAlgebra.I
.Exports
DynamicPPL.returned
andDynamicPPL.prefix
(we forgot to re-export this when doing the submodel stuff).Will let CI run before requesting a review.