pybind11-stubgen icon indicating copy to clipboard operation
pybind11-stubgen copied to clipboard

Doc String for Overloaded Member Functions (Sphinx)

Open ax3l opened this issue 1 year ago • 1 comments

Hi,

has someone figured out how to see the individual docstrings of overloaded functions in Sphinx using autodoc?

Stubgen properly has per-method doc strings https://github.com/AMReX-Codes/pyamrex/blob/793ede5ab721e76f3fa547ae86249a1120f6bfb3/src/amrex/space3d/amrex_3d_pybind/init.pyi#L5155-L5208

as provided by my pybind11 overloads https://github.com/AMReX-Codes/pyamrex/blob/793ede5ab721e76f3fa547ae86249a1120f6bfb3/src/Base/MultiFab.cpp#L503-L547

But Sphinx

.. autoclass:: amrex.space3d.MultiFab
   :members:
   :undoc-members:

does end up with this Screenshot from 2024-04-03 15-41-12 https://pyamrex.readthedocs.io/en/latest/usage/api.html#amrex.space3d.MultiFab.plus

Does anyone know how to show the per-overload doc strings instead? :)

ax3l avatar Apr 03 '24 22:04 ax3l

Is that https://github.com/sphinx-doc/sphinx/issues/7787 ?

ax3l avatar Apr 03 '24 22:04 ax3l