Changeset 431
- Timestamp:
- 08/01/08 16:27:53 (3 weeks ago)
- Files:
-
- trunk/src/neuron/__init__.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/neuron/__init__.py
r416 r431 879 879 if self.dim == value_array.shape: # the values are numbers or non-array objects 880 880 values = value_array.flatten() 881 elif len(value_array.shape) == len(self.dim)+1: # the values are themselves 1D arrays882 values = numpy.reshape(value_array, (self. dim, value_array.size/self.cell.size))881 elif self.dim == value_array.shape[:-1]: # the values are themselves 1D arrays 882 values = numpy.reshape(value_array, (self.size, value_array.size/self.size)) 883 883 else: 884 884 raise common.InvalidDimensionsError, "Population: %s, value_array: %s" % (str(self.dim), 885 885 str(value_array.shape)) 886 values = values.take(numpy.array(self.gidlist)-self.first_id ) # take just the values for cells on this machine886 values = values.take(numpy.array(self.gidlist)-self.first_id, axis=0) # take just the values for cells on this machine 887 887 assert len(values) == len(self.gidlist) 888 888
