[Numpy-discussion] Windows/numpy1.0.4 memmap & astype produce loads of warnings on delete
Robert Kern
robert.kern@gmail....
Thu Apr 17 03:21:12 CDT 2008
On Thu, Apr 17, 2008 at 3:10 AM, Wim Bakker <bakker@itc.nl> 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
More information about the Numpy-discussion
mailing list