From 1e2735df93787664bda58273c009e6d85b824a59 Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Fri, 30 Oct 2020 23:20:05 -0500 Subject: [PATCH] Updating h5py calls in the plot test files. --- tests/regression_tests/plot/test.py | 8 ++++---- tests/regression_tests/plot_overlaps/test.py | 8 ++++---- tests/regression_tests/plot_voxel/test.py | 10 +++++----- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/tests/regression_tests/plot/test.py b/tests/regression_tests/plot/test.py index bfaef019c1..a6f7306a0e 100644 --- a/tests/regression_tests/plot/test.py +++ b/tests/regression_tests/plot/test.py @@ -42,10 +42,10 @@ class PlotTestHarness(TestHarness): # Add voxel data to results with h5py.File(fname, 'r') as fh: outstr += fh.attrs['filetype'] - outstr += fh.attrs['num_voxels'].tostring() - outstr += fh.attrs['lower_left'].tostring() - outstr += fh.attrs['voxel_width'].tostring() - outstr += fh['data'].value.tostring() + outstr += fh.attrs['num_voxels'].tobytes() + outstr += fh.attrs['lower_left'].tobytes() + outstr += fh.attrs['voxel_width'].tobytes() + outstr += fh['data'][()].tobytes() # Hash the information and return. sha512 = hashlib.sha512() diff --git a/tests/regression_tests/plot_overlaps/test.py b/tests/regression_tests/plot_overlaps/test.py index d8c0943cf5..62236081b3 100644 --- a/tests/regression_tests/plot_overlaps/test.py +++ b/tests/regression_tests/plot_overlaps/test.py @@ -42,10 +42,10 @@ class PlotTestHarness(TestHarness): # Add voxel data to results with h5py.File(fname, 'r') as fh: outstr += fh.attrs['filetype'] - outstr += fh.attrs['num_voxels'].tostring() - outstr += fh.attrs['lower_left'].tostring() - outstr += fh.attrs['voxel_width'].tostring() - outstr += fh['data'].value.tostring() + outstr += fh.attrs['num_voxels'].tobytes() + outstr += fh.attrs['lower_left'].tobytes() + outstr += fh.attrs['voxel_width'].tobytes() + outstr += fh['data'][()].tobytes() # Hash the information and return. sha512 = hashlib.sha512() diff --git a/tests/regression_tests/plot_voxel/test.py b/tests/regression_tests/plot_voxel/test.py index d2767e2f18..3b7a6bef28 100644 --- a/tests/regression_tests/plot_voxel/test.py +++ b/tests/regression_tests/plot_voxel/test.py @@ -23,7 +23,7 @@ class PlotVoxelTestHarness(TestHarness): check_call(['../../../scripts/openmc-voxel-to-vtk'] + glob.glob('plot_4.h5')) - + def _test_output_created(self): """Make sure *.ppm has been created.""" for fname in self._plot_names: @@ -44,10 +44,10 @@ class PlotVoxelTestHarness(TestHarness): # Add voxel data to results with h5py.File(fname, 'r') as fh: outstr += fh.attrs['filetype'] - outstr += fh.attrs['num_voxels'].tostring() - outstr += fh.attrs['lower_left'].tostring() - outstr += fh.attrs['voxel_width'].tostring() - outstr += fh['data'].value.tostring() + outstr += fh.attrs['num_voxels'].tobytes() + outstr += fh.attrs['lower_left'].tobytes() + outstr += fh.attrs['voxel_width'].tobytes() + outstr += fh['data'][()].tobytes() # Hash the information and return. sha512 = hashlib.sha512()