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

Document InferDict and Message typed dicts #3323

Merged
merged 1 commit into from
Feb 9, 2024
Merged

Conversation

fritzo
Copy link
Member

@fritzo fritzo commented Feb 9, 2024

Resolves #3322

This adds key descriptions to InferDict and Message. Also adds the enumerate key to InferDict, which is the most commonly used key in our documentation. (I guess that would have been added once we add types to pyro.infer.*.)

There are a few ways to document a TypedDict. I've opted to add a sphinx definition list in the main docstring.

  • pro: docs show up in both sphinx (docs.pyro.ai) and vscode hover
  • con: docs are somewhat duplicated in sphinx
  • con: key descriptions are separate from declaration in code

The second best alternative would be to add a """docstring""" below each key declaration, but those wouldn't show up in vscode hover, which I believe is more important.

@ordabayevy ordabayevy merged commit ca2f93c into dev Feb 9, 2024
9 checks passed
@ordabayevy ordabayevy deleted the doc-typed-dicts branch February 10, 2024 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add detailed descriptions of Message and InferDict keys
2 participants