add untie

This commit is contained in:
Zhenwen Dai 2014-09-04 14:18:23 +01:00
parent 11bb1e4c4c
commit cf638a9e34
3 changed files with 9 additions and 6 deletions

View file

@ -555,6 +555,11 @@ class Indexable(Nameable, Observable):
plist.append(self) plist.append(self)
self._highest_parent_.ties.tie_together(plist) self._highest_parent_.ties.tie_together(plist)
def untie(self, *plist):
plist = list(plist)
plist.append(self)
self._highest_parent_.ties.untie(plist)
#=========================================================================== #===========================================================================
# Constrain operations -> done # Constrain operations -> done
#=========================================================================== #===========================================================================

View file

@ -161,12 +161,11 @@ class Parameterized(Parameterizable):
parent.size += param.size parent.size += param.size
parent = parent._parent_ parent = parent._parent_
self._notify_parent_change()
self._highest_parent_._notify_parent_change()
if not self._in_init_: if not self._in_init_:
self._connect_parameters() self._connect_parameters()
self._notify_parent_change()
self._highest_parent_._connect_parameters(ignore_added_names=_ignore_added_names) self._highest_parent_._connect_parameters(ignore_added_names=_ignore_added_names)
self._highest_parent_._notify_parent_change()
self._highest_parent_._connect_fixes() self._highest_parent_._connect_fixes()
if isinstance(param,Parameterized): if isinstance(param,Parameterized):

View file

@ -56,7 +56,7 @@ class Tie(Parameterized):
1. Add the support for multiple parameter tie_together and tie_vector 1. Add the support for multiple parameter tie_together and tie_vector
2. Properly handling parameters with constraints 2. Properly handling parameters with constraints
3. Properly handling the merging of two models [DONE] 3. Properly handling the merging of two models [DONE]
4. Properly handling initialization 4. Properly handling initialization [DONE]
""" """
def __init__(self, name='Ties'): def __init__(self, name='Ties'):
@ -238,7 +238,6 @@ class Tie(Parameterized):
self._update_label_buf() self._update_label_buf()
self.updates = True self.updates = True
def _check_change(self): def _check_change(self):
changed = False changed = False
if self.tied_param is not None: if self.tied_param is not None: