sbi icon indicating copy to clipboard operation
sbi copied to clipboard

docs: move general class docstrings from __init__ to class level for better API refs

Open janfb opened this issue 9 months ago • 3 comments

On the new docs website we now have nice API references, however, the docstrings with a high-level description of a class do not show up because there are placed in __init__ and not at the class level:

Image

code:

Image

Goal for fixing this issue:

  • go over all the inference classes (NPE_X, NLE_X, etc) and move the high-level description from the __init__ to the class level. Keep in __init__ only a brief docstring and the Args.
  • fix formatting issues in the docstrings along the way, e.g., some docstring contain html stuff like <br/>, which should be remove (or does this have any purpose @michaeldeistler ?)

janfb avatar Mar 25 '25 15:03 janfb

This will already addressed here

michaeldeistler avatar Mar 25 '25 15:03 michaeldeistler

Cool! I see, in this commit there is now one sentence in each docstring.

I am wondering whether we should add more content? that content now usually lives in __init__ and will not be visible in the API docs.

Could you add a short description to that PR @michaeldeistler ? Thanks!

janfb avatar Mar 25 '25 15:03 janfb

I would definitely go for adding the docstring in the classes and avoid the init showing up in the documentation. I thought this when modifying the documentation for BoxUniform and MultipleIndependent classes too.

It's possible to define the autoclass_content so that only class docstring is shown.

jorobledo avatar Mar 31 '25 21:03 jorobledo