adding kernels flattening and parameters already in hierarchy

This commit is contained in:
Max Zwiessele 2014-03-18 17:41:08 +00:00
parent 9c553ba15c
commit 6637eb7ac8
11 changed files with 624 additions and 9 deletions

View file

@ -170,4 +170,11 @@ class Add(CombinationKernel):
def _setstate(self, state):
super(Add, self)._setstate(state)
def add(self, other, name='sum'):
if isinstance(other, Add):
other_params = other._parameters_.copy()
for p in other_params:
other.remove_parameter(p)
self.add_parameters(*other_params)
else: self.add_parameter(other)
return self