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

Fix errors relating to pydocstyle in loss.py #113219

Closed
wants to merge 15 commits into from

Conversation

zabboud
Copy link
Contributor

@zabboud zabboud commented Nov 8, 2023

Fixes #112600

Fixed errors relating to pydocstyle in torch/nn/modules/loss.py file. The remaining errors are related to docstrings at the module level and at methods within each class such as forward and __init__ methods.

pydocstyle torch/nn/modules/loss.py --count
before: 100
after: 46

remaining errors:

torch/nn/modules/loss.py:1 at module level:
        D100: Missing docstring in public module
torch/nn/modules/loss.py:97 in public method `__init__`:
        D107: Missing docstring in __init__
torch/nn/modules/loss.py:100 in public method `forward`:
        D102: Missing docstring in public method
torch/nn/modules/loss.py:210 in public method `__init__`:
        D107: Missing docstring in __init__
torch/nn/modules/loss.py:215 in public method `forward`:
        D102: Missing docstring in public method
torch/nn/modules/loss.py:219 in public class `NLLLoss2d`:
        D101: Missing docstring in public class
torch/nn/modules/loss.py:220 in public method `__init__`:
        D107: Missing docstring in __init__
torch/nn/modules/loss.py:290 in public method `__init__`:
        D107: Missing docstring in __init__
torch/nn/modules/loss.py:297 in public method `forward`:
        D102: Missing docstring in public method
torch/nn/modules/loss.py:373 in public method `__init__`:
        D107: Missing docstring in __init__
torch/nn/modules/loss.py:378 in public method `forward`:
        D102: Missing docstring in public method
torch/nn/modules/loss.py:468 in public method `__init__`:
        D107: Missing docstring in __init__
torch/nn/modules/loss.py:472 in public method `forward`:
        D102: Missing docstring in public method
torch/nn/modules/loss.py:534 in public method `__init__`:
        D107: Missing docstring in __init__
torch/nn/modules/loss.py:537 in public method `forward`:
        D102: Missing docstring in public method
torch/nn/modules/loss.py:542 in public class `BCELoss`:
        D400: First line should end with a period (not ':')
torch/nn/modules/loss.py:617 in public method `__init__`:
        D107: Missing docstring in __init__
torch/nn/modules/loss.py:620 in public method `forward`:
        D102: Missing docstring in public method
torch/nn/modules/loss.py:721 in public method `__init__`:
        D107: Missing docstring in __init__
torch/nn/modules/loss.py:729 in public method `forward`:
        D102: Missing docstring in public method
torch/nn/modules/loss.py:789 in public method `__init__`:
        D107: Missing docstring in __init__
torch/nn/modules/loss.py:793 in public method `forward`:
        D102: Missing docstring in public method
torch/nn/modules/loss.py:857 in public method `__init__`:
        D107: Missing docstring in __init__
torch/nn/modules/loss.py:860 in public method `forward`:
        D102: Missing docstring in public method
torch/nn/modules/loss.py:940 in public method `__init__`:
        D107: Missing docstring in __init__
torch/nn/modules/loss.py:944 in public method `forward`:
        D102: Missing docstring in public method
torch/nn/modules/loss.py:1003 in public method `__init__`:
        D107: Missing docstring in __init__
torch/nn/modules/loss.py:1007 in public method `forward`:
        D102: Missing docstring in public method
torch/nn/modules/loss.py:1044 in public method `__init__`:
        D107: Missing docstring in __init__
torch/nn/modules/loss.py:1047 in public method `forward`:
        D102: Missing docstring in public method
torch/nn/modules/loss.py:1186 in public method `__init__`:
        D107: Missing docstring in __init__
torch/nn/modules/loss.py:1192 in public method `forward`:
        D102: Missing docstring in public method
torch/nn/modules/loss.py:1240 in public method `__init__`:
        D107: Missing docstring in __init__
torch/nn/modules/loss.py:1243 in public method `forward`:
        D102: Missing docstring in public method
torch/nn/modules/loss.py:1303 in public method `__init__`:
        D107: Missing docstring in __init__
torch/nn/modules/loss.py:1307 in public method `forward`:
        D102: Missing docstring in public method
torch/nn/modules/loss.py:1363 in public method `__init__`:
        D107: Missing docstring in __init__
torch/nn/modules/loss.py:1367 in public method `forward`:
        D102: Missing docstring in public method
torch/nn/modules/loss.py:1436 in public method `__init__`:
        D107: Missing docstring in __init__
torch/nn/modules/loss.py:1448 in public method `forward`:
        D102: Missing docstring in public method
torch/nn/modules/loss.py:1531 in public method `__init__`:
        D107: Missing docstring in __init__
torch/nn/modules/loss.py:1539 in public method `forward`:
        D102: Missing docstring in public method
torch/nn/modules/loss.py:1648 in public method `__init__`:
        D107: Missing docstring in __init__
torch/nn/modules/loss.py:1656 in public method `forward`:
        D102: Missing docstring in public method
torch/nn/modules/loss.py:1801 in public method `__init__`:
        D107: Missing docstring in __init__
torch/nn/modules/loss.py:1806 in public method `forward`:
        D102: Missing docstring in public method

Copy link

pytorch-bot bot commented Nov 8, 2023

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/113219

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit 72650eb with merge base 1e60174 (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@zabboud
Copy link
Contributor Author

zabboud commented Nov 8, 2023

@pytorchbot label "docathon-h2-2023"

@pytorch-bot pytorch-bot bot added the docathon-h2-2023 Issues for the docathon in H2 2023 label Nov 8, 2023
@albanD albanD requested review from svekars and removed request for albanD November 8, 2023 19:25
@albanD albanD added the triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module label Nov 8, 2023
@kit1980
Copy link
Member

kit1980 commented Nov 8, 2023

@pytorchbot rebase

@pytorchmergebot
Copy link
Collaborator

@pytorchbot started a rebase job onto refs/remotes/origin/viable/strict. Check the current status here

@pytorchmergebot
Copy link
Collaborator

Successfully rebased issue_112600 onto refs/remotes/origin/viable/strict, please pull locally before adding more changes (for example, via git checkout issue_112600 && git pull --rebase)

@zabboud
Copy link
Contributor Author

zabboud commented Nov 9, 2023

@pytorchbot label "topic: not user facing"

@pytorch-bot pytorch-bot bot added the topic: not user facing topic category label Nov 9, 2023
@zabboud zabboud changed the title Fix errors relating to pydocstyle Fix errors relating to pydocstyle in loss.py Nov 9, 2023
@zabboud
Copy link
Contributor Author

zabboud commented Nov 9, 2023

@svekars anything I can do to fix the lining errors?

Copy link
Contributor

@mikaylagawarecki mikaylagawarecki left a comment

Choose a reason for hiding this comment

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

To fix the failing lint job running make setup_lint and make quicklint from your local pytorch directory and following the corresponding instructions should be sufficient, see here

torch/nn/modules/loss.py Outdated Show resolved Hide resolved
torch/nn/modules/loss.py Outdated Show resolved Hide resolved
torch/nn/modules/loss.py Outdated Show resolved Hide resolved
torch/nn/modules/loss.py Outdated Show resolved Hide resolved
Co-authored-by: mikaylagawarecki <mikaylagawarecki@gmail.com>
@mikaylagawarecki
Copy link
Contributor

Could you fix lint please

@mikaylagawarecki
Copy link
Contributor

Additionally, SoftMarginLoss might be causing the docs-build to fail, see the logs here https://hud.pytorch.org/pr/pytorch/pytorch/113219#18538106599. Could you fix this please

@svekars svekars added the medium Label for medium docathon tasks label Nov 9, 2023
@zabboud
Copy link
Contributor Author

zabboud commented Nov 10, 2023

@mikaylagawarecki @svekars checks have passed - awaiting approval

@kit1980
Copy link
Member

kit1980 commented Nov 10, 2023

@zabboud please don't do submodules updates changes.

@zabboud
Copy link
Contributor Author

zabboud commented Nov 10, 2023

@zabboud please don't do submodules updates changes.

@kit1980 apologies - I've reverted those changes.

@zabboud
Copy link
Contributor Author

zabboud commented Nov 12, 2023

@kit1980 @svekars @mikaylagawarecki all checked have passed - can the merge be initiated to close this PR?

@zabboud
Copy link
Contributor Author

zabboud commented Nov 14, 2023

@svekars @kit1980 @mikaylagawarecki Can you please assist in these failures? How can they be addressed?

@zabboud
Copy link
Contributor Author

zabboud commented Nov 14, 2023

@pytorchbot rebase

@pytorchmergebot
Copy link
Collaborator

@pytorchbot started a rebase job onto refs/remotes/origin/viable/strict. Check the current status here

@pytorchmergebot
Copy link
Collaborator

Rebase failed due to Command git -C /home/runner/work/pytorch/pytorch rebase refs/remotes/origin/viable/strict pull/113219/head returned non-zero exit code 1

Rebasing (1/8)
Rebasing (2/8)
Rebasing (3/8)
Auto-merging torch/nn/modules/loss.py
CONFLICT (content): Merge conflict in torch/nn/modules/loss.py
error: could not apply 795662a9089... fix errors relating to pydocstyle
hint: Resolve all conflicts manually, mark them as resolved with
hint: "git add/rm <conflicted_files>", then run "git rebase --continue".
hint: You can instead skip this commit: run "git rebase --skip".
hint: To abort and get back to the state before "git rebase", run "git rebase --abort".
Could not apply 795662a9089... fix errors relating to pydocstyle

Raised by /~https://github.com/pytorch/pytorch/actions/runs/6868448872

@svekars
Copy link
Contributor

svekars commented Nov 15, 2023

The doc build is still failing:

/opt/conda/envs/py_3.8/lib/python3.8/site-packages/torch/nn/modules/loss.py:docstring of torch.nn.modules.loss.SoftMarginLoss:1: WARNING: Inline interpreted text or phrase reference start-string without end-string.
/var/lib/jenkins/workspace/docs/source/nn.rst:316:<autosummary>:1: WARNING: Inline interpreted text or phrase reference start-string without end-string.

fix build issue related to softMarginLoss docstring summary
@zabboud
Copy link
Contributor Author

zabboud commented Nov 15, 2023

The doc build is still failing:

/opt/conda/envs/py_3.8/lib/python3.8/site-packages/torch/nn/modules/loss.py:docstring of torch.nn.modules.loss.SoftMarginLoss:1: WARNING: Inline interpreted text or phrase reference start-string without end-string.
/var/lib/jenkins/workspace/docs/source/nn.rst:316:<autosummary>:1: WARNING: Inline interpreted text or phrase reference start-string without end-string.

@svekars I've changed the summary line - hopefully it'll address the docbuild issue.

@zabboud
Copy link
Contributor Author

zabboud commented Nov 15, 2023

@pytorchbot merge

Copy link

pytorch-bot bot commented Nov 15, 2023

❌ 🤖 pytorchbot command failed:

@pytorchbot: error: argument command: invalid choice: ' merge' (choose from 'merge', 'revert', 'rebase', 'label', 'drci')

usage: @pytorchbot [-h] {merge,revert,rebase,label,drci} ...

Try @pytorchbot --help for more info.

@zabboud
Copy link
Contributor Author

zabboud commented Nov 15, 2023

@pytorchbot merge

Copy link

pytorch-bot bot commented Nov 15, 2023

This PR needs to be approved by an authorized maintainer before merge.

@zabboud
Copy link
Contributor Author

zabboud commented Nov 15, 2023

@svekars @mikaylagawarecki @kit1980 could you please approve, to be able to merge this PR. All checks have passed successfully.

@zabboud
Copy link
Contributor Author

zabboud commented Nov 17, 2023

@jbschlosser @svekars @mikaylagawarecki could you please review/approve to close out this PR?

Copy link
Contributor

Looks like this PR hasn't been updated in a while so we're going to go ahead and mark this as Stale.
Feel free to remove the Stale label if you feel this was a mistake.
If you are unable to remove the Stale label please contact a maintainer in order to do so.
If you want the bot to never mark this PR stale again, add the no-stale label.
Stale pull requests will automatically be closed after 30 days of inactivity.

@github-actions github-actions bot added the Stale label Feb 13, 2024
@github-actions github-actions bot closed this Mar 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docathon-h2-2023 Issues for the docathon in H2 2023 medium Label for medium docathon tasks open source Stale topic: not user facing topic category triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix docstring errors in loss.py
7 participants