Skip to content

Commit

Permalink
Use atts to gather type instead of group
Browse files Browse the repository at this point in the history
  • Loading branch information
pshriwise committed Dec 13, 2024
1 parent d320b12 commit ef7a644
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions openmc/mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,7 @@ def from_hdf5(cls, group: h5py.Group):
Instance of a MeshBase subclass
"""

mesh_type = 'regular' if 'type' not in group else group['type'][()].decode()

mesh_type = 'regular' if 'type' not in group.attrs else group.attrs['type'].decode()
mesh_id = int(group.name.split('/')[-1].lstrip('mesh '))
mesh_name = '' if not 'name' in group else group['name'][()].decode()

Expand Down

0 comments on commit ef7a644

Please sign in to comment.