Skip to content

Commit

Permalink
fix doc-string of SumModel for docs
Browse files Browse the repository at this point in the history
  • Loading branch information
MuellerSeb committed Aug 15, 2024
1 parent 2858f06 commit 947619a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/gstools/covmodel/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1356,6 +1356,18 @@ def __init__(self, *models, **kwargs):
# check for consistency
self.check()

def __init_subclass__(cls):
"""Initialize gstools sum-model."""
_init_subclass(cls)
# overridden functions get standard doc if no new doc was created
ign = ["__", "variogram", "covariance", "cor"]
for att, attr_cls in cls.__dict__.items():
if any(att.startswith(i) for i in ign) or att not in dir(CovModel):
continue
attr_doc = getattr(CovModel, att).__doc__
if attr_cls.__doc__ is None:
attr_cls.__doc__ = attr_doc

def __iter__(self):
return iter(self.models)

Expand Down

0 comments on commit 947619a

Please sign in to comment.