You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for creating this package, @mansenfranzen -- it's the missing link between the self-documenting objects of Pydantic and, well, actual documentation!
Thanks for reporting this. It is indeed an odd behaviour.
It has nothing to do with autosummary because this simply generates the autopydantic_model directive. Instead, I believe the reason is located in your conf.py which sets autoclass_content = 'both'. This tells sphinx autodoc to concatenate both the class doc string and its __init__ doc string in the class' documentation (see here). The psiresp.job.Job class inherits its __init__ from pydantic.BaseModel hence you see the doc string from pydantic's BaseModel. Could you please check if it disappears if you set autoclass_content = 'class'?
I guess you might not be the first or the last who stumbles across this. Describing this could be a good candidate for the documentation's FAQ section. If you want feel free to add a PR. Otherwise I can do it.
mansenfranzen
changed the title
Docstring of base class included
Docstring of base class' __init__ included
Nov 6, 2021
Thanks for creating this package, @mansenfranzen -- it's the missing link between the self-documenting objects of Pydantic and, well, actual documentation!
However, I'm not sure I've set it up correctly. Might you know why the class docstrings I'm getting have the Pydantic BaseModel docstring attached? e.g. here: https://psiresp.readthedocs.io/en/latest/_autosummary/psiresp.job.Job.html#psiresp.job.Job
If you look at the source, it includes the first part only:
https://psiresp.readthedocs.io/en/latest/_modules/psiresp/job.html#Job
Is it because I'm using
autosummary
instead ofautopydantic_model
or similar?The text was updated successfully, but these errors were encountered: