Merge and migrate Python API documents into docstring#387
Merge and migrate Python API documents into docstring#387lan496 merged 9 commits intospglib:developfrom
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #387 +/- ##
========================================
Coverage 83.86% 83.86%
========================================
Files 24 24
Lines 8180 8180
========================================
Hits 6860 6860
Misses 1320 1320
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
|
I am not satisfied with the generated API docs because they are too long (for example, |
atztogo
left a comment
There was a problem hiding this comment.
Thanks @lan496 for a lot of work. I installed autodoc2 using pip and I could generate the documentation using sphinx-autobuild. It looks very good. Originally I never thought spglib python API would be used so much by people. So I made it to be similar to the C functions and the design is not pythonic. Those can be renovated at some point in the future if it will be worth to do it.
|
@lan496, any docstring style is fine to me. |
*sphinx-style (it can be used for C/C++ code as well), and yes, I would say it's a better interface and rst/md agnostic. 👍 for that format |
Co-authored-by: Cristian Le <[email protected]>
This PR moves Python API documents into docstring of
python/spglib/spglib.py. autodoc2 is used to generate API documents (which is compatible with myst). It will diminish the burden for document maintenance somewhat.@atztogo Spglib uses numpy-style docstring, but autodoc2 does not support it.
sphinx.ext.napoleondoes not work as well. Do we use sphinx's python-domain directives instead? Autodoc2 seems to support MyST docstring with these directives.https://sphinx-autodoc2.readthedocs.io/en/latest/quickstart.html#using-markdown-myst-docstrings