From 947619a0428e716e7b3ee78952b631be3c24824d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20M=C3=BCller?= Date: Fri, 16 Aug 2024 00:40:47 +0200 Subject: [PATCH] fix doc-string of SumModel for docs --- src/gstools/covmodel/base.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/gstools/covmodel/base.py b/src/gstools/covmodel/base.py index a495d80b..252bdeb3 100644 --- a/src/gstools/covmodel/base.py +++ b/src/gstools/covmodel/base.py @@ -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)