mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-30 14:35:15 +02:00
fix the param renaming problem
This commit is contained in:
parent
59bd0d3b6e
commit
7152f41f82
1 changed files with 2 additions and 1 deletions
|
|
@ -947,7 +947,7 @@ class Parameterizable(OptimizationHandlable):
|
||||||
self._add_parameter_name(param, ignore_added_names)
|
self._add_parameter_name(param, ignore_added_names)
|
||||||
# and makes sure to not delete programmatically added parameters
|
# and makes sure to not delete programmatically added parameters
|
||||||
for other in self.parameters[::-1]:
|
for other in self.parameters[::-1]:
|
||||||
if other is not param and other.name.startswith(param.name):
|
if other is not param and other.name == param.name:
|
||||||
warn_and_retry(param, _name_digit.match(other.name))
|
warn_and_retry(param, _name_digit.match(other.name))
|
||||||
return
|
return
|
||||||
if pname not in dir(self):
|
if pname not in dir(self):
|
||||||
|
|
@ -955,6 +955,7 @@ class Parameterizable(OptimizationHandlable):
|
||||||
self._added_names_.add(pname)
|
self._added_names_.add(pname)
|
||||||
elif pname in self.__dict__:
|
elif pname in self.__dict__:
|
||||||
if pname in self._added_names_:
|
if pname in self._added_names_:
|
||||||
|
print self._added_names_
|
||||||
other = self.__dict__[pname]
|
other = self.__dict__[pname]
|
||||||
if not (param is other):
|
if not (param is other):
|
||||||
del self.__dict__[pname]
|
del self.__dict__[pname]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue