Updating h5py calls in the plot test files.

This commit is contained in:
Patrick Shriwise 2020-10-30 23:20:05 -05:00
parent 5b81083742
commit 1e2735df93
3 changed files with 13 additions and 13 deletions

View file

@ -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()

View file

@ -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()

View file

@ -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()