Show
Ignore:
Timestamp:
02/17/10 22:45:18 (2 years ago)
Author:
apdavison
Message:

Moved standard model (cells and synapses) machinery out of the common module into its own module

Files:
1 modified

Legend:

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

    r711 r713  
    2727 
    2828import nest 
    29 from pyNN import common, random, errors 
     29from pyNN import common, random, errors, standardmodels, core 
    3030import logging 
    3131import numpy 
     
    150150        nest_model = cellclass 
    151151        cell_parameters = cellparams or {} 
    152     elif isinstance(cellclass, type) and issubclass(cellclass, common.StandardCellType): 
     152    elif isinstance(cellclass, type) and issubclass(cellclass, standardmodels.StandardCellType): 
    153153        celltype = cellclass(cellparams) 
    154154        nest_model = celltype.nest_name 
     
    310310        """ 
    311311        # are we sure the targets are all on the current node? 
    312         if common.is_listlike(source): 
     312        if core.is_listlike(source): 
    313313            assert len(source) == 1 
    314314            source = source[0] 
    315         if not common.is_listlike(targets): 
     315        if not core.is_listlike(targets): 
    316316            targets = [targets] 
    317317        assert len(targets) > 0 
     
    351351        """ 
    352352        # are we sure the targets are all on the current node? 
    353         if common.is_listlike(target): 
     353        if core.is_listlike(target): 
    354354            assert len(target) == 1 
    355355            target = target[0] 
    356         if not common.is_listlike(sources): 
     356        if not core.is_listlike(sources): 
    357357            sources = [sources] 
    358358        assert len(sources) > 0, sources 
     
    452452                   matrix (as returned by `get(format='array')`). 
    453453        """ 
    454         if not (common.is_number(value) or common.is_listlike(value)): 
     454        if not (numpy.isscalar(value) or core.is_listlike(value)): 
    455455            raise TypeError("Argument should be a numeric type (int, float...), a list, or a numpy array.")    
    456456         
     
    470470                    value_list.append(val) 
    471471            value = value_list 
    472         if common.is_listlike(value): 
     472        if core.is_listlike(value): 
    473473            value = numpy.array(value) 
    474474        else: