warning messages optional for re-constraining

This commit is contained in:
Max Zwiessele 2013-10-14 17:59:04 +01:00
parent e0d7de9b3b
commit 3a97eaf684
2 changed files with 20 additions and 18 deletions

View file

@ -250,7 +250,7 @@ class Model(Parameterized):
else:
self._set_params_transformed(initial_parameters)
def ensure_default_constraints(self):
def ensure_default_constraints(self, warning=True):
"""
Ensure that any variables which should clearly be positive
have been constrained somehow. The method performs a regular
@ -268,7 +268,7 @@ class Model(Parameterized):
if not (i in currently_constrained):
to_make_positive.append(i)
if len(to_make_positive):
self.constrain_positive(np.asarray(to_make_positive))
self.constrain_positive(np.asarray(to_make_positive), warning=warning)
def objective_function(self, x):
"""