Skip to content
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

Export predict with 0.35 #821

Merged
merged 5 commits into from
Feb 26, 2025
Merged

Export predict with 0.35 #821

merged 5 commits into from
Feb 26, 2025

Conversation

sunxd3
Copy link
Member

@sunxd3 sunxd3 commented Feb 26, 2025

No description provided.

sunxd3 and others added 3 commits February 26, 2025 10:27
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Copy link

codecov bot commented Feb 26, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.60%. Comparing base (a765af3) to head (94b68bf).
Report is 3 commits behind head on release-0.35.

Additional details and impacted files
@@              Coverage Diff              @@
##           release-0.35     #821   +/-   ##
=============================================
  Coverage         84.60%   84.60%           
=============================================
  Files                34       34           
  Lines              3832     3832           
=============================================
  Hits               3242     3242           
  Misses              590      590           

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

Copy link
Member

@mhauru mhauru left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the docs summary. Can/should we export predict though when MCMCChains isn't a dependency of DPPL? It feels odd to me, though I think there may be context here that I'm missing (did we recently change something else about how predict is exported from various packages?). EDIT: Never mind, I was looking at an old branch when grepping.

@sunxd3
Copy link
Member Author

sunxd3 commented Feb 26, 2025

We moved predict from Turing.jl to DynamicPPL.

There are currently two predict in DynamicPPL. One that takes vector of VarInfo, and the other takes Chain.

I am actually not super strong-willed on exporting. It was prompted by TuringLang/Turing.jl#2497 where I just can't get predict to show up on Turing.jl's doc. So I thought we can have predict on DynamicPPL's doc and we just have a pointer in Turing.jl what points to the DynamicPPL's API page.

@yebai
Copy link
Member

yebai commented Feb 26, 2025

Can we mark DynamicPPL.predict as public instead? Generally, we should minimise exports from DynamicPPL and let Turing decide what to export.

Related: compintell/Mooncake.jl#477

@mhauru
Copy link
Member

mhauru commented Feb 26, 2025

Ignore my earlier comment, I was looking at an old branch.

Yes, happy with this to be exported. @yebai, I think generally switching to public could be a good idea for a package that isn't user-facing except for power users. I wonder if we should do it in one big swoop though. Might be a bit confusing if we use public for one thing and one thing only, and everything else is still exported.

@sunxd3
Copy link
Member Author

sunxd3 commented Feb 26, 2025

still the MCMCChainsExt version of the doc is not showing up, maybe I need to transfer the docstring back to the main package?

@coveralls
Copy link

coveralls commented Feb 26, 2025

Pull Request Test Coverage Report for Build 13553064017

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 25 unchanged lines in 4 files lost coverage.
  • Overall coverage decreased (-12.2%) to 72.51%

Files with Coverage Reduction New Missed Lines %
src/model.jl 3 81.67%
src/simple_varinfo.jl 5 76.02%
src/varinfo.jl 6 82.17%
src/threadsafe.jl 11 57.14%
Totals Coverage Status
Change from base Build 13548759744: -12.2%
Covered Lines: 2767
Relevant Lines: 3816

💛 - Coveralls

@penelopeysm
Copy link
Member

penelopeysm commented Feb 26, 2025

still the MCMCChainsExt version of the doc is not showing up

https://discourse.julialang.org/t/display-docstring-for-extension-method-in-documentation/99720

It seems like inside the docs/make.jl file you need to write

modules = [
    DynamicPPL,
    isdefined(Base, :get_extension) ? Base.get_extension(DynamicPPL, :DynamicPPLMCMCChainsExt) : DynamicPPL.DynamicPPLMCMCChainsExt,
]

Or since we are on Julia ≥ 1.10 we can skip the check

modules = [
    DynamicPPL,
    Base.get_extension(DynamicPPL, :DynamicPPLMCMCChainsExt),
]

Edit: I did a PR based on the above: #822

@penelopeysm
Copy link
Member

penelopeysm commented Feb 26, 2025

I'm just going to rebase into the 0.35 branch before merging merge this into the 0.35 branch, then we can merge that into master all at one go.

Thanks for tracking this down @sunxd3 :)

@penelopeysm penelopeysm changed the base branch from master to release-0.35 February 26, 2025 20:47
@penelopeysm penelopeysm merged commit 1dec7a1 into release-0.35 Feb 26, 2025
4 of 15 checks passed
@penelopeysm penelopeysm deleted the sunxd/export_predict branch February 26, 2025 20:47
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.

5 participants