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

Add DynamicPPL integration tests #2393

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

penelopeysm
Copy link
Member

@penelopeysm penelopeysm commented Nov 15, 2024

This PR adds the Turing/DynamicPPL integration tests (from the test/turing folder in DynamicPPL) to this repository instead.

The main motivation behind this PR is to ensure that the tests added here are always run whenever a new version of Turing is released, thus making it impossible to release a version of Turing that contains a buggy version of DynamicPPL. See TuringLang/DynamicPPL.jl#703 for more thorough explanation.

Some implementation details:

  • I made each test file its own module. This mimics the structure of the other tests in Turing.jl.
  • I had to add AbstractPPL and BangBang as explicit test depedencies (previously they were transitive deps).
  • Because the DynamicPPL integration tests run very quickly, it's probably OK for to run them under the 'everything else' bucket in the CI setup. Hence this PR makes no change to the CI.
  • I fixed a couple of deprecation warnings (specifically link!(vi, sampler) -> link!!(vi, sampler, model); the same with invlink!; and AutoReverseDiff(false) -> AutoReverseDiff(; compile=false)).

Otherwise, this is a straight copy paste.

Copy link

codecov bot commented Nov 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.41%. Comparing base (f4beee9) to head (1412416).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2393   +/-   ##
=======================================
  Coverage   86.41%   86.41%           
=======================================
  Files          22       22           
  Lines        1575     1575           
=======================================
  Hits         1361     1361           
  Misses        214      214           

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

@coveralls
Copy link

coveralls commented Nov 15, 2024

Pull Request Test Coverage Report for Build 12054932691

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 122 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-7.8%) to 78.585%

Files with Coverage Reduction New Missed Lines %
src/mcmc/hmc.jl 122 0.0%
Totals Coverage Status
Change from base Build 12053229696: -7.8%
Covered Lines: 1233
Relevant Lines: 1569

💛 - Coveralls

@test all(x -> DynamicPPL.istrans(vi, x), meta.vns)
DynamicPPL.invlink!!(vi, spl, model)
@test all(x -> !DynamicPPL.istrans(vi, x), meta.vns)
@test meta.vals ≈ v atol=1e-10
Copy link
Contributor

Choose a reason for hiding this comment

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

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
@test meta.vals v atol=1e-10
@test meta.vals v atol = 1e-10

Comment on lines +77 to +78
@test meta.s.vals ≈ v_s atol=1e-10
@test meta.m.vals ≈ v_m atol=1e-10
Copy link
Contributor

Choose a reason for hiding this comment

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

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
@test meta.s.vals v_s atol=1e-10
@test meta.m.vals v_m atol=1e-10
@test meta.s.vals v_s atol = 1e-10
@test meta.m.vals v_m atol = 1e-10

Comment on lines +88 to +89
@test meta.s.vals ≈ v_s atol=1e-10
@test meta.m.vals ≈ v_m atol=1e-10
Copy link
Contributor

Choose a reason for hiding this comment

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

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
@test meta.s.vals v_s atol=1e-10
@test meta.m.vals v_m atol=1e-10
@test meta.s.vals v_s atol = 1e-10
@test meta.m.vals v_m atol = 1e-10

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.

3 participants