[Paraview] Problem reading a numpy NPZ file in ParaView 5.2.0 on Windows

Guillaume Jacquenot guillaume.jacquenot at gmail.com
Wed Jan 4 04:14:05 EST 2017


Hello everyone,

I want to report a possible bug.

I have a Python script that creates data, exports data in a numpy NPZ file,
and reads it later in a ProgrammableFilter.

With ParaView 5.1.2, everything works fine.

However, when I try it with ParaView 5.2.0, I have a weird reading error.

I have checked the 'About ParaView' window, but see no real difference
between
the two versions.

If I try to import the PV 5.2.0 npz generated file in another Python
interpreter with anoter numpy version (1.11.3), I have no problem.

So I guess, the PV 5.2.0 npz generated files are correct, but there is a
problem accessing its content from PV 5.2.0

Here is a script that reproduces the bug. It is to be run from the PV
interpreter.

    import os
    import tempfile
    import numpy as np
    outputFilename = os.path.join(tempfile.mkdtemp(), 'dummy.npz')
    varName='Time'
    np.savez(outputFilename, **{varName:np.random.rand(3,4)})
    d = np.load(outputFilename)
    time = d[varName]
    d.close()
    os.remove(outputFilename)
    print('Success PV can create a NPZ file and read its content : ' +
outputFilename)

Here is the message error on Windows with PV 5.2.0

>>> Traceback (most recent call last):
  File "<string>", line 8, in <module>
  File
"D:\ParaView-5.2.0-Qt4-OpenGL2-Windows-64bit\bin\lib\site-packages\numpy\lib\npyio.py",
line 250, in __getitem__
    return format.read_array(bytes)
  File
"D:\ParaView-5.2.0-Qt4-OpenGL2-Windows-64bit\bin\lib\site-packages\numpy\lib\format.py",
line 437, in read_array
    shape, fortran_order, dtype = read_array_header_1_0(fp)
  File
"D:\ParaView-5.2.0-Qt4-OpenGL2-Windows-64bit\bin\lib\site-packages\numpy\lib\format.py",
line 334, in read_array_header_1_0
    d = safe_eval(header)
  File
"D:\ParaView-5.2.0-Qt4-OpenGL2-Windows-64bit\bin\lib\site-packages\numpy\lib\utils.py",
line 1132, in safe_eval
    return walker.visit(ast)
  File
"D:\ParaView-5.2.0-Qt4-OpenGL2-Windows-64bit\bin\lib\site-packages\numpy\lib\utils.py",
line 980, in visit
    return meth(node, **kw)
  File
"D:\ParaView-5.2.0-Qt4-OpenGL2-Windows-64bit\bin\lib\site-packages\numpy\lib\utils.py",
line 987, in visitExpression
    for child in node.getChildNodes():
AttributeError: 'Expression' object has no attribute 'getChildNodes'

Guillaume Jacquenot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview/attachments/20170104/b49830a8/attachment.html>


More information about the ParaView mailing list