Skip to content

Name the eliminate parameter in the recipes docstrings - #624

Open
VenishPaneliya wants to merge 1 commit into
pyro-ppl:masterfrom
VenishPaneliya:fix-recipes-param-names
Open

VenishPaneliya wants to merge 1 commit into
pyro-ppl:masterfrom
VenishPaneliya:fix-recipes-param-names

Conversation

@VenishPaneliya

Copy link
Copy Markdown

forward_filter_backward_rsample and forward_filter_backward_precondition both write the
eliminate entry as :param frozenset:, with the type where the name should be. Sphinx reads
that single token as the parameter name, so docs/source/recipes.rst (.. automodule:: funsor.recipes) renders a parameter called frozenset and eliminate does not appear at all.

Rendering the docstring with sphinx.ext.autodoc before the change:

Parameters:
   * factors (dict) -- A dictionary of factors.
   * frozenset -- A set of names of latent variables to marginalize.
   * plates -- A set of names of plates to aggregate.

and after:

Parameters:
   * factors (dict) -- A dictionary of factors.
   * eliminate (frozenset) -- A set of names of latent variables to marginalize.
   * plates (frozenset) -- A set of names of plates to aggregate.

I also gave plates its frozenset type, since every other entry in these two blocks carries
one. Docstrings only; ruff check and ruff format --check both pass.

Both functions in funsor/recipes.py write the eliminate entry as
``:param frozenset:`` with no parameter name. Sphinx reads the single
token as the name, so docs/source/recipes.rst renders a parameter
called "frozenset" and eliminate is missing from the rendered
signature entirely.

Also give plates its frozenset type, matching the other entries in the
same two blocks.
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.

1 participant