Show
Ignore:
Timestamp:
02/16/10 10:59:22 (2 years ago)
Author:
apdavison
Message:

Moved Error classes out of common into an errors module (see ticket:157)

Files:
1 modified

Legend:

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

    r702 r711  
    3232from itertools import izip 
    3333import scipy.sparse 
    34 from pyNN import common, cells 
     34from pyNN import common, cells, errors 
    3535 
    3636mV = brian.mV 
     
    267267            eqs = brian.Equations(cellclass) 
    268268        except Exception, errmsg: 
    269             raise common.InvalidModelError(errmsg) 
     269            raise errors.InvalidModelError(errmsg) 
    270270        v_thresh   = cellparams['v_thresh'] 
    271271        v_reset    = cellparams['v_reset'] 
     
    477477        assert len(targets) > 0 
    478478        if not isinstance(source, common.IDMixin): 
    479             raise common.ConnectionError("source should be an ID object, actually %s" % type(source)) 
     479            raise errors.ConnectionError("source should be an ID object, actually %s" % type(source)) 
    480480        for target in targets: 
    481481            if not isinstance(target, common.IDMixin): 
    482                 raise common.ConnectionError("Invalid target ID: %s" % target) 
     482                raise errors.ConnectionError("Invalid target ID: %s" % target) 
    483483        assert len(targets) == len(weights) == len(delays), "%s %s %s" % (len(targets),len(weights),len(delays)) 
    484484        if common.is_conductance(targets[0]): 
     
    492492            source_group = source.parent_group 
    493493        except AttributeError, errmsg: 
    494             raise common.ConnectionError("%s. Maybe trying to connect from non-existing cell (ID=%s)." % (errmsg, source)) 
     494            raise errors.ConnectionError("%s. Maybe trying to connect from non-existing cell (ID=%s)." % (errmsg, source)) 
    495495        target_group = targets[0].parent_group # we assume here all the targets belong to the same NeuronGroup 
    496496        bc = self._get_brian_connection(source_group,