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

Docstrings standardization #586

Merged
merged 5 commits into from
Nov 8, 2023

Conversation

FBruzzesi
Copy link
Collaborator

@FBruzzesi FBruzzesi commented Oct 19, 2023

Description

This PR aims to refactor all the modules docstring in order to standardize them into numpy style.
Therefore numpydoc dependency and extension has been added as well.

Remark: The target building tool is mkdocs-materials instead of sphinx, therefore some part will not render properly when tested with sphinx. If the decision is to stick with sphinx, then more changes are necessary.

To check how those would render, I added a minimal (?) mkdocs.yaml which reads mkdocs/ folder containing just a page API rendering.

It can be tested by running the following command:

python -m pip install \
    mkdocs==1.5.3 \
    mkdocs-autorefs==0.5.0 \
    mkdocs-material==9.4.5 \
    mkdocs-material-extensions==1.2 \
    mkdocstrings==0.23.0 \
    mkdocstrings-python==1.7.3 
mkdocs serve

Additional information

  • I tried to keep the original docstrings as much as possible
  • In some classes there are example usage but not nearly in the most of them. It would be good for future to add a simple example for each class
  • All code changes are solely due to black and isort with line length of 120

sklego/linear_model.py Outdated Show resolved Hide resolved
@FBruzzesi FBruzzesi requested a review from koaning October 20, 2023 06:52
@FBruzzesi FBruzzesi mentioned this pull request Oct 21, 2023
@@ -0,0 +1,16 @@
# Model Selection

:::sklego.model_selection.GroupTimeSeriesSplit
Copy link
Owner

Choose a reason for hiding this comment

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

Spotted a table rendering issue.

CleanShot 2023-10-30 at 17 04 32


:::sklego.model_selection.GroupTimeSeriesSplit
options:
show_root_full_path: false
Copy link
Owner

Choose a reason for hiding this comment

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

CleanShot 2023-10-30 at 17 05 04

params also don't render super well on this one

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

  • For the table, the best solution I found is to make it in code as
    image
    Since the table concept is slightly different in mkdocs.
  • Thanks for the heads up on the parameters, the ":" at the end has been wrongly copy-pasted in a few places

doc/conf.py Show resolved Hide resolved
Copy link
Owner

@koaning koaning left a comment

Choose a reason for hiding this comment

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

Great job! I only found one page with issues here. That's a ton of work!

I left one comment about adding the import path. I don't know if it can be automated. But it might be nice to perhaps manually add on top?

Copy link
Owner

@koaning koaning left a comment

Choose a reason for hiding this comment

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

I couldn't find any more issues from eyeballing this ... so I think it's good to merge :)

@koaning koaning merged commit 26f75d8 into koaning:main Nov 8, 2023
7 checks passed
@FBruzzesi FBruzzesi deleted the docs/docstrings-standardization branch November 8, 2023 13:03
@FBruzzesi FBruzzesi mentioned this pull request Nov 9, 2023
33 tasks
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.

2 participants