Hello,
When assigning a variable that is the transpose() of a memmap array, the
._mmap member doesn't get copied, I guess:
In [1]:import numpy
In [2]:amemmap = numpy.memmap( '/tmp/afile', dtype=numpy.float32, shape=(4,5), mode='w+' )
In [3]:bmemmap = amemmap.transpose()
In [4]:bmemmap.close()
---------------------------------------------------------------------------
/usr/local/stow/numpy-20070605_svn-py2.5/lib/python2.5/site-packages/numpy/core/memmap.py(88)close() 87 def close(self): ---> 88 self._mmap.close() 89
This is an issue when the data is accessed in an order that is different from how it is stored on disk, as: bmemmap = numpy.memmap( '/tmp/afile', dtype=numpy.float32, shape=(4,5), mode='w+' ).transpose() So the object that was originally produced not accessible. I imagine there is some better way to indicate order of dimensions, but regardless, doing In [4]:bmemmap._mmap = amemmap._mmap is a hack workaround. Best regards, Glen Mabey