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

Some clean up of contexts #711

Merged
merged 20 commits into from
Nov 28, 2024
Merged

Some clean up of contexts #711

merged 20 commits into from
Nov 28, 2024

Conversation

torfjelde
Copy link
Member

Some cleanup of the context implementations:

  1. Fixes bug in PrefixContext which doesn't actually work for .~ statements due to implementing the incorrect signature.
  2. Removes now-unusued implementations of tilde_*_assume/observe methods for PriorContext and LikelihoodContext + removed their vars field which is also not used any more (this was only used by the logprob macro which was removed in Remove the prob and logprob macros #604 )

@coveralls
Copy link

coveralls commented Nov 1, 2024

Pull Request Test Coverage Report for Build 11740182612

Details

  • 31 of 31 (100.0%) changed or added relevant lines in 4 files are covered.
  • 23 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+1.5%) to 83.389%

Files with Coverage Reduction New Missed Lines %
src/model.jl 3 91.58%
src/threadsafe.jl 20 50.86%
Totals Coverage Status
Change from base Build 11731628292: 1.5%
Covered Lines: 3474
Relevant Lines: 4166

💛 - Coveralls

Copy link

codecov bot commented Nov 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.38%. Comparing base (d6e2147) to head (decaa78).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #711      +/-   ##
==========================================
+ Coverage   81.90%   83.38%   +1.48%     
==========================================
  Files          30       30              
  Lines        4200     4166      -34     
==========================================
+ Hits         3440     3474      +34     
+ Misses        760      692      -68     

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

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.

LGTM as remaining CI errors are known to be due to #702

@torfjelde
Copy link
Member Author

Thanks @penelopeysm !

Fixes bug in PrefixContext which doesn't actually work for .~ statements due to implementing the incorrect signature.

I think we need a way to test this though (as that would have caught the current bug). IMO every context should at be evaluated with both DefaultContext and SamplingContext to ensure that the full tilde-pipeline is implemented.

@torfjelde
Copy link
Member Author

torfjelde commented Nov 5, 2024

Think this PR is ready for another round of reviews 👍 Added proper testing for the contexts + a test_context function to streamline the testing of a new context a bit more. Also fixed quite a few bugs in the process 😬

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@torfjelde torfjelde self-assigned this Nov 5, 2024
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.

Still looks good, save for one question!

torfjelde and others added 3 commits November 8, 2024 11:12
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@torfjelde torfjelde enabled auto-merge November 11, 2024 13:17
src/test_utils.jl Outdated Show resolved Hide resolved
test/debug_utils.jl Outdated Show resolved Hide resolved
Co-authored-by: Penelope Yong <[email protected]>
@torfjelde
Copy link
Member Author

Thank you @penelopeysm !

@torfjelde torfjelde disabled auto-merge November 12, 2024 09:33
@torfjelde torfjelde enabled auto-merge November 12, 2024 09:34
@yebai yebai disabled auto-merge November 26, 2024 18:24
@yebai yebai enabled auto-merge November 26, 2024 18:24
@yebai yebai disabled auto-merge November 26, 2024 18:25
@yebai yebai enabled auto-merge November 26, 2024 18:25
@yebai
Copy link
Member

yebai commented Nov 26, 2024

A few tests are broken, stopping auto-merging from being completed.

@yebai yebai added this pull request to the merge queue Nov 28, 2024
Merged via the queue into master with commit d635a17 Nov 28, 2024
2 of 10 checks passed
@yebai yebai deleted the torfjelde/context-cleanup branch November 28, 2024 14:31
@penelopeysm
Copy link
Member

@yebai I don't think CI was going to pass on that merge 😄

@yebai
Copy link
Member

yebai commented Nov 28, 2024

It's likely some strange auto-merging queue behaviour; I haven't done anything here since my last comment.

@penelopeysm
Copy link
Member

Oh haha, that's odd. GitHub doing GitHub things. I'll fix any remaining broken tests once it runs on master :)

@penelopeysm penelopeysm mentioned this pull request Nov 28, 2024
@torfjelde
Copy link
Member Author

torfjelde commented Nov 28, 2024

Wait what happened here?

Nvm saw the other PR:)

github-merge-queue bot pushed a commit that referenced this pull request Nov 28, 2024
* Fix wrong function being called

* Don't test setchildcontext on leaf contexts

* Update src/test_utils/contexts.jl

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* fixed method ambiguities for DebugContext

* test the context interface for DebugContext on multiple models

* Update src/debug_utils.jl

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

---------

Co-authored-by: Tor Erlend Fjelde <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@penelopeysm penelopeysm mentioned this pull request Nov 28, 2024
@penelopeysm
Copy link
Member

@torfjelde Should this technically have been a minor bump, since functionality in test_utils was shuffled around?

We haven't released anything since, so we can just bump on master before releasing:)

@torfjelde
Copy link
Member Author

Ah, yes good shout; should deffo have a minor version bump:)

@penelopeysm
Copy link
Member

Okay, I'll sort it out~

@penelopeysm penelopeysm mentioned this pull request Nov 29, 2024
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.

4 participants