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

Add methods to API docs and use typehints #167

Merged
merged 5 commits into from
Mar 21, 2023

Conversation

abkfenris
Copy link
Member

Currently the API docs are missing a bunch of xpublish.Rest methods, so this fills them out. It also switches to using type hints directly in the docs rather than requiring them to be specified in the docstrings.

Closes #160 #161

I'm headed out on vacation, so feel free to edit or merge away, otherwise if there aren't any complaints I'll land it when I get back.

@abkfenris abkfenris added the documentation Improvements or additions to documentation label Mar 11, 2023
@abkfenris abkfenris requested a review from benbovy March 11, 2023 02:03
@abkfenris abkfenris merged commit f2171bb into xpublish-community:main Mar 21, 2023
Copy link

@twmr twmr left a comment

Choose a reason for hiding this comment

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

I've just stumbled upon this change, because I wanted to know how sphinx-autodoc-typehints can be used in a napoleon project.

Bind socket to this port.
log_level : str
log_level :
Copy link

Choose a reason for hiding this comment

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

FYI The colon after the parameter name can be removed. This is already the case in some parts of the project.

@@ -131,9 +167,9 @@ def register_plugin(
Register a plugin with the xpublish system

Args:
Copy link

Choose a reason for hiding this comment

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

Shouldn't this be converted to a

Parameters
----------------

section?

Copy link

Choose a reason for hiding this comment

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

I've just stumbled upon this change, because I wanted to know how you use sphinx-autodoc-typehints in a napoleon project.

friendly ping @abkfenris

"""Initialize and load plugins from entry_points"""
"""Initialize and load plugins from entry_points unless explicitly provided

Parameters:
Copy link

Choose a reason for hiding this comment

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

I've seen that currently there are 4 occurences of

Parameters:

and 4 occurences of

Parameters
----------

in the docs. I think this should be consolidated. As a napoleon user, I would expect

Parameters
----------

as the style of the sections in the docstrings. The same is true for the other section types (Returns, Raises, ...)

@abkfenris
Copy link
Member Author

Hi @Thisch, thanks for the feedback and suggestions on how to better get autodoc-typehints and napoleon to play together. I haven't gotten much time to work on Xpublish for the last few weeks due to fighting various fires, but I'll make an issue to work on cleaning up the docstrings.

@abkfenris abkfenris mentioned this pull request Apr 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add methods to API auto-documentation
2 participants