Changeset 711 for trunk/src/pcsim/simulator.py
- Timestamp:
- 02/16/10 10:59:22 (2 years ago)
- Files:
-
- 1 modified
-
trunk/src/pcsim/simulator.py (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/pcsim/simulator.py
r702 r711 30 30 import types 31 31 import numpy 32 from pyNN import common 32 from pyNN import common, errors 33 33 34 34 recorder_list = [] … … 156 156 cellfactory = cellclass(**cellparams) 157 157 else: 158 raise common.InvalidModelError("Trying to create non-existent cellclass %s" % cellclass.__name__)158 raise errors.InvalidModelError("Trying to create non-existent cellclass %s" % cellclass.__name__) 159 159 else: 160 raise common.InvalidModelError("Trying to create non-existent cellclass %s" % cellclass)160 raise errors.InvalidModelError("Trying to create non-existent cellclass %s" % cellclass) 161 161 162 162 all_ids = numpy.array([i for i in net.add(cellfactory, n)], ID) … … 275 275 if not isinstance(source, (int, long)) or source < 0: 276 276 errmsg = "Invalid source ID: %s" % source 277 raise common.ConnectionError(errmsg)277 raise errors.ConnectionError(errmsg) 278 278 if not common.is_listlike(targets): 279 279 targets = [targets] … … 285 285 for target in targets: 286 286 if not isinstance(target, common.IDMixin): 287 raise common.ConnectionError("Invalid target ID: %s" % target)287 raise errors.ConnectionError("Invalid target ID: %s" % target) 288 288 assert len(targets) == len(weights) == len(delays), "%s %s %s" % (len(targets),len(weights),len(delays)) 289 289 if common.is_conductance(targets[0]): … … 300 300 syn_factory = synapse_type 301 301 else: 302 raise common.ConnectionError("synapse_type must be a string or a PCSIM synapse factory. Actual type is %s" % type(synapse_type))302 raise errors.ConnectionError("synapse_type must be a string or a PCSIM synapse factory. Actual type is %s" % type(synapse_type)) 303 303 for target, weight, delay in zip(targets, weights, delays): 304 304 syn_factory.W = weight*weight_scale_factor … … 307 307 c = net.connect(source, target, syn_factory) 308 308 except RuntimeError, e: 309 raise common.ConnectionError(e)309 raise errors.ConnectionError(e) 310 310 if target.local: 311 311 self.connections.append(Connection(source, target, net.object(c), 1.0/weight_scale_factor))
