reverting the fixing behaviour.

two reasons: 1) the new behaviour is confusing for new users. Either
something is fixed, or it's not. 2) the fixing didn't work! things that
should have been fixed were passed to the optimizer for optimization.

If we really want to save keystrokes, consider this:

m.foo.fix()
m.foo.unfix()
m.foo.constrain_positive()

is the same as

m.foo.fix()
m.foo.constrain_positive()

but the latter throws a warning.
This commit is contained in:
James Hensman 2014-05-29 09:55:49 +01:00
parent b945c20004
commit ac2d28e2fd

View file

@ -324,7 +324,6 @@ class Indexable(Nameable, Observable):
self._default_constraint_ = default_constraint self._default_constraint_ = default_constraint
from index_operations import ParameterIndexOperations from index_operations import ParameterIndexOperations
self.constraints = ParameterIndexOperations() self.constraints = ParameterIndexOperations()
self._old_constraints = ParameterIndexOperations()
self.priors = ParameterIndexOperations() self.priors = ParameterIndexOperations()
if self._default_constraint_ is not None: if self._default_constraint_ is not None:
self.constrain(self._default_constraint_) self.constrain(self._default_constraint_)
@ -388,8 +387,8 @@ class Indexable(Nameable, Observable):
if value is not None: if value is not None:
self[:] = value self[:] = value
index = self._raveled_index() #index = self._raveled_index()
# reconstrained = self.unconstrain() index = self.unconstrain()
index = self._add_to_index_operations(self.constraints, index, __fixed__, warning) index = self._add_to_index_operations(self.constraints, index, __fixed__, warning)
self._highest_parent_._set_fixed(self, index) self._highest_parent_._set_fixed(self, index)
self.notify_observers(self, None if trigger_parent else -np.inf) self.notify_observers(self, None if trigger_parent else -np.inf)