docs: added code examples in potential class docstring#1820
Open
Jocho-Smith wants to merge 1 commit intosbi-dev:mainfrom
Open
docs: added code examples in potential class docstring#1820Jocho-Smith wants to merge 1 commit intosbi-dev:mainfrom
Jocho-Smith wants to merge 1 commit intosbi-dev:mainfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1820 +/- ##
=======================================
Coverage 87.86% 87.86%
=======================================
Files 140 140
Lines 12726 12726
=======================================
Hits 11182 11182
Misses 1544 1544
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Contributor
Author
|
I could also do that for the methods listed here: https://sbi.readthedocs.io/en/latest/api_reference/potentials.html |
dgedon
requested changes
Mar 19, 2026
Collaborator
dgedon
left a comment
There was a problem hiding this comment.
I believe this is a very good start for the GSoC 2026 project 3 to get an overview. However, there are some issues:
- in the API reference we list the
likelihood_estimator_based_potentialfunction instead of theLikelihoodBasedPotentialwhere your current examples are located. So they are never shown in the API reference - more critical: the potentials are mostly used internally and have limited user-facing interaction. So examples have limited value
- With the re-design of the potential function, these examples would need a re-design as well.
Because of the second point, I think this PR is nice-to-have.
Changes that are necessary:
- add examples to the right location
- point out that the potentials can then be used for MCMC sampling, VI, ...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is inspired by #1763
In preparation of GSoC Project Idea 3 I investigated into the potential functions and wrote minimal examples to try them out.
Is it appreciated if we add these examples in the class docstrings? In the same way it appeared in #1534, this would enhance API references on the docs website.
Pre-commit hooks and fast tests passed
(update: I just realized I could have just run
pytest -m "not slow and not gpu", there was no need for--bm)