xarray-contrib/xeofs

Avoid recreating API on every child model class

Opened this issue · 1 comments

Looking again at the inheritance structure, I'm noticing we recreate the entire API on every child model class. This has the benefit of making the signature explicit and the auto built docstrings complete, but it also becomes a hassle to maintain such long argument lists. For example I also had to add verbose back to these classes to get the parameter serialization list complete.

An alternative is to only specify whatever new parameters are included on the child class and pass everything else to the parent with **kwargs, but this makes the signature less explicit. We could consider something like pydantic's BaseModel which I believe helps with this. Just something for future consideration.

Originally posted by @slevang in #196 (comment)

Looks like this might "just work" in the docs by adding autodoc_inherit_docstrings = True to the conf.py.