Changeset 1035

Show
Ignore:
Timestamp:
12/15/11 17:52:55 (5 months ago)
Author:
pierre
Message:

Fix a minor bug in the iterators of an Assembly object, such that iterating over an Assembly works. Current Sources are now working with assemblies. Add also a set() method for the Assemblies

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/common/populations.py

    r1001 r1035  
    10681068        on the local MPI node. 
    10691069        """ 
    1070         return chain(iter(p) for p in self.populations) 
     1070        iterators = [iter(p) for p in self.populations] 
     1071        return chain(*iterators) 
    10711072 
    10721073    def __len__(self): 
     
    11551156        for p in self.populations: 
    11561157            p.initialize(variable, value) 
     1158 
     1159    def set(self, param, val=None): 
     1160        """ 
     1161        Set one or more parameters for every cell in the Assembly. param 
     1162        can be a dict, in which case val should not be supplied, or a string 
     1163        giving the parameter name, in which case val is the parameter value. 
     1164        val can be a numeric value, or list of such (e.g. for setting spike 
     1165        times). 
     1166        e.g. p.set("tau_m",20.0). 
     1167             p.set({'tau_m':20,'v_rest':-65}) 
     1168        """ 
     1169        for p in self.populations: 
     1170            p.set(param, val) 
     1171 
    11571172 
    11581173    def rset(self, parametername, rand_distr):