Changeset 374
- Timestamp:
- 06/18/08 15:39:28 (5 months ago)
- Files:
-
- trunk/src/facetsml.py (modified) (3 diffs)
- trunk/src/nest1/__init__.py (modified) (2 diffs)
- trunk/src/nest2/__init__.py (modified) (3 diffs)
- trunk/src/neuron/__init__.py (modified) (9 diffs)
- trunk/src/neuron/connectors.py (modified) (1 diff)
- trunk/src/neuron2/connectors.py (modified) (1 diff)
- trunk/src/recording.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/facetsml.py
r342 r374 369 369 # the node 370 370 #self.gidlist = [self.fullgidlist[i+myid] for i in range(0, len(self.fullgidlist),nhost) if i < len(self.fullgidlist)-myid] 371 #self. gid_start= gid371 #self.first_id = gid 372 372 373 373 … … 468 468 for i,s in zip(addr,self.steps): 469 469 index += i*s 470 id = index + self. gid_start470 id = index + self.first_id 471 471 assert addr == self.locate(id), 'index=%s addr=%s id=%s locate(id)=%s' % (index, addr, id, self.locate(id)) 472 472 # We return the gid as an ID object. Note that each instance of Populations … … 483 483 # id should be a gid 484 484 assert isinstance(id,int), "id is %s, not int" % type(id) 485 id -= self. gid_start485 id -= self.first_id 486 486 if self.ndim == 3: 487 487 rows = self.dim[1]; cols = self.dim[2] trunk/src/nest1/__init__.py
r339 r374 427 427 428 428 self.cell = numpy.array([ ID(pynest.getGID(addr)) for addr in self.cell ], ID) 429 self. id_start= self.cell.reshape(self.size,)[0]429 self.first_id = self.cell.reshape(self.size,)[0] 430 430 431 431 for id in self.cell: … … 495 495 ###return tuple([a.tolist()[0] for a in numpy.where(self.cell == id)]) 496 496 497 id -= self. id_start497 id -= self.first_id 498 498 if self.ndim == 3: 499 499 rows = self.dim[1]; cols = self.dim[2] trunk/src/nest2/__init__.py
r373 r374 556 556 self.cell = numpy.array([ ID(GID) for GID in self.cell ], ID) 557 557 self.cell_local = self.cell[numpy.array(nest.GetStatus(self.cell.tolist(),'local'))] 558 self. id_start= self.cell.reshape(self.size,)[0]558 self.first_id = self.cell.reshape(self.size,)[0] 559 559 560 560 for id in self.cell: … … 626 626 ###return tuple([a.tolist()[0] for a in numpy.where(self.cell == id)]) 627 627 628 id -= self. id_start628 id -= self.first_id 629 629 if self.ndim == 3: 630 630 rows = self.dim[1]; cols = self.dim[2] … … 1249 1249 # note that we assume that Population ids are consecutive, which is the case, but we should 1250 1250 # perhaps make an assert in __init__() to really make sure 1251 values[src-self.pre. id_start, tgt-self.post.id_start] = v1251 values[src-self.pre.first_id, tgt-self.post.first_id] = v 1252 1252 return values 1253 1253 trunk/src/neuron/__init__.py
r372 r374 72 72 except RuntimeError: 73 73 print "id:", self 74 print "parent. gid_start:", self.parent.gid_start74 print "parent.first_id:", self.parent.first_id 75 75 print "len(parent):", len(self.parent) 76 76 print "hoc_cell_list.count():", hoc_cell_list.count() … … 345 345 post_label = 'node%d: post_%s.%s' % (myid, self.population.hoc_label, self.variable) 346 346 id_list = self.population.gidlist 347 padding = self.population. gid_start347 padding = self.population.first_id 348 348 349 349 def post_data(): … … 368 368 for dimension in list(self.population.dim)[1:]: 369 369 header = "%s\t%d" % (header, dimension) 370 header += "\\n# first_id = %d\\n# last_id = %d\\n" % (self.population. gid_start, self.population.gid_start+self.population.size-1)370 header += "\\n# first_id = %d\\n# last_id = %d\\n" % (self.population.first_id, self.population.first_id+self.population.size-1) 371 371 372 372 if self.variable == 'v': … … 727 727 # the node 728 728 self.gidlist = [self.fullgidlist[i+myid] for i in range(0, len(self.fullgidlist), nhost) if i < len(self.fullgidlist)-myid] 729 self. gid_start= gid729 self.first_id = gid 730 730 731 731 # Write hoc commands … … 777 777 for i, s in zip(addr, self.steps): 778 778 index += i*s 779 id = index + self. gid_start779 id = index + self.first_id 780 780 assert addr == self.locate(id), 'index=%s addr=%s id=%s locate(id)=%s' % (index, addr, id, self.locate(id)) 781 781 # We return the gid as an ID object. Note that each instance of Populations … … 816 816 # id should be a gid 817 817 assert isinstance(id, int), "id is %s, not int" % type(id) 818 id -= self. gid_start818 id -= self.first_id 819 819 if self.ndim == 3: 820 820 rows = self.dim[1]; cols = self.dim[2] … … 886 886 raise common.InvalidDimensionsError, "Population: %s, value_array: %s" % (str(self.dim), 887 887 str(value_array.shape)) 888 values = values.take(numpy.array(self.gidlist)-self. gid_start) # take just the values for cells on this machine888 values = values.take(numpy.array(self.gidlist)-self.first_id) # take just the values for cells on this machine 889 889 assert len(values) == len(self.gidlist) 890 890 … … 1626 1626 for i in xrange(len(self)): 1627 1627 weight = getattr(h, self.hoc_label).object(i).weight[0] 1628 values[self.connections[i][0]-self.pre. gid_start,1629 self.connections[i][1]-self.post. gid_start] = weight1628 values[self.connections[i][0]-self.pre.first_id, 1629 self.connections[i][1]-self.post.first_id] = weight 1630 1630 return values 1631 1631 … … 1700 1700 for i in xrange(len(self)): 1701 1701 weight = getattr(h, self.hoc_label).object(i).weight[0] 1702 weights[self.connections[i][0]-self.pre. gid_start,1703 self.connections[i][1]-self.post. gid_start] = weight1702 weights[self.connections[i][0]-self.pre.first_id, 1703 self.connections[i][1]-self.post.first_id] = weight 1704 1704 for row in weights: 1705 1705 f.write(fmt % tuple(row)) trunk/src/neuron/connectors.py
r361 r374 95 95 hoc_commands = [] 96 96 for tgt in projection.post.gidlist: 97 src = tgt - projection.post. gid_start + projection.pre.gid_start97 src = tgt - projection.post.first_id + projection.pre.first_id 98 98 if hasattr(weight, 'next'): 99 99 w = weight.next() trunk/src/neuron2/connectors.py
r367 r374 95 95 hoc_commands = [] 96 96 for tgt in projection.post.gidlist: 97 src = tgt - projection.post. gid_start + projection.pre.gid_start97 src = tgt - projection.post.first_id + projection.pre.first_id 98 98 if hasattr(weight, 'next'): 99 99 w = weight.next() trunk/src/recording.py
r373 r374 47 47 """ 48 48 if population is not None: 49 padding = population. id_start49 padding = population.first_id 50 50 51 51 if variable == 'spikes': … … 73 73 if population is not None: 74 74 result.write("# dimensions =" + "\t".join([str(d) for d in population.dim]) + "\n") 75 result.write("# first_id = %d\n" % population. id_start)76 result.write("# last_id = %d\n" % (population. id_start+len(population)-1,))77 padding = population. id_start75 result.write("# first_id = %d\n" % population.first_id) 76 result.write("# last_id = %d\n" % (population.first_id+len(population)-1,)) 77 padding = population.first_id 78 78 else: 79 79 padding = 0

