Skip to content

[Docs] Fix incomplete docstring for resnet.py#3438

Merged
patrickvonplaten merged 1 commit into
huggingface:mainfrom
Laurent2916:patch-docstrings
May 16, 2023
Merged

[Docs] Fix incomplete docstring for resnet.py#3438
patrickvonplaten merged 1 commit into
huggingface:mainfrom
Laurent2916:patch-docstrings

Conversation

@Laurent2916

Copy link
Copy Markdown
Contributor

Docstrings of some Upsampling and Downsampling layers were incomplete or missing.
I didn't know exactly what format to use for the docstrings since it doesn't seem to be specified in CONTRIBUTING.md

Overall, the various docstrings in the project don't all seem to be very consistent (some are formatted like Google's convention, some others look like Numpy's convention). Would it be a good idea to enable pydocstyle in ruff to overcome some of these issues ?

Like so (in pyproject.toml):

 [tool.ruff]
 # Never enforce `E501` (line length violations).
-ignore = ["C901", "E501", "E741", "W605"]
-select = ["C", "E", "F", "I", "W"]
+ignore = ["C901", "E501", "E741", "W605", "D102", "D107"]
+select = ["C", "E", "F", "I", "W", "D"]
 line-length = 119
 
+[tool.ruff.pydocstyle]
+# Use Google-style docstrings.
+convention = "google"
+
 # Ignore import violations in all `__init__.py` files.
 [tool.ruff.per-file-ignores]
 "__init__.py" = ["E402", "F401", "F403", "F811"]

@Laurent2916 Laurent2916 changed the title Fix incomplete docstring for resnet.py [Docs] Fix incomplete docstring for resnet.py May 15, 2023
@HuggingFaceDocBuilderDev

HuggingFaceDocBuilderDev commented May 15, 2023

Copy link
Copy Markdown

The documentation is not available anymore as the PR was closed or merged.

@patrickvonplaten

Copy link
Copy Markdown
Contributor

Amazing! Thanks a lot for the improvements here!

@patrickvonplaten patrickvonplaten merged commit 754fac8 into huggingface:main May 16, 2023
@Laurent2916 Laurent2916 deleted the patch-docstrings branch May 16, 2023 18:56
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.

3 participants