fix the problem of _update_label_buf

This commit is contained in:
Zhenwen Dai 2014-10-14 10:37:25 +01:00
parent 91eea829a2
commit 31b451494d
2 changed files with 4 additions and 6 deletions

View file

@ -172,8 +172,7 @@ class Parameterized(Parameterizable):
if not isinstance(param,Tie):
self._highest_parent_.ties.mergeTies(param)
else:
if hasattr(self._highest_parent_,'ties'):
self._highest_parent_.ties._update_label_buf()
self._highest_parent_.ties._update_label_buf()
else:
raise HierarchyError, """Parameter exists already, try making a copy"""
@ -221,8 +220,7 @@ class Parameterized(Parameterizable):
if not isinstance(param,Tie):
self._highest_parent_.ties.splitTies(param)
else:
if hasattr(self._highest_parent_,'ties'):
self._highest_parent_.ties._update_label_buf()
self._highest_parent_.ties._update_label_buf()
def add_parameter(self, *args, **kwargs):
raise DeprecationWarning, "add_parameter was renamed to link_parameter to avoid confusion of setting variables"

View file

@ -156,7 +156,7 @@ class Tie(Parameterized):
p.ties.tied_param.tie[:] = labels
p.ties._sync_val([p],toTiedParam=True)
p.ties._sync_constraints([p], toTiedParam=True)
p._update_label_buf()
p.ties._update_label_buf()
p.update_model(True)
def mergeTies(self, p):
@ -190,7 +190,7 @@ class Tie(Parameterized):
p.tied_param.tie[:] = self.tied_param.tie[idx]
self._remove_unnecessary_ties()
self._update_label_buf()
p._update_label_buf()
p.ties._update_label_buf()
self.update_model(True)
def _traverse_param(self, func, p, res):