-
Notifications
You must be signed in to change notification settings - Fork 25.8k
Fix docstring inconsistencies: string -> str, boolean -> bool #82410
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
Fix docstring inconsistencies: string -> str, boolean -> bool #82410
Conversation
🔗 Helpful links
✅ No Failures (0 Pending)As of commit baff973 (more details on the Dr. CI page): Expand to see more💚 💚 Looks good so far! There are no failures yet. 💚 💚 This comment was automatically generated by Dr. CI (expand for details).Please report bugs/suggestions to the (internal) Dr. CI Users group. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM if we can get the CI checks passing! Thanks for the update :)
…merGov/pytorch into doc-standard-unification-2
…merGov/pytorch into doc-standard-unification-2
…merGov/pytorch into doc-standard-unification-2
|
@jbschlosser I found another similar inconsistency with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks :)
|
@pytorchbot merge |
|
@pytorchbot successfully started a merge job. Check the current status here |
|
Hey @ProGamerGov. |
### Description * Docstrings using `(tuple of ints)` shows up as `(tuple of python:ints)`, so I fixed them by making the `int` no longer plural. Example: https://pytorch.org/docs/stable/generated/torch.permute.html#torch.permute * A docstring type in JIT had one of its types incorrectly highlighted as code. Example: https://pytorch.org/docs/stable/generated/torch.jit.script.html#torch.jit.script * I found some docstring type usages of `string` that had not yet been converted to `str` after #82410 * Some docstrings incorrectly listed their defaults inside the docstring types. * I also found a docstring that was missing its type ### Testing No testing should be required. --- In the developer guidelines, there should probably be standards listed for the docstring types. Pull Request resolved: #82474 Approved by: https://github.com/albanD
#82410) Summary: ### Description Throughout the PyTorch docs and codebase, the `string` type in docstrings is referred to by two separate names. This leads to inconsistent docs, like you can see here: https://pytorch.org/docs/stable/generated/torch.nn.Conv3d.html#torch.nn.Conv3d This PR fixes this issue by ensuring that all mentions of the string type in docstrings, are using the same format that Sphinx generates hyperlinks for. ### Testing No testing should be required for this change Pull Request resolved: #82410 Approved by: https://github.com/jbschlosser Test Plan: contbuild & OSS CI, see https://hud.pytorch.org/commit/pytorch/pytorch/357b7d589c9c451f4850449b9313d8b857ae7140 Reviewed By: osalpekar Differential Revision: D38290577 Pulled By: osalpekar fbshipit-source-id: d0308018d29e99a14ec1858e5a123fe85109c08f
Summary: ### Description * Docstrings using `(tuple of ints)` shows up as `(tuple of python:ints)`, so I fixed them by making the `int` no longer plural. Example: https://pytorch.org/docs/stable/generated/torch.permute.html#torch.permute * A docstring type in JIT had one of its types incorrectly highlighted as code. Example: https://pytorch.org/docs/stable/generated/torch.jit.script.html#torch.jit.script * I found some docstring type usages of `string` that had not yet been converted to `str` after #82410 * Some docstrings incorrectly listed their defaults inside the docstring types. * I also found a docstring that was missing its type ### Testing No testing should be required. Test Plan: contbuild & OSS CI, see https://hud.pytorch.org/commit/pytorch/pytorch/8def154e00f55dd4f7fd4bff20ee50309eaf3132 Reviewed By: osalpekar Differential Revision: D38306839 fbshipit-source-id: 0a46f53b78414a05d593ef869ad9b3d2a1f40e37
This PR builds on the following past PRs, and serves to help improve the consistency of PyTorch's docstring formatting. * `boolean` -> `bool` and `string` -> `str`: #82410 * Don't use plural of types: #82474 * Capitalize the Callable type, `callable` -> `Callable` : #82487 Pull Request resolved: #83536 Approved by: https://github.com/H-Huang, https://github.com/albanD
#83536) Summary: This PR builds on the following past PRs, and serves to help improve the consistency of PyTorch's docstring formatting. * `boolean` -> `bool` and `string` -> `str`: #82410 * Don't use plural of types: #82474 * Capitalize the Callable type, `callable` -> `Callable` : #82487 Pull Request resolved: #83536 Approved by: https://github.com/H-Huang, https://github.com/albanD Test Plan: contbuild & OSS CI, see https://hud.pytorch.org/commit/pytorch/pytorch/dcda907693e9e7661c099c3b9ed25fadaed273f8 Reviewed By: seemethere Differential Revision: D38788502 fbshipit-source-id: dd03fe64694385a583c21c4f0e0198d671fd4dd6
Description
Throughout the PyTorch docs and codebase, the
stringtype in docstrings is referred to by two separate names. This leads to inconsistent docs, like you can see here: https://pytorch.org/docs/stable/generated/torch.nn.Conv3d.html#torch.nn.Conv3dThis PR fixes this issue by ensuring that all mentions of the string type in docstrings, are using the same format that Sphinx generates hyperlinks for.
Testing
No testing should be required for this change