I'm following the numpydoc
style guide to document my code but I cannot find the convention for returning an instance of a class :
"""Create an index in the meilisearch API.
If the argument \`uid\` isn't passed in, it will be generated by meilisearch.
If the argument \`name\` isn't passed in, it will raise an error.
Parameters
----------
name: str
Name of the index
uid: str, optional
Unique identifier of the index
Raises
------
HTTPError
If no name is passed in as a parameter.
HTTPError
In case of any other error found here https://docs.meilisearch.com/references/#errors-status-code
Returns
-------
index
an instance of Index containing the information of the newly created index
"""
In the returns section, as you can see, I return an instance of Index. Is this the way to document it ?
Thanks in advance
From the numpydoc style guide:
So for your example you would use
Index
as the type, together with an optional name:Here the
index :
part is optional.