On Thu, Apr 17, 2008 at 3:10 AM, Wim Bakker <[EMAIL PROTECTED]> wrote:
> The last version of numpy gives me headaches. I've been able to trace
> the problem to the use of astype(). When a memmap is deleted I get the
> following warning:
>
> Exception exceptions.ValueError: 'mmap closed or invalid' in <bound
> method memmap.__del__ of memmap([ 0., 1., 2., 3., 4., 5., 6., 7.,
> 8., 9.])> ignored
>
> The memmap still seems to work but these error messages slow don't the
> processing considerably. When reverting back to numpy 1.0.2 the problem
> disappears.
>
> Below is a short program that reproduces the warnings:
>
> ==
> import numpy
>
> a = numpy.memmap(r'C:\Temp\test.dat', mode='w+', shape=(10,), dtype='b')
>
> for i in range(10):
> a[i] = i
>
> del a
>
> a = numpy.memmap(r'C:\Temp\test.dat', mode='r', shape=(10,), dtype='b')
>
> a = a.astype('d')
>
> del a
> ==
>
> The last delete produces the warnings.
>
> Am I doing something wrong or should this be fixed in numpy?
I think I or someone else fixed most of these issues in SVN. Can you
try out SVN numpy and see if the warnings are gone in your code? I
don't see them on OS X.
--
Robert Kern
"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
-- Umberto Eco
_______________________________________________
Numpy-discussion mailing list
[email protected]
http://projects.scipy.org/mailman/listinfo/numpy-discussion