Show( ) compatibility issue between ParaView 5.8 and 5.6

Hi, I’m using ParaView 5.8.0 and 5.6.2 on Windows 10. I am making Python scripts to run on the ParaView Python Shell (which I want to be able to run with both versions 5.8 and 5.6) and I ran into an issue with compatibility of the Show( ) function between versions.

The issue is with the number of input arguments to Show( ). I was originally running the scripts on 5.8 and Show( ) had three arguments; here is an example of a line in a script I was running:

surfaceVectors1Display = Show(surfaceVectors1, renderView1, 'UnstructuredGridRepresentation')

When running the script in version 5.6.2, I got an error saying that there shouldn’t be more than two input arguments. So, I removed the ‘UnstructuredGridRepresentation’ argument and it ran fine without errors in both version 5.6 and 5.8. My question is: is it safe to remove that third argument? The decision to remove it was fairly arbitrary and was only because version 5.6 could not handle 3 arguments. There was seemingly no difference in the results of the script when I removed the third argument so does it actually have any importance? Why does this argument work in version 5.8 but not 5.6?

Yes, it is safe. That argument was added in 5.8 and is not supported by earlier versions. Python scripts are not intended to be forward-compatible i.e. a script generated using ParaView 5.8 is not intended to work with older versions. Although sometimes the changes needed are manageable - as is the case here.

Thank you for your response; I’ll keep this detail in mind from now on when using Python with ParaView.