bugfix: couldn't constrain single parameters, because of indexing of np

This commit is contained in:
Max Zwiessele 2014-04-16 10:24:45 +01:00
parent 39b68be5ed
commit 3a8a1914f2

View file

@ -17,7 +17,7 @@ from transformations import Logexp, NegativeLogexp, Logistic, __fixed__, FIXED,
import numpy as np import numpy as np
import re import re
__updated__ = '2014-04-15' __updated__ = '2014-04-16'
class HierarchyError(Exception): class HierarchyError(Exception):
""" """
@ -467,7 +467,7 @@ class Constrainable(Nameable, Indexable, Observable):
Constrain the parameter to the given Constrain the parameter to the given
:py:class:`GPy.core.transformations.Transformation`. :py:class:`GPy.core.transformations.Transformation`.
""" """
self.param_array[:] = transform.initialize(self.param_array) self.param_array[...] = transform.initialize(self.param_array)
reconstrained = self.unconstrain() reconstrained = self.unconstrain()
self._add_to_index_operations(self.constraints, reconstrained, transform, warning) self._add_to_index_operations(self.constraints, reconstrained, transform, warning)
self.notify_observers(self, None if trigger_parent else -np.inf) self.notify_observers(self, None if trigger_parent else -np.inf)