Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

fix: add NeuralPosteriorEnsemble to utils.__init__#1002

Merged

Conversation

jnsbck
Copy link
Contributor

@jnsbckjnsbck commentedMar 18, 2024
edited
Loading

What does this implement/fix? Explain your changes

RenameNeuralPosteriorEnsemble toEnsemblePosterior and moveutils.posterior_ensemble toinference.posteriors.ensemble_posteriors

Does this close any currently open issues?

Fixes#744

Any relevant code examples, logs, error output, etc?

nope

Any other comments?

nope

Checklist

Put anx 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 thecontribution
    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
    withpytest.mark.slow.
  • New and existing unit tests pass locally with my changes
  • I performed linting and formatting as described in thecontribution
    guidelines
  • I rebased onmain (or there are no conflicts withmain)
  • I agree with re-licensing my contribution from AGPLv3 to Apache-2.0.

@jnsbckjnsbck linked an issueMar 18, 2024 that may beclosed by this pull request
@jnsbckjnsbck requested a review fromgmoss13March 18, 2024 15:04
Copy link
Contributor

@gmoss13gmoss13 left a comment

Choose a reason for hiding this comment

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

Thanks for tackling this@jnsbck! Currently tests fail as there is a circular import error. I suspect the reason is becausesbi.utils.posterior_ensemble imports fromsbi.inference, which can cause this issue. I would suggest movingposterior_ensemble underinference.posteriors. Does this seem reasonable to you?

@jnsbck
Copy link
ContributorAuthor

@gmoss13 thanks for having a look. I figured out that the circular dependency is introduced by isort! Not running it means the diff reduces to one line, as I had originally proposed as the fix for this.

@jnsbckjnsbckforce-pushed the744-allow-import-of-neuralposteriorensemble-from-sbiutils branch frombb80dd7 toc324c55CompareMarch 19, 2024 10:14
@codecovCodecov
Copy link

codecovbot commentedMar 19, 2024
edited
Loading

Codecov Report

Attention: Patch coverage is26.31579% with84 lines in your changes are missing coverage. Please review.

Project coverage is 76.21%. Comparing base(4c2f71e) to head(92c9da1).
Report is 4 commits behind head on main.

❗ Current head92c9da1 differs from pull request most recent head5393c85. Consider uploading reports for the commit5393c85 to get more accurate results

FilesPatch %Lines
sbi/inference/posteriors/ensemble_posterior.py28.28%71 Missing⚠️
sbi/utils/posterior_ensemble.py0.00%13 Missing⚠️
Additional details and impacted files
@@            Coverage Diff             @@##             main    #1002      +/-   ##==========================================- Coverage   76.37%   76.21%   -0.17%==========================================  Files          84       85       +1       Lines        6507     6524      +17     ==========================================+ Hits         4970     4972       +2- Misses       1537     1552      +15
FlagCoverage Δ
unittests76.21% <26.31%> (-0.17%)⬇️

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

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

@jnsbckjnsbck requested a review fromgmoss13March 19, 2024 10:51
@jnsbck
Copy link
ContributorAuthor

jnsbck commentedMar 19, 2024
edited
Loading

RenamedNeuralPosteriorEnsemble toEnsemblePosterior and movedutils.posterior_ensemble toinference.posteriors.ensemble_posteriors. AddedDeprecationWarnings toutils.posterior_ensemble.

All checks are passing, but codecov fails for some reason.

Copy link
Contributor

@gmoss13gmoss13 left a comment

Choose a reason for hiding this comment

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

Thanks@jnsbck! Great to see the tests pass. I am not too worried about the codecov alerts onsbi.inference.posteriors.ensemble_posterior as the code was not changed from what it was onutils, so any of these lines would not have been covered before anyway. Before merging, I would add a small API test to make sure we can still importNeuralPosteriorEnsemble andEnsemblePotential from utils.

device: str = "cpu",
):
warnings.warn(
"EnsemblePotential was moved to sbi.inference.posteriors.ensemble_posterior. \
Copy link
Contributor

Choose a reason for hiding this comment

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

great!

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

tested this locally, but will add tests :)

gmoss13 reacted with rocket emoji
@jnsbckjnsbck requested a review fromgmoss13March 19, 2024 13:55
@jnsbck
Copy link
ContributorAuthor

Should be good to merge if tests pass :)

…ls' of github.com:sbi-dev/sbi into 744-allow-import-of-neuralposteriorensemble-from-sbiutils
@gmoss13
Copy link
Contributor

Great work!

@gmoss13gmoss13 merged commit4de415c intomainMar 19, 2024
3 checks passed
@janfbjanfb deleted the 744-allow-import-of-neuralposteriorensemble-from-sbiutils branchJune 20, 2024 10:34
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@gmoss13gmoss13gmoss13 approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Allow import ofNeuralPosteriorEnsemble from sbi.utils
2 participants
@jnsbck@gmoss13

[8]ページ先頭

©2009-2025 Movatter.jp