diff --git a/python/example/brunel.py b/python/example/brunel.py index 37c415cd5b0de09cd283393ca958341baf62ee47..541a72c4ba261ef76c7a894748ddd9456d09b02f 100755 --- a/python/example/brunel.py +++ b/python/example/brunel.py @@ -64,11 +64,16 @@ class brunel_recipe (arbor.recipe): gen = RandomState(gid + self.seed_) connections=[] # Add incoming excitatory connections. - for i in sample_subset(gen, gid, 0, self.ncells_exc_, self.in_degree_exc_): - connections.append(arbor.connection((i,"src"), "tgt", self.weight_exc_, self.delay_)) + connections = [ + arbor.connection((i,"src"), "tgt", self.weight_exc_, self.delay_) + for i in sample_subset(gen, gid, 0, self.ncells_exc_, self.in_degree_exc_) + ] # Add incoming inhibitory connections. - for i in sample_subset(gen, gid, self.ncells_exc_, self.ncells_exc_ + self.ncells_inh_, self.in_degree_inh_): - connections.append(arbor.connection((i,"src"), "tgt", self.weight_inh_, self.delay_)) + connections += [ + arbor.connection((i,"src"), "tgt", self.weight_inh_, self.delay_) + for i in sample_subset(gen, gid, self.ncells_exc_, self.ncells_exc_ + self.ncells_inh_, self.in_degree_inh_) + ] + return connections def cell_description(self, gid):