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
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the ParaView Wiki at: 
http://paraview.org/Wiki/ParaView

Search the list archives at: http://markmail.org/search/?q=ParaView

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/paraview

Reply via email to