Skip to content

Commit

Permalink
fix recursive_copy() producing empty HDF5 file
Browse files Browse the repository at this point in the history
  • Loading branch information
kerberizer committed Sep 13, 2024
1 parent 6f5312a commit bcac5b4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/rcapi/services/convertor_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,11 @@ def recursive_copy(src_group : h5py.Group, dst_group : h5py.Group,level=0):
for index,key in enumerate(src_group):
try:
item = src_group[key]
if isinstance(item, h5py.Group):
if isinstance(item, h5pyd.Group):
# Create the group in the destination file
new_group = dst_group.create_group(key)
recursive_copy(item, new_group,level+1)
elif isinstance(item, h5py.Dataset):
elif isinstance(item, h5pyd.Dataset):
if item.shape == (): # Scalar dataset
# Copy the scalar value directly
dst_dataset = dst_group.create_dataset(key, data=item[()])
Expand Down

0 comments on commit bcac5b4

Please sign in to comment.