OpenMS / pyopenms-docs

pyOpenMS readthedocs documentation, additional utilities, addons, scripts, and examples.
https://pyopenms.readthedocs.io
Other
42 stars 52 forks source link

Display classes of pyopenms_X submodules under pyopenms #264

Closed jpfeuffer closed 1 year ago

jpfeuffer commented 2 years ago

In our init.py we import all submodules and make them available under the root package. This should be represented in the API doc. Looks cleaner.

Middle-term we should create modules maybe for our subfolders of the openms library. Long-term we will split up the OpenMS library itself.

jpfeuffer commented 2 years ago

Or check https://docs.cython.org/en/latest/src/userguide/source_files_and_compilation.html#integrating-multiple-modules Instead of the python side imports that we are currently doing.

jpfeuffer commented 2 years ago

This might be solved with autosummary_imported_members = True in conf.py. I just tested it.

jpfeuffer commented 2 years ago

But this will lead to a lot of classes on the same page. We can reduce to not showing signatures with

.. autosummary::
   :toctree: _autosummary
   :recursive:
   :nosignatures:

   pyopenms

But then it might be a bit useless, since the classes are not clickable.

This issue basically sums up the problem(s) that we have. https://github.com/sphinx-doc/sphinx/issues/7912

Even with some potential solutions using sphinx templates here: https://stackoverflow.com/questions/2701998/sphinx-autodoc-is-not-automatic-enough/62613202#62613202 https://github.com/JamesALeedham/Sphinx-Autosummary-Recursion https://sphinx-autosummary-recursion.readthedocs.io/en/latest/_autosummary/mytoolbox.html

jpfeuffer commented 2 years ago

Maybe another theme (sphinx-immaterial) can improve on that, too. I read in the linked sphinx issue, that the author made some fixes to autosummary for this.

https://galois.readthedocs.io/en/stable/api/galois.FieldArray/ with the sphinx-immaterial theme.

jpfeuffer commented 1 year ago

I think by using the above mentioned autosummary option and making the submodules hidden, this is sufficiently solved for now.