Skip to content

Conversation

@ProGamerGov
Copy link
Contributor

@ProGamerGov ProGamerGov commented Jul 28, 2022

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

@facebook-github-bot
Copy link
Contributor

facebook-github-bot commented Jul 28, 2022

🔗 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.

Click here to manually regenerate this comment.

Copy link
Contributor

@jbschlosser jbschlosser left a 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 :)

@ProGamerGov
Copy link
Contributor Author

ProGamerGov commented Jul 28, 2022

@jbschlosser I found another similar inconsistency with bool and boolean, so I hope you don't mind that I included it in this PR as well. Though that seems to have caused the PyTorch bot to automatically add 7 more requests for review.

@ProGamerGov ProGamerGov changed the title Fix docstring inconsistency: string -> str Fix docstring inconsistencies: string -> str, boolean -> bool Jul 28, 2022
Copy link
Contributor

@jbschlosser jbschlosser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks :)

@jbschlosser
Copy link
Contributor

@pytorchbot merge

@pytorchmergebot
Copy link
Collaborator

@pytorchbot successfully started a merge job. Check the current status here

@github-actions
Copy link
Contributor

Hey @ProGamerGov.
You've committed this PR, but it does not have both a 'release notes: ...' and 'topics: ...' label. Please add one of each to the PR. The 'release notes: ...' label should represent the part of PyTorch that this PR changes (fx, autograd, distributed, etc) and the 'topics: ...' label should represent the kind of PR it is (not user facing, new feature, bug fix, perf improvement, etc). The list of valid labels can be found here for the 'release notes: ...' and here for the 'topics: ...'.
For changes that are 'topic: not user facing' there is no need for a release notes label.

@jbschlosser jbschlosser added the topic: not user facing topic category label Jul 29, 2022
pytorchmergebot pushed a commit that referenced this pull request Jul 29, 2022
### 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
facebook-github-bot pushed a commit that referenced this pull request Aug 1, 2022
#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
facebook-github-bot pushed a commit that referenced this pull request Aug 1, 2022
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
@albanD albanD added topic: docs topic category module: python frontend For issues relating to PyTorch's Python frontend labels Aug 1, 2022
pytorchmergebot pushed a commit that referenced this pull request Aug 17, 2022
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
facebook-github-bot pushed a commit that referenced this pull request Aug 17, 2022
#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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla signed Merged module: python frontend For issues relating to PyTorch's Python frontend open source topic: docs topic category topic: not user facing topic category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants