mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-26 13:15:39 -04:00
Merge pull request #1712 from pshriwise/h5py_update
Update Dataset.value calls for h5py v3.0
This commit is contained in:
commit
e11364257c
4 changed files with 14 additions and 14 deletions
|
|
@ -46,7 +46,7 @@ def main():
|
|||
n_coords = track.attrs['n_coords']
|
||||
coords = []
|
||||
for i in range(n_particles):
|
||||
coords.append(track['coordinates_' + str(i + 1)].value)
|
||||
coords.append(track['coordinates_' + str(i + 1)][()])
|
||||
for j in range(n_coords[i]):
|
||||
points.InsertNextPoint(coords[i][j,:])
|
||||
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue