def __init__( self, sim, synapses, synapse_pop_name=None, user_tags=None, ): # Some functions return lists of synapses; so we # reduce the input down to a flat list: self.synapses = [] for s in synapses: if s is None: continue elif is_iterable(s): self.synapses.extend(s) else: print 'Not Iterable:', s self.synapses.append(s) for s in self.synapses: print s, type(s) assert s.population is None s.population = self self.sim = sim self.synapse_pop_name=synapse_pop_name if synapse_pop_name is not None else ObjectLabeller.get_next_unamed_object_name(SynapsePopulation, prefix="SynPop") user_tags = user_tags or []
def __init__(self, sim, neuron_functor, n, pop_name=None, name_tmpl_str=None, user_tags=None): user_tags = user_tags or [] if pop_name: user_tags.extend(pop_name.split("_")) if pop_name is None: pop_name = ObjectLabeller.get_next_unamed_object_name( NeuronPopulation, prefix="NrnPop", num_fmt_string="%d" ) self.pop_name = pop_name if name_tmpl_str is None: name_tmpl_str = "%s_$i" % self.pop_name name_tmpl = string.Template(name_tmpl_str) self.sim = sim # Create the neurons: self._nrns = [] for i in range(n): cell_name = name_tmpl.substitute({"i": i}) cell_tags = user_tags + ["Index%d" % i] n = neuron_functor(sim=sim, name=cell_name, cell_tags=cell_tags) n.population = self self._nrns.append(n) self._cell_to_index_lut = self._build_cell_to_index_lut()
def __init__(self, region_number_to_name_bidict=None, name=None, metadata=None): self.region_number_to_name_bidict = region_number_to_name_bidict self._name = name or ObjectLabeller.get_next_unamed_object_name(MorphologyBase) check_cstyle_varname(self._name) self.metadata = (metadata if metadata else {})
def __init__(self, region_number_to_name_bidict=None, name=None, metadata=None): self.region_number_to_name_bidict = region_number_to_name_bidict self._name = name or ObjectLabeller.get_next_unamed_object_name( MorphologyBase) check_cstyle_varname(self._name) self.metadata = (metadata if metadata else {})
def __init__( self, sim, neuron_functor, n, pop_name=None, name_tmpl_str=None, user_tags=None, ): user_tags = user_tags or [] if pop_name: user_tags.extend(pop_name.split('_')) if pop_name is None: pop_name = ObjectLabeller.get_next_unamed_object_name(NeuronPopulation, prefix='NrnPop', num_fmt_string='%d') self.pop_name = pop_name if name_tmpl_str is None: name_tmpl_str = '%s_$i' % self.pop_name name_tmpl = string.Template(name_tmpl_str) self.sim = sim # Create the neurons: self._nrns = [] for i in range(n): cell_name = name_tmpl.substitute({'i': i}) # print cell_name # assert False cell_tags = user_tags + ['Index%d' % i] n = neuron_functor(sim=sim, name=cell_name, cell_tags=cell_tags) n.population = self self._nrns.append(n) self._cell_to_index_lut = self._build_cell_to_index_lut()
def __init__( self, sim, neuron_functor, n, pop_name=None, name_tmpl_str=None, user_tags=None, ): user_tags = user_tags or [] if pop_name: user_tags.extend(pop_name.split('_')) if pop_name is None: pop_name = ObjectLabeller.get_next_unamed_object_name( NeuronPopulation, prefix='NrnPop', num_fmt_string='%d') self.pop_name = pop_name if name_tmpl_str is None: name_tmpl_str = '%s_$i' % self.pop_name name_tmpl = string.Template(name_tmpl_str) self.sim = sim # Create the neurons: self._nrns = [] for i in range(n): cell_name = name_tmpl.substitute({'i': i}) # print cell_name # assert False cell_tags = user_tags + ['Index%d' % i] n = neuron_functor(sim=sim, name=cell_name, cell_tags=cell_tags) n.population = self self._nrns.append(n) self._cell_to_index_lut = self._build_cell_to_index_lut()
def __init__( self, sim, synapses, synapse_pop_name=None, user_tags=None, ): # Some functions return lists of synapses; so we # reduce the input down to a flat list: self.synapses = [] for s in synapses: if s is None: continue elif is_iterable(s): self.synapses.extend(s) else: print 'Not Iterable:', s self.synapses.append(s) for s in self.synapses: print s, type(s) assert s.population is None s.population = self self.sim = sim self.synapse_pop_name = synapse_pop_name if synapse_pop_name is not None else ObjectLabeller.get_next_unamed_object_name( SynapsePopulation, prefix="SynPop") user_tags = user_tags or []