-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Resolve docstring errors and transition to MkDocs #35
Conversation
Should speed up the readthedocs build. I can't test this configuration since I don't have access to the readthedocs account though.
tested locally using [act](https://www.freecodecamp.org/news/how-to-run-github-actions-locally/)
Bring WIP from my fork to the upstream
Complete conversion of the docs and doc strings to (1) Google-style doc strings and (2) Mkdocs / Mkdocs-material. Most importantly this resolves #32 and #23! DocumentationI've tried to keep the documentation as close as I can to the last version of python-acoustics. Wherever possible, I've retained the explanations and math expressions. Where possible I've added Args and Returns to the doc strings if they were missing. I used Mkdocs Material, mkdocstrings, and mkdocs-jupyter. Readthedocs works - can check out the rendered docs page here: https://acoustic-toolbox.readthedocs.io/en/doc-fix/ API ReferenceAs of c742af7 the navigation is done partly manually. There are separate .md files for each module in which we include a mkdocstrings snippet to automatically generate the API docs from the docstrings:
This is a useful balance between auto generating the API docs and flexibility of layout. We can add more explanations or links to the .md file, as well as splitting out modules into different pages for their separate classes, etc. I've been thinking of doing this for some of the modules that have lots of code, like But another alternative is mkdocs-api-autonav which can generate the whole thing automatically and add it to the I tested this out with the following options:
and removing all of the api pages from Jupyter examplesmkdocs-jupyter works very well for including the Jupyter notebooks as examples. The main hitch is the TypehintingI also added some type hinting - again, I tried not to go overboard and only include type hints where the types were previously stated or were obvious, although some of these may still need to change. This has two consequences:
That means there are quite a warnings raised by There's some inconsistency in the type used for numpy ndarrays - |
@Nitnelav what do you think about the auto api vs slightly manual approach? It could be nice not to have to worry about changing the docs when new modules are added or code is refactored. All we'd have to do is add docstrings and mkdocs-api-autonav will automatically pick them up. We'd remove all of the module .md files from docs (e.g. Any preference? I'm pretty happy with either.
|
See the other readthedocs version build for how it looks with the autoapi version. Deployed from docs-autoapi branch. |
Waow this is some really nice work ! 🎉 I think I prefer having the ability to edit some modules pages if necessary. But I'm happy to let you chose the other way if you wish, considering you've done all the work Awesome stuff anyway ! 👌 |
Cool! I'm happy to stick with the current setup (not atonal). I'll go ahead and approve the pull request and test the release. |
Transitioning to mkdocs for documentation.
At current stage 7d116d0, the mkdocs is configured, and some pages and docstrings have been converted.
Ongoing work is to continue converting docstrings, then integrate jupyter notebooks, then reexamine the layout and organisation of the docs