Changeset 962 for trunk

Show
Ignore:
Timestamp:
05/10/11 16:21:47 (13 months ago)
Author:
pierre
Message:

Some patch in the Brian module when using Short term plasticity. Fix also the bug in the FastConnector? when allow_autapses is False

Location:
trunk/src/brian
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/brian/__init__.py

    r957 r962  
    244244        self.connection_manager._finalize() 
    245245        if self._plasticity_model != "static_synapse": 
    246             for key in self.connections.key(): 
     246            for key in self.connections.keys: 
    247247                synapses = self.connections.brian_connections[key] 
    248248                if self._plasticity_model is "stdp_synapse":  
  • trunk/src/brian/connectors.py

    r957 r962  
    4949        self.distance_matrix.set_source(src.position)         
    5050        if not self.allow_self_connections and self.projection.pre == self.projection.post: 
    51             i         = numpy.where(self.candidates == src)[0] 
    52             precreate = numpy.delete(precreate, i) 
     51            idx_src   = numpy.where(self.candidates == src) 
     52            if len(idx_src) > 0: 
     53                i     = numpy.where(precreate == idx_src[0]) 
     54                if len(i) > 0: 
     55                    precreate = numpy.delete(precreate, i[0]) 
    5356                 
    5457        if (n_connections is not None) and (len(precreate) > 0):