ribolands/ribolands.py
def addnode(self, key, 
                structure = None, 
                identity = None, 
                energy = None, 
                occupancy = 0, 
                **kwargs):
        """ Add a node with attributes to the graph.

        Key and identity are separate, because there are circumstances where
        one wants to have e.g. the secondary structure as key, but that does
        not go well with visualization or simulation. 
        """
        assert key not in self._nodes
        if energy is not None:
            assert isinstance(energy, int)
            energy = energy
        elif structure is not None:
            energy = int(round(self.fc.eval_structure(structure)*100))
        if identity is None:
            identity = f'{self.prefix}{self.nodeID}'
            self.nodeID += 1
        assert isinstance(identity, str)
        self._nodes[key] = {'structure': structure,
                            'identity': identity,
                            'energy': energy,
                            'occupancy': occupancy}
        self._nodes[key].update(kwargs)
        #self._in_edges[key] = set()
        #self._out_edges[key] = set()
        return
 Add a node with attributes to the graph.

        Key and identity are separate, because there are circumstances where
        one wants to have e.g. the secondary structure as key, but that does
        not go well with visualization or simulation. 
        
Add a node with attributes to the graph.
Key and identity are separate, because there are circumstances where
one wants to have e.g. the secondary structure as key, but that does
not go well with visualization or simulation.
Add a node with attributes to the graph . Key and identity are separate because there are circumstances where one wants to have e . g . the secondary structure as key but that does not go well with visualization or simulation .
def addnode(self, key, 
                structure = None, 
                identity = None, 
                energy = None, 
                occupancy = 0, 
                **kwargs):
        assert key not in self._nodes
        if energy is not None:
            assert isinstance(energy, int)
            energy = energy
        elif structure is not None:
            energy = int(round(self.fc.eval_structure(structure)*100))
        if identity is None:
            identity = f'{self.prefix}{self.nodeID}'
            self.nodeID += 1
        assert isinstance(identity, str)
        self._nodes[key] = {'structure': structure,
                            'identity': identity,
                            'energy': energy,
                            'occupancy': occupancy}
        self._nodes[key].update(kwargs)
        return
def addnode ( self , key , structure = None , identity = None , energy = None , occupancy = 0 , ** kwargs ) : assert key not in self . _nodes if energy is not None : assert isinstance ( energy , int ) energy = energy elif structure is not None : energy = int ( round ( self . fc . eval_structure ( structure ) * 100 ) ) if identity is None : identity = f'{self.prefix}{self.nodeID}' self . nodeID += 1 assert isinstance ( identity , str ) self . _nodes [ key ] = { 'structure' : structure , 'identity' : identity , 'energy' : energy , 'occupancy' : occupancy } self . _nodes [ key ] . update ( kwargs ) return
Add a node with attributes to the graph.
Add a node with attributes to the graph .
""" Add a node with attributes to the graph.

        Key and identity are separate, because there are circumstances where
        one wants to have e.g. the secondary structure as key, but that does
        not go well with visualization or simulation. 
        """ #self._in_edges[key] = set() #self._out_edges[key] = set()
self
key
structure
identity
energy
occupancy