Skip to content

Commit 5c403b5

Browse files
authored
Merge pull request eth-cscs#185 from eth-cscs/jfavre-patch-1
Update ParaView test coloredSphere.py
2 parents a044288 + b96d5fd commit 5c403b5

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

checks/apps/paraview/src/coloredSphere.py

+17-6
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@
1111
if basename is None:
1212
basename = "/tmp"
1313

14-
Version = (str(servermanager.vtkSMProxyManager.GetVersionMajor()) + "." +
15-
str(servermanager.vtkSMProxyManager.GetVersionMinor()))
14+
Version = (servermanager.vtkSMProxyManager.GetVersionMajor(),
15+
servermanager.vtkSMProxyManager.GetVersionMinor(),
16+
servermanager.vtkSMProxyManager.GetVersionPatch())
1617

1718
info = vtkPVOpenGLInformation()
1819
info.CopyFromObject(None)
@@ -49,11 +50,20 @@
4950
sphere.ThetaResolution = 1024
5051
sphere.PhiResolution = 1024
5152

52-
pidscal = ProcessIdScalars(sphere)
53+
if Version <= (5, 11, 2):
54+
pidscal = ProcessIdScalars(sphere)
55+
else:
56+
pidscal = GenerateProcessIds(Input=sphere)
5357

5458
rep = Show(pidscal, view)
55-
ColorBy(rep, 'ProcessId')
56-
processIdLUT = GetColorTransferFunction('ProcessId')
59+
60+
if Version <= (5, 11, 2):
61+
ColorBy(rep, 'ProcessId')
62+
processIdLUT = GetColorTransferFunction('ProcessId')
63+
else:
64+
ColorBy(rep, ('POINTS', 'PointProcessIds'))
65+
processIdLUT = GetColorTransferFunction('PointProcessIds')
66+
5767
processIdLUT.AnnotationsInitialized = 1
5868
processIdLUT.InterpretValuesAsCategories = 1
5969

@@ -95,6 +105,7 @@
95105
view.ViewSize = [1024, 1024]
96106

97107
# change the pathname to a place where you have write access
98-
filename = basename + "/coloredSphere_v" + Version + "." + Vendor + ".png"
108+
SourceVersion = servermanager.vtkSMProxyManager.GetParaViewSourceVersion()
109+
filename = basename + "/coloredSphere_v" + SourceVersion.split()[-1] + "." + Vendor + ".png"
99110
SaveScreenshot(filename=filename, view=view)
100111
print("writing ", filename)

0 commit comments

Comments
 (0)