Changeset 977
- Timestamp:
- 06/08/11 17:34:51 (12 months ago)
- Location:
- trunk/src
- Files:
-
- 2 modified
-
common.py (modified) (1 diff)
-
nemo/simulator.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/common.py
r961 r977 1215 1215 @property 1216 1216 def _homogeneous_synapses(self): 1217 syn = is_conductance(self.populations[0].all_cells[0]) 1218 for p in self.populations[1:]: 1219 if syn != is_conductance(p.all_cells[0]): 1220 return False 1217 syn = None 1218 for count, p in enumerate(self.populations): 1219 if len(p.all_cells) > 0: 1220 syn = is_conductance(p.all_cells[0]) 1221 1222 if syn is not None: 1223 for p in self.populations[count:]: 1224 if len(p.all_cells) > 0: 1225 if syn != is_conductance(p.all_cells[0]): 1226 return False 1221 1227 return True 1222 1228 -
trunk/src/nemo/simulator.py
r957 r977 307 307 assert len(targets) == len(weights) == len(delays), "%s %s %s" % (len(targets),len(weights),len(delays)) 308 308 synapse_type = self.synapse_type or "excitatory" 309 if isinstance(delays, numpy.ndarray): 310 delays = delays.astype(int).tolist() 309 delays = numpy.array(delays).astype(int).tolist() 311 310 if isinstance(weights, numpy.ndarray): 312 311 weights = weights.tolist() 313 source = int(source) 314 if len(targets) == 1: 315 targets = int(targets[0]) 316 delays = int(delays[0]) 317 weights = weights[0] 312 source = int(source) 318 313 synapses = state.net.add_synapse(source, targets, delays, weights, self.is_plastic) 319 314 self.sources.append(source)
