pypet/naturalnaming.py
def f_remove_child(self, name, recursive=False, predicate=None):
        """Removes a child of the group.

        Note that groups and leaves are only removed from the current trajectory in RAM.
        If the trajectory is stored to disk, this data is not affected. Thus, removing children
        can be only be used to free RAM memory!

        If you want to free memory on disk via your storage service,
        use :func:`~pypet.trajectory.Trajectory.f_delete_items` of your trajectory.

        :param name:

            Name of child, naming by grouping is NOT allowed ('groupA.groupB.childC'),
            child must be direct successor of current node.

        :param recursive:

            Must be true if child is a group that has children. Will remove
            the whole subtree in this case. Otherwise a Type Error is thrown.

        :param predicate:

            Predicate which can evaluate for each node to ``True`` in order to remove the node or
            ``False`` if the node should be kept. Leave ``None`` if you want to remove all nodes.

        :raises:

            TypeError if recursive is false but there are children below the node.

            ValueError if child does not exist.

        """
        if name not in self._children:
            raise ValueError('Your group `%s` does not contain the child `%s`.' %
                             (self.v_full_name, name))
        else:
            child = self._children[name]
            if (name not in self._links and
                    not child.v_is_leaf and
                    child.f_has_children() and
                    not recursive):
                raise TypeError('Cannot remove child. It is a group with children. Use'
                                ' f_remove with ``recursive = True``')
            else:
                self._nn_interface._remove_subtree(self, name, predicate)
def f_remove_child(self, name, recursive=False, predicate=None):
        if name not in self._children:
            raise ValueError('Your group `%s` does not contain the child `%s`.' %
                             (self.v_full_name, name))
        else:
            child = self._children[name]
            if (name not in self._links and
                    not child.v_is_leaf and
                    child.f_has_children() and
                    not recursive):
                raise TypeError('Cannot remove child. It is a group with children. Use'
                                ' f_remove with ``recursive = True``')
            else:
                self._nn_interface._remove_subtree(self, name, predicate)
def f_remove_child ( self , name , recursive = False , predicate = None ) : if name not in self . _children : raise ValueError ( 'Your group `%s` does not contain the child `%s`.' % ( self . v_full_name , name ) ) else : child = self . _children [ name ] if ( name not in self . _links and not child . v_is_leaf and child . f_has_children ( ) and not recursive ) : raise TypeError ( 'Cannot remove child. It is a group with children. Use' ' f_remove with ``recursive = True``' ) else : self . _nn_interface . _remove_subtree ( self , name , predicate )
Removes a child of the group.

        Note that groups and leaves are only removed from the current trajectory in RAM.
        If the trajectory is stored to disk, this data is not affected. Thus, removing children
        can be only be used to free RAM memory!

        If you want to free memory on disk via your storage service,
        use :func:`~pypet.trajectory.Trajectory.f_delete_items` of your trajectory.

        :param name:

            Name of child, naming by grouping is NOT allowed ('groupA.groupB.childC'),
            child must be direct successor of current node.

        :param recursive:

            Must be true if child is a group that has children. Will remove
            the whole subtree in this case. Otherwise a Type Error is thrown.

        :param predicate:

            Predicate which can evaluate for each node to ``True`` in order to remove the node or
            ``False`` if the node should be kept. Leave ``None`` if you want to remove all nodes.

        :raises:

            TypeError if recursive is false but there are children below the node.

            ValueError if child does not exist.
Removes a child of the group .