diff --git a/Wrapping/Python/paraview/benchmark/manyspheres.py b/Wrapping/Python/paraview/benchmark/manyspheres.py index a5c4450e1a7df80637d827337f10ae051e1975fa..d7e29fab358c4613ac9e2e17572604da3e318df1 100644 --- a/Wrapping/Python/paraview/benchmark/manyspheres.py +++ b/Wrapping/Python/paraview/benchmark/manyspheres.py @@ -74,7 +74,7 @@ def memtime_stamp(): m = logbase.get_memuse() n1 = dt.datetime.now() et = n1 - n0 - print (et, m) + print(et, m) n0 = n1 records.append([et, m]) @@ -92,7 +92,7 @@ def run(output_basename='log', num_spheres=8, num_spheres_in_scene=None, if OSPRay: view.EnableOSPRay = 1 - print 'Generating bounding box' + print('Generating bounding box') import math edge = math.ceil(math.pow(num_spheres_in_scene, (1.0 / 3.0))) box = Box() @@ -103,7 +103,7 @@ def run(output_basename='log', num_spheres=8, num_spheres_in_scene=None, boxDisplay = Show() boxDisplay.SetRepresentationType('Outline') - print 'Generating all spheres' + print('Generating all spheres') gen = ProgrammableSource(Script=''' import math import vtk @@ -143,7 +143,7 @@ ss.SetPhiResolution(res) ss.SetThetaResolution(res) ap = vtk.vtkAppendPolyData() -print ' source %d: generating %d spheres from %d to %d' % (p, end-start, start, end) +print(' source %d: generating %d spheres from %d to %d' % (p, end-start, start, end)) for x in range(start,end): i = x%edge j = math.floor((x / edge))%edge @@ -171,24 +171,24 @@ self.GetOutput().ShallowCopy(ap.GetOutput()) genDisplay.SetRepresentationType('Surface') if color: - print 'Assigning colors' + print('Assigning colors') pidScale = ProcessIdScalars() pidScaleDisplay = Show() - print 'Repositioning initial camera' + print('Repositioning initial camera') c = GetActiveCamera() c.Azimuth(22.5) c.Elevation(22.5) - print 'Rendering first frame' + print('Rendering first frame') Render() - print 'Saving frame 0 screenshot' + print('Saving frame 0 screenshot') fdigits = int(math.ceil(math.log(num_frames, 10))) frame_fname_fmt = output_basename + '.scene.f%(f)0' + str(fdigits) + 'd.tiff' SaveScreenshot(frame_fname_fmt % {'f': 0}) - print 'Gathering geometry counts' + print('Gathering geometry counts') vtk.vtkTimerLog.MarkStartEvent('GetViewItemStats') num_polys = 0 num_points = 0 @@ -197,7 +197,7 @@ self.GetOutput().ShallowCopy(ap.GetOutput()) num_points += r.GetRepresentedDataInformation().GetNumberOfPoints() vtk.vtkTimerLog.MarkEndEvent('GetViewItemStats') - print 'Beginning benchmark loop' + print('Beginning benchmark loop') deltaAz = 45.0 / num_frames deltaEl = 45.0 / num_frames memtime_stamp() @@ -230,7 +230,7 @@ self.GetOutput().ShallowCopy(ap.GetOutput()) logparser.summarize_results(num_frames, (fpsT1-fpsT0).total_seconds(), num_polys, 'Polys', save_logs, output_basename) - print 'Points / Frame: %(np)d' % {'np': num_points} + print('Points / Frame:', num_points) def main(argv): diff --git a/Wrapping/Python/paraview/benchmark/waveletcontour.py b/Wrapping/Python/paraview/benchmark/waveletcontour.py index 0d7436d0c43996b660342518ac0d4444752f134c..d11c292aa56d0789e792ddc7008c51deb238d07a 100644 --- a/Wrapping/Python/paraview/benchmark/waveletcontour.py +++ b/Wrapping/Python/paraview/benchmark/waveletcontour.py @@ -74,7 +74,7 @@ def memtime_stamp(): m = logbase.get_memuse() n1 = dt.datetime.now() et = n1 - n0 - print (et, m) + print(et, m) n0 = n1 records.append([et, m]) @@ -89,7 +89,7 @@ def run(output_basename='log', dimension=100, view_size=(1920, 1080), if OSPRay: view.EnableOSPRay = 1 - print 'Generating wavelet' + print('Generating wavelet') wavelet = Wavelet() d2 = dimension/2 wavelet.WholeExtent = [-d2, d2, -d2, d2, -d2, d2] @@ -97,7 +97,7 @@ def run(output_basename='log', dimension=100, view_size=(1920, 1080), waveletDisplay = Show() waveletDisplay.SetRepresentationType('Outline') - print 'Calculating 10 isocontours' + print('Calculating 10 isocontours') contour = Contour(Input=wavelet) contour.ContourBy = ['POINTS', 'RTData'] contour.PointMergeMethod = 'Uniform Binning' @@ -110,21 +110,21 @@ def run(output_basename='log', dimension=100, view_size=(1920, 1080), ColorBy(contourDisplay, ('POINTS', 'RTData')) contourDisplay.RescaleTransferFunctionToDataRange(True, False) - print 'Repositioning initial camera' + print('Repositioning initial camera') c = GetActiveCamera() c.Azimuth(22.5) c.Elevation(22.5) - print 'Rendering first frame' + print('Rendering first frame') Render() - print 'Saving frame 0 screenshot' + print('Saving frame 0 screenshot') import math fdigits = int(math.ceil(math.log(num_frames, 10))) frame_fname_fmt = output_basename + '.scene.f%(f)0' + str(fdigits) + 'd.tiff' SaveScreenshot(frame_fname_fmt % {'f': 0}) - print 'Gathering geometry counts' + print('Gathering geometry counts') vtk.vtkTimerLog.MarkStartEvent('GetViewItemStats') num_polys = 0 num_points = 0 @@ -133,7 +133,7 @@ def run(output_basename='log', dimension=100, view_size=(1920, 1080), num_points += r.GetRepresentedDataInformation().GetNumberOfPoints() vtk.vtkTimerLog.MarkEndEvent('GetViewItemStats') - print 'Beginning benchmark loop' + print('Beginning benchmark loop') deltaAz = 45.0 / num_frames deltaEl = 45.0 / num_frames memtime_stamp() @@ -165,7 +165,7 @@ def run(output_basename='log', dimension=100, view_size=(1920, 1080), logparser.summarize_results(num_frames, (fpsT1-fpsT0).total_seconds(), num_polys, 'Polys', save_logs, output_basename) - print 'Points / Frame: %(np)d' % {'np': num_points} + print('Points / Frame:', num_points) def main(argv): diff --git a/Wrapping/Python/paraview/benchmark/waveletvolume.py b/Wrapping/Python/paraview/benchmark/waveletvolume.py index a90e60ee6ea6c9d6ea02b6c5329cd5dc82f75a2b..79f2e788ba63bda8a56abb206de3294e048c7c6b 100644 --- a/Wrapping/Python/paraview/benchmark/waveletvolume.py +++ b/Wrapping/Python/paraview/benchmark/waveletvolume.py @@ -74,7 +74,7 @@ def memtime_stamp(): m = logbase.get_memuse() n1 = dt.datetime.now() et = n1 - n0 - print (et, m) + print(et, m) n0 = n1 records.append([et, m]) @@ -89,7 +89,7 @@ def run(output_basename='log', dimension=100, view_size=(1920, 1080), if OSPRay: view.EnableOSPRay = 1 - print 'Generating wavelet' + print('Generating wavelet') wavelet = Wavelet() d2 = dimension/2 wavelet.WholeExtent = [-d2, d2, -d2, d2, -d2, d2] @@ -97,28 +97,28 @@ def run(output_basename='log', dimension=100, view_size=(1920, 1080), waveletDisplay = Show() waveletDisplay.SetRepresentationType('Volume') - print 'Repositioning initial camera' + print('Repositioning initial camera') c = GetActiveCamera() c.Azimuth(22.5) c.Elevation(22.5) - print 'Rendering first frame' + print('Rendering first frame') Render() - print 'Saving frame 0 screenshot' + print('Saving frame 0 screenshot') import math fdigits = int(math.ceil(math.log(num_frames, 10))) frame_fname_fmt = output_basename + '.scene.f%(f)0' + str(fdigits) + 'd.tiff' SaveScreenshot(frame_fname_fmt % {'f': 0}) - print 'Gathering geometry counts' + print('Gathering geometry counts') vtk.vtkTimerLog.MarkStartEvent('GetViewItemStats') num_voxels = 0 for r in view.Representations: num_voxels += r.GetRepresentedDataInformation().GetNumberOfCells() vtk.vtkTimerLog.MarkEndEvent('GetViewItemStats') - print 'Beginning benchmark loop' + print('Beginning benchmark loop') deltaAz = 45.0 / num_frames deltaEl = 45.0 / num_frames memtime_stamp()