Problem reading a numpy NPZ file in ParaView 5.3.0 RC3 -> Add 'compiler' Python module into release
Hi Kitware's developers
I want to report a ParaView/Python issue with version 5.3.0 RC3.
It is related to the use of specific numpy functions from ParaView. I am using numpy functions that rely on the 'compiler' module . And apparently ParaView does not embed this module and this leads an error.
A minimal example that reproduces the bug is provided below, with the error message.
The issue I am reporting was not present 5.1.2, introduced in 5.2.0 and is still present in version 5.3.0 RC3.
I already had reported this bug, here http://public.kitware.com/pipermail/paraview/2017-January/038890.html
This led @utkarsh.ayachit to create the issue paraview-superbuild#43 (closed)
@cory-quammen solved the problem and closed the issue. But apparently, it is not.
The code below is working with ParaView 5.1.2, but not anymore with version 5.2.0 and 5.3.0 RC3
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: ParaView can create a NPZ file and read its content : ' + outputFilename)
With PV 5.1.2, it worked as a charm. With PV 5.3.0 RC3 here is the error message
Python 2.7.3 (default, Sep 27 2016, 14:23:08) [MSC v.1500 64 bit (AMD64)] on win32
>>> from paraview.simple import *
>>> Traceback (most recent call last):
File "<string>", line 8, in <module>
File "D:\ParaView-5.3.0-RC3-Qt5-OpenGL2-Windows-64bit\bin\lib\site-packages\numpy\lib\npyio.py", line 250, in __getitem__
return format.read_array(bytes)
File "D:\ParaView-5.3.0-RC3-Qt5-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.3.0-RC3-Qt5-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.3.0-RC3-Qt5-OpenGL2-Windows-64bit\bin\lib\site-packages\numpy\lib\utils.py", line 1132, in safe_eval
return walker.visit(ast)
File "D:\ParaView-5.3.0-RC3-Qt5-OpenGL2-Windows-64bit\bin\lib\site-packages\numpy\lib\utils.py", line 980, in visit
return meth(node, **kw)
File "D:\ParaView-5.3.0-RC3-Qt5-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'
>>>
Thanks for looking at it! It would be nice to embed the missing modules for version 5.3.0.