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/nest/simulator.py

    r708 r711  
    2727 
    2828import nest 
    29 from pyNN import common, random 
     29from pyNN import common, random, errors 
    3030import logging 
    3131import numpy 
     
    120120            exc_type, exc_value, traceback = sys.exc_info() 
    121121            if exc_type == 'NESTError' and "Unsupported Numpy array type" in exc_value: 
    122                 raise common.InvalidParameterValueError() 
     122                raise errors.InvalidParameterValueError() 
    123123            else: 
    124124                raise 
     
    159159        cell_gids = nest.Create(nest_model, n) 
    160160    except nest.NESTError, errmsg: 
    161         raise common.InvalidModelError(errmsg) 
     161        raise errors.InvalidModelError(errmsg) 
    162162    if cell_parameters: 
    163163        try: 
     
    317317        assert len(targets) > 0 
    318318        if self.synapse_type not in ('excitatory', 'inhibitory', None): 
    319             raise common.ConnectionError("synapse_type must be 'excitatory', 'inhibitory', or None (equivalent to 'excitatory')") 
     319            raise errors.ConnectionError("synapse_type must be 'excitatory', 'inhibitory', or None (equivalent to 'excitatory')") 
    320320        weights = weights*1000.0 # weights should be in nA or uS, but iaf_neuron uses pA and iaf_cond_neuron uses nS. 
    321321                                 # Using convention in this way is not ideal. We should 
     
    335335            nest.DivergentConnect([source], targets, weights, delays, self.synapse_model)             
    336336        except nest.NESTError, e: 
    337             raise common.ConnectionError("%s. source=%s, targets=%s, weights=%s, delays=%s, synapse model='%s'" % ( 
     337            raise errors.ConnectionError("%s. source=%s, targets=%s, weights=%s, delays=%s, synapse model='%s'" % ( 
    338338                                         e, source, targets, weights, delays, self.synapse_model)) 
    339339        self._connections = None # reset the caching of the connection list, since this will have to be recalculated 
     
    358358        assert len(sources) > 0, sources 
    359359        if self.synapse_type not in ('excitatory', 'inhibitory', None): 
    360             raise common.ConnectionError("synapse_type must be 'excitatory', 'inhibitory', or None (equivalent to 'excitatory')") 
     360            raise errors.ConnectionError("synapse_type must be 'excitatory', 'inhibitory', or None (equivalent to 'excitatory')") 
    361361        weights = weights*1000.0 # weights should be in nA or uS, but iaf_neuron uses pA and iaf_cond_neuron uses nS. 
    362362                                 # Using convention in this way is not ideal. We should 
     
    376376            nest.ConvergentConnect(sources, [target], weights, delays, self.synapse_model)             
    377377        except nest.NESTError, e: 
    378             raise common.ConnectionError("%s. sources=%s, target=%s, weights=%s, delays=%s, synapse model='%s'" % ( 
     378            raise errors.ConnectionError("%s. sources=%s, target=%s, weights=%s, delays=%s, synapse model='%s'" % ( 
    379379                                         e, sources, target, weights, delays, self.synapse_model)) 
    380380        self._connections = None # reset the caching of the connection list, since this will have to be recalculated