-
Notifications
You must be signed in to change notification settings - Fork 914
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 automatic docs #2644
Add automatic docs #2644
Conversation
@adam-narozniak thanks for the description. Re Q1: I agree with your proposal. Let's use the class docstring as the main docstring going forward (instead of the init docstring). This includes fixing it for classes where this isn't the case yet. Re Q2: Also yes. Let's keep the approach and templates exactly the same across |
@danieljanes Great!
After that I'll also the templates in this PR consistent with the ones in flwr-datasets. |
* Update versioned-docs script * Remove ref-api copy * Update datasets script * Remove auto generated files at the end of building
Issue
A single-page API documentation (according to me) is too long and hard to navigate.
Proposal
Introduce automatic docs creation using
autosummary
extension fromsphinx
where each class and function has a separate page.Description
ref-api-flwr
(single docs file)conf.py
Questions
Do we need to store the .rst files with documentation (I see some git diffs in the scripts for building the docs but I'm unsure if that affect this part)
Diff between flwr and flwr-datasets
In
flwr
, proper docs of SOME classes are present in the__init__
and right after the class ClassName (I find it especially true inStrategies
). Inflwr-datasets
added docs just after the class statement (no docs in __init __).That implies that the parameters to the constructor are doubled in documentation (that was also the case in old docs); see the image below.
To account for that, I changed slightly the class template (to have the __init __ docs added).
PEP 257 says that the class Docstrings should be (immediately following the class definition) - the most common option in our docs. The constructor (__init __) Docstrings is optional. I think it should be removed in our case form all the classes subclassing
Strategy
and potentially others (if present).the base template will need to be added to
flwr-datasets
. The need for it was not apparent because there was none standalone function documentation. It is required for consistent naming conventions.