docs(sample): document the progressbar_theme parameter#8308
Open
adv0r wants to merge 1 commit into
Open
Conversation
`pm.sample(progressbar_theme=...)` has been a public, type-annotated parameter for a while (`Theme | str | None`) but it was missing from the docstring entirely, so users had no way to discover it short of reading the source. This commit adds a `progressbar_theme` entry to the docstring of `pm.sample` directly after the existing `progressbar` entry, covering: - the three accepted forms (`None` → default theme, `rich.theme.Theme` instance → custom rich styling, `str` → nutpie CSS theme name for Jupyter), - where the default theme lives (`pymc.progress_bar.default_progress_theme` and its PyMC-blue `#1764f4` bar color), - which `rich` theme keys are the ones users normally want to override (`bar.complete`, `bar.finished`, `bar.pulse`, `progress.remaining`, `progress.elapsed`), - the conditions under which the argument is silently ignored (`progressbar=False`, `quiet=True`, `nuts_sampler` is `numpyro` / `blackjax`), - a small worked example. No behaviour change — purely a docstring addition. Closes pymc-devs#7468 Co-authored-by: Cursor <cursoragent@cursor.com>
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.
What changed
Closes #7468.
pm.sample(progressbar_theme=...)was a public, type-annotated parameter (Theme | str | None) but missing from the docstring. This PR adds a completeprogressbar_themeentry to thepm.sampledocstring, directly after the existingprogressbarentry, covering:None(default) → fall back to PyMC's built-indefault_progress_theme(the PyMC-blue `#1764f4` bar).Diff:
1 file changed, 40 insertions(+). Documentation-only.How verified
pymc/sampling/mcmc.pyafter the edit to make sure the docstring stays a valid string literal.pymc/progress_bar/rich_progress.py:35—default_progress_themedefinition, including the#1764f4bar colour I reference in the example.pymc/progress_bar/progress.py:181-195— the branch that usescss_theme=...when the theme is astr(Jupyter / nutpie), vs. theThemebranch.pymc/sampling/mcmc.py:505-530— the numpyro / blackjax branch, which does not forwardprogressbar_theme(justifying the "ignored when nuts_sampler is numpyro/blackjax" sentence).pymc/sampling/mcmc.py:1607-1610— the existing terse docstring for the internal_mp_samplefunction, which I left untouched (only the public API needed expansion per the issue).Out of scope
progressbar_themeis undocumented #7468 actually says.Made with Cursor