Skip to content

Commit

Permalink
CovModel: let the sum magic happen
Browse files Browse the repository at this point in the history
  • Loading branch information
MuellerSeb committed Aug 15, 2024
1 parent 656125a commit dbdfa27
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/gstools/covmodel/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1163,6 +1163,14 @@ def __setattr__(self, name, value):
if getattr(self, "_init", False) and name in self.opt_arg:
self.check_arg_bounds()

def __add__(self, other):
"""Add two covariance models and return a SumModel."""
return SumModel(self, other)

def __radd__(self, other):
"""Add two covariance models and return a SumModel."""
return SumModel(self, other)

def __repr__(self):
"""Return String representation."""
return model_repr(self)
Expand Down

0 comments on commit dbdfa27

Please sign in to comment.