-
-
Notifications
You must be signed in to change notification settings - Fork 3
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
Fixed docstring warnings and improvements #93
Conversation
hassaanfarooq01
commented
Jan 24, 2024
•
edited
Loading
edited
- Fixed mkdocs docstring warnings
- Added improvements docstring texts
@kalenmike @hassaanfarooq01 this preliminary CI action merely tests package installation and Docs publishing. This action should fail if any docstring issues are present.
@hassaanfarooq01 they're all fixed!! |
@hassaanfarooq01 oh wait, this branch doesn't have the Docs checking action, so it's hard to tell haha. I think you're good to merge this into the CI branch, or vice versa, so you can tell if there are any warnings remaining. |
@hassaanfarooq01 ok I just built locally. All the warnings are gone (good job)! But there's one problem remaining. Every inlined return that does not have a variable name needs to be surrounded by parentheses in the docstrings, i.e.: here we need def example_function(arg1: int, arg2: int) -> bool:
"""
Example function that demonstrates Google-style docstrings.
Args:
arg1 (int): The first argument.
arg2 (int): The second argument.
Returns:
(bool): True if successful, False otherwise.
Examples:
>>> result = example_function(1, 2) # returns False
"""
if arg1 == arg2:
return True
return False Example screenshot showing problem![]() To fix this you would just put parenthesis around the return type: |
mkdocs didn't raised warring for that therefore didn't get that. But yeah let me add it. |
Yeah for this it doesn't raise warnings unfortunately, it's hard to check automatically so often times I just spot the tables built incorrectly in the published docs and then go fix them in the Ok let me know when they're updated and I'll review again! |
hub_sdk/modules/models.py
Outdated
""" | ||
Get the URL of the model weights. | ||
|
||
Args: | ||
weight (str, optional): Type of weights to retrieve. Defaults to "best". | ||
|
||
Returns: | ||
str or None: The URL of the specified weights or None if not available. | ||
Optional[str]: The URL of the specified weights or None if not available. |
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.
Needs parentheses
@hassaanfarooq01 there are number of corrections required here, this is very far from ready to merge. Most importantly ALL usage of Optional requires brackets rather than parentheses. PyCharm displays this clearly in your PR, you should probably use it when viewing your code. ![]() |
ohhh! it's stupid mistake. even wrote correct in docstring 🫣 |
@hassaanfarooq01 ok let me know when it's ready, thanks! |
@glenn-jocher I have reviewed the documentation thoroughly and implement the necessary changes to address issues with ui, with that also tried to add Notes and proper descriptions that will be helpful visually. I know it should be done first time, but I was assuming to ui catch that automatically |
@hassaanfarooq01 ok thanks, I will take a look today! |
@hassaanfarooq01 looks much better! I think all the issues are resolved now. Nice work! |