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/pcsim/__init__.py

    r701 r711  
    1515 
    1616import pyNN.random 
    17 from pyNN import common, recording, __doc__ 
     17from pyNN import common, recording, errors, __doc__ 
    1818from pyNN.pcsim import simulator 
    1919common.simulator = simulator 
     
    223223#    if delay  is None:  delay = simulator.state.min_delay 
    224224#    if delay < get_min_delay(): 
    225 #        raise common.ConnectionError("Delay (%g ms) must be >= the minimum delay (%g ms)" % (delay, get_min_delay())) 
     225#        raise errors.ConnectionError("Delay (%g ms) must be >= the minimum delay (%g ms)" % (delay, get_min_delay())) 
    226226#    # Convert units 
    227227#    delay = delay / 1000 # Delays in pcsim are specified in seconds 
     
    236236#            weight = 1e-9 * weight # Convert from nA to A 
    237237#    except exceptions.Exception, e: # non-existent connection 
    238 #        raise common.ConnectionError(e) 
     238#        raise errors.ConnectionError(e) 
    239239#    # Create synapse factory 
    240240#    syn_factory = 0 
     
    274274#            return connections.idVector() 
    275275#    except exceptions.TypeError, e: 
    276 #        raise common.ConnectionError(e) 
     276#        raise errors.ConnectionError(e) 
    277277#    except exceptions.Exception, e: 
    278 #        raise common.ConnectionError(e) 
     278#        raise errors.ConnectionError(e) 
    279279connect = common.connect 
    280280set = common.set     
     
    333333        if isinstance(cellclass, str): 
    334334            if not cellclass in dir(pypcsim): 
    335                 raise common.InvalidModelError('Trying to create non-existent cellclass ' + cellclass ) 
     335                raise errors.InvalidModelError('Trying to create non-existent cellclass ' + cellclass ) 
    336336            cellclass = getattr(pypcsim, cellclass) 
    337337            self.celltype = cellclass 
     
    379379    ##        addr = (addr,) 
    380380    ##    if len(addr) != self.actual_ndim: 
    381     ##       raise common.InvalidDimensionsError, "Population has %d dimensions. Address was %s" % (self.actual_ndim, str(addr)) 
     381    ##       raise errors.InvalidDimensionsError, "Population has %d dimensions. Address was %s" % (self.actual_ndim, str(addr)) 
    382382    ##    orig_addr = addr; 
    383383    ##    while len(addr) < 3: 
     
    427427    ##        coords = (id,) 
    428428    ##    else: 
    429     ##        raise common.InvalidDimensionsError 
     429    ##        raise errors.InvalidDimensionsError 
    430430    ##    if self.actual_ndim == 1: 
    431431    ##        if coords[0] > self.dim[0]: 
     
    470470    ##            setattr(cell, parametername, val) 
    471471    ##    else: 
    472     ##        raise common.InvalidDimensionsError 
     472    ##        raise errors.InvalidDimensionsError 
    473473         
    474474    ##def rset(self, parametername, rand_distr): 
     
    655655                 
    656656            if len(possible_models) == 0: 
    657                 raise common.NoModelAvailableError("The synapse model requested is not available.") 
     657                raise errors.NoModelAvailableError("The synapse model requested is not available.") 
    658658            synapse_type = getattr(pypcsim, list(possible_models)[0]) 
    659659            try: