graphit/graph.py
def remove_node(self, node):
        """
        Removing a node from the graph
        
        Checks if the graph contains the node and if the node is connected with
        edges. Removes the node and associated edges.

        If the graph is a (sub)graph representing a `view` on the origin graph,
        the node is removed from the view and not from the origin.

        :param node: Node to remove
        :type node: mixed
        """
        
        if node in self.nodes:
            
            # Get edges connected to node and remove them
            edges = [edge for edge in self.edges if node in edge]
            for edge in edges:
                del self.edges[edge]

            # Remove node from nodes object
            del self.nodes[node]
            
            msg = 'Removed node {0} with {1} connecting edges from graph'
            logger.debug(msg.format(node, len(edges)))
        
        else:
            msg = 'Unable to remove node {0}. No such node ID'.format(node)
            logger.warning(msg)

        Removing a node from the graph
        
        Checks if the graph contains the node and if the node is connected with
        edges. Removes the node and associated edges.

        If the graph is a (sub)graph representing a `view` on the origin graph,
        the node is removed from the view and not from the origin.

        :param node: Node to remove
        :type node: mixed
        
Removing a node from the graph
Checks if the graph contains the node and if the node is connected with
edges. Removes the node and associated edges.

If the graph is a (sub)graph representing a `view` on the origin graph,
the node is removed from the view and not from the origin.
Removing a node from the graph Checks if the graph contains the node and if the node is connected with edges . Removes the node and associated edges . If the graph is a ( sub ) graph representing a ` view ` on the origin graph the node is removed from the view and not from the origin .
def remove_node(self, node):
        if node in self.nodes:
            edges = [edge for edge in self.edges if node in edge]
            for edge in edges:
                del self.edges[edge]
            del self.nodes[node]
            msg = 'Removed node {0} with {1} connecting edges from graph'
            logger.debug(msg.format(node, len(edges)))
        else:
            msg = 'Unable to remove node {0}. No such node ID'.format(node)
            logger.warning(msg)
def remove_node ( self , node ) : if node in self . nodes : edges = [ edge for edge in self . edges if node in edge ] for edge in edges : del self . edges [ edge ] del self . nodes [ node ] msg = 'Removed node {0} with {1} connecting edges from graph' logger . debug ( msg . format ( node , len ( edges ) ) ) else : msg = 'Unable to remove node {0}. No such node ID' . format ( node ) logger . warning ( msg )
Removing a node from the graph
Checks if the graph contains the node and if the node is connected with
edges.
Removing a node from the graph Checks if the graph contains the node and if the node is connected with edges .
"""
        Removing a node from the graph
        
        Checks if the graph contains the node and if the node is connected with
        edges. Removes the node and associated edges.

        If the graph is a (sub)graph representing a `view` on the origin graph,
        the node is removed from the view and not from the origin.

        :param node: Node to remove
        :type node: mixed
        """ # Get edges connected to node and remove them # Remove node from nodes object
self
node
Node to remove
Node to remove