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

Rework Gibbs constructors #2456

Merged
merged 12 commits into from
Jan 8, 2025
Merged

Rework Gibbs constructors #2456

merged 12 commits into from
Jan 8, 2025

Conversation

mhauru
Copy link
Member

@mhauru mhauru commented Jan 7, 2025

In addition to removing the kwarg constructor as discussed in #2442, I also removed the NamedTuple and Dict constructors, to keep the interface simple. I don't see many people using them, and the user can trivially call Gibbs(my_dict...) or Gibbs(pairs(my_namedtuple)...) if need be.

The PR also simplifies a few unrelated lines and expands some docstrings.

Closes #2442

Copy link

codecov bot commented Jan 7, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.00%. Comparing base (0c3d3d0) to head (4f0b970).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2456      +/-   ##
==========================================
- Coverage   85.39%   85.00%   -0.39%     
==========================================
  Files          21       21              
  Lines        1588     1581       -7     
==========================================
- Hits         1356     1344      -12     
- Misses        232      237       +5     

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

@coveralls
Copy link

coveralls commented Jan 7, 2025

Pull Request Test Coverage Report for Build 12656843744

Details

  • 0 of 10 (0.0%) changed or added relevant lines in 1 file are covered.
  • 1054 unchanged lines in 18 files lost coverage.
  • Overall coverage decreased (-69.2%) to 7.687%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/mcmc/gibbs.jl 0 10 0.0%
Files with Coverage Reduction New Missed Lines %
src/variational/VariationalInference.jl 4 0.0%
src/mcmc/abstractmcmc.jl 9 76.6%
src/mcmc/repeat_sampler.jl 16 0.0%
src/mcmc/is.jl 17 0.0%
src/stdlib/RandomMeasures.jl 22 0.0%
src/essential/container.jl 27 0.0%
ext/TuringDynamicHMCExt.jl 29 0.0%
src/mcmc/emcee.jl 49 0.0%
ext/TuringOptimExt.jl 50 0.0%
src/mcmc/ess.jl 52 0.0%
Totals Coverage Status
Change from base Build 12434902283: -69.2%
Covered Lines: 119
Relevant Lines: 1548

💛 - Coveralls

@mhauru mhauru marked this pull request as ready for review January 7, 2025 15:09
@mhauru mhauru requested review from yebai and penelopeysm January 7, 2025 15:10
src/mcmc/gibbs.jl Outdated Show resolved Hide resolved
src/mcmc/gibbs.jl Outdated Show resolved Hide resolved
HISTORY.md Outdated Show resolved Hide resolved
src/mcmc/gibbs.jl Outdated Show resolved Hide resolved
src/mcmc/gibbs.jl Show resolved Hide resolved
@penelopeysm
Copy link
Member

Otherwise, super happy with this, I like APIs that are precise as opposed to ones that let you do whatever 👍😄

@mhauru
Copy link
Member Author

mhauru commented Jan 8, 2025

@yebai are you happy with this interface?

The test failures are two cases of x86 running out of memory and one case of some coveralls network error.

Copy link
Member

@penelopeysm penelopeysm left a comment

Choose a reason for hiding this comment

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

No more comments on my part 🙂

@yebai
Copy link
Member

yebai commented Jan 8, 2025

Thanks @mhauru! I am happy with the interface; feel free to merge.

@mhauru mhauru merged commit 7d6f8ed into master Jan 8, 2025
58 of 62 checks passed
@mhauru mhauru deleted the mhauru/gibbs-constructors branch January 8, 2025 16:44
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.

Remove Gibbs(; m=HMC(0.2, 3), s=PG(10)) in favour of Gibbs(:m=>HMC(0.2, 3), :s=>PG(10))
4 participants