Programmable filter error: "isinstance" not working in PV5.5.0

Hello,

I have a very simple programmable filter that detects if an array exists or not in the input data (it uses “isinstance” in order to detect that). It works fine for PV5.4.0 and older versions but for PV5.5.0 and newer versions it is no longer working.

How can I modify it to make it work?

Please, find in the attached file 2 PVSM files: one that works fine in PV5.4.0 and the other that does not work properly in PV5.4.0.

In both cases I use this:

isinstance(inputs[0].GetPointData().GetArray("Z_VELOCITY"), vtk.numpy_interface.dataset_adapter.VTKNoneArray)

If the array “Z_VELOCITY” does not exists, its output should be “True”

Thanks in advance!

Miguel

PV_ERROR_TEST.cas (298.6 KB)
PV_ERROR_TEST.dat (491.3 KB)
STATE_error_PV5_5_0.pvsm (685.1 KB)
STATE_reference_PV5_4_0.pvsm (656.6 KB)

I’m not sure why isinstance doesn’t work, but I can suggest that you could use

inputs[0].GetPointData().HasArray("Z_VELOCITY") == 0

for the same purpose

Hello Cory,

That works perfectly fine for all Paraview versions. Thank you very much for your accurate and quick answer!

Best regards,

Miguel