Ticket #108: fix_tset.diff
| File fix_tset.diff, 1.4 kB (added by mschmucker, 4 months ago) |
|---|
-
src/neuron/__init__.py
old new 879 879 if self.dim == value_array.shape: # the values are numbers or non-array objects 880 880 values = value_array.flatten() 881 881 elif len(value_array.shape) == len(self.dim)+1: # the values are themselves 1D arrays 882 values = numpy.reshape(value_array, (self.dim, value_array.size/self.cell.size)) 882 newdim = list(self.dim) 883 newdim.append(value_array.size/self.cell.size) 884 newdim = tuple(newdim) 885 values = numpy.reshape(value_array, newdim) 883 886 else: 884 887 raise common.InvalidDimensionsError, "Population: %s, value_array: %s" % (str(self.dim), 885 888 str(value_array.shape)) 886 values = values.take(numpy.array(self.gidlist)-self.first_id ) # take just the values for cells on this machine889 values = values.take(numpy.array(self.gidlist)-self.first_id, axis = 0) # take just the values for cells on this machine 887 890 assert len(values) == len(self.gidlist) 888 889 891 # Set the values for each cell 890 892 for cell, val in zip(self.gidlist, values): 891 893 if not isinstance(val, str) and hasattr(val, "__len__"):

