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

[test] add tests for ensemble posterior weights #1307

Merged
merged 1 commit into from
Dec 2, 2024

Conversation

samadpls
Copy link
Contributor

What does this implement/fix? Explain your changes

Adds a test case for weight validation in EnsemblePosterior to verify proper handling of different weight formats (list, tensor) and error cases. The test ensures the API correctly validates weights without running full posterior accuracy checks.

Does this close any currently open issues?

Fixes #1304

Checklist

Put an x in the boxes that apply. You can also fill these out after creating
the PR. If you're unsure about any of them, don't hesitate to ask. We're here to
help! This is simply a reminder of what we are going to look for before merging
your code.

  • I have read and understood the contribution
    guidelines
  • I have commented my code, particularly in hard-to-understand areas
  • I have added tests that prove my fix is effective or that my feature works
  • I have reported how long the new tests run and potentially marked them
    with pytest.mark.slow.
  • New and existing unit tests pass locally with my changes
  • I performed linting and formatting as described in the contribution
    guidelines
  • There are no conflicts with the main branch

For the reviewer:

  • I have reviewed every file
  • All comments have been addressed.

@samadpls samadpls force-pushed the test/ensemble-posterior-weights branch 3 times, most recently from 49be91e to a9e2775 Compare November 22, 2024 17:15
Copy link

codecov bot commented Nov 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.62%. Comparing base (3ff1f51) to head (19ceaba).
Report is 1 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #1307       +/-   ##
===========================================
- Coverage   89.35%   78.62%   -10.74%     
===========================================
  Files         118      118               
  Lines        8709     8716        +7     
===========================================
- Hits         7782     6853      -929     
- Misses        927     1863      +936     
Flag Coverage Δ
unittests 78.62% <ø> (-10.74%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

see 32 files with indirect coverage changes

Copy link
Contributor

@janfb janfb left a comment

Choose a reason for hiding this comment

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

Looks good overall, thanks! 🙏

I have one suggestion, see comment below.

tests/ensemble_test.py Outdated Show resolved Hide resolved
@samadpls samadpls force-pushed the test/ensemble-posterior-weights branch from a9e2775 to 19ceaba Compare November 28, 2024 14:08
Copy link
Contributor

@janfb janfb left a comment

Choose a reason for hiding this comment

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

Looks good! Thanks a lot for adding this 🙏

@janfb janfb changed the title [Test] Added ensemble posterior weights validation [Test] add tests for ensemble posterior weights Dec 2, 2024
@janfb janfb changed the title [Test] add tests for ensemble posterior weights [test] add tests for ensemble posterior weights Dec 2, 2024
@janfb janfb merged commit 3bd8aa9 into sbi-dev:main Dec 2, 2024
6 checks passed
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.

add test for passing weights to ensemble posterior
2 participants