From bdfba76e535339ec46d53c2de3d4d60611c2a709 Mon Sep 17 00:00:00 2001 From: jfavre Date: Mon, 15 Apr 2024 16:21:41 +0200 Subject: [PATCH 1/2] Update ParaView test coloredSphere.py Proxy (filters, ProcessIdScalars) has been deprecated in ParaView 5.12 and will be removed by ParaView 5.14. --- checks/apps/paraview/src/coloredSphere.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/checks/apps/paraview/src/coloredSphere.py b/checks/apps/paraview/src/coloredSphere.py index b04003032..5fc1f3687 100644 --- a/checks/apps/paraview/src/coloredSphere.py +++ b/checks/apps/paraview/src/coloredSphere.py @@ -49,11 +49,20 @@ sphere.ThetaResolution = 1024 sphere.PhiResolution = 1024 -pidscal = ProcessIdScalars(sphere) +if Version == '5.12.0': + pidscal = GenerateProcessIds(Input=sphere) +else: + pidscal = ProcessIdScalars(sphere) rep = Show(pidscal, view) -ColorBy(rep, 'ProcessId') -processIdLUT = GetColorTransferFunction('ProcessId') + +if Version == '5.12.0': + ColorBy(rep, ('POINTS', 'PointProcessIds')) + processIdLUT = GetColorTransferFunction('PointProcessIds') +else: + ColorBy(rep, 'ProcessId') + processIdLUT = GetColorTransferFunction('ProcessId') + processIdLUT.AnnotationsInitialized = 1 processIdLUT.InterpretValuesAsCategories = 1 From 291c2847088747917670013e46094a84186ecd0f Mon Sep 17 00:00:00 2001 From: jfavre Date: Mon, 15 Apr 2024 17:33:15 +0200 Subject: [PATCH 2/2] Update coloredSphere.py use integer tuple comparison --- checks/apps/paraview/src/coloredSphere.py | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/checks/apps/paraview/src/coloredSphere.py b/checks/apps/paraview/src/coloredSphere.py index 5fc1f3687..008df54dc 100644 --- a/checks/apps/paraview/src/coloredSphere.py +++ b/checks/apps/paraview/src/coloredSphere.py @@ -11,8 +11,9 @@ if basename is None: basename = "/tmp" -Version = (str(servermanager.vtkSMProxyManager.GetVersionMajor()) + "." + - str(servermanager.vtkSMProxyManager.GetVersionMinor())) +Version = (servermanager.vtkSMProxyManager.GetVersionMajor(), + servermanager.vtkSMProxyManager.GetVersionMinor(), + servermanager.vtkSMProxyManager.GetVersionPatch()) info = vtkPVOpenGLInformation() info.CopyFromObject(None) @@ -49,19 +50,19 @@ sphere.ThetaResolution = 1024 sphere.PhiResolution = 1024 -if Version == '5.12.0': - pidscal = GenerateProcessIds(Input=sphere) -else: +if Version <= (5, 11, 2): pidscal = ProcessIdScalars(sphere) +else: + pidscal = GenerateProcessIds(Input=sphere) rep = Show(pidscal, view) -if Version == '5.12.0': - ColorBy(rep, ('POINTS', 'PointProcessIds')) - processIdLUT = GetColorTransferFunction('PointProcessIds') -else: +if Version <= (5, 11, 2): ColorBy(rep, 'ProcessId') processIdLUT = GetColorTransferFunction('ProcessId') +else: + ColorBy(rep, ('POINTS', 'PointProcessIds')) + processIdLUT = GetColorTransferFunction('PointProcessIds') processIdLUT.AnnotationsInitialized = 1 processIdLUT.InterpretValuesAsCategories = 1 @@ -104,6 +105,7 @@ view.ViewSize = [1024, 1024] # change the pathname to a place where you have write access -filename = basename + "/coloredSphere_v" + Version + "." + Vendor + ".png" +SourceVersion = servermanager.vtkSMProxyManager.GetParaViewSourceVersion() +filename = basename + "/coloredSphere_v" + SourceVersion.split()[-1] + "." + Vendor + ".png" SaveScreenshot(filename=filename, view=view) print("writing ", filename)