Skip to content

Commit

Permalink
Fix string decoding issue when readin mmat_irrep
Browse files Browse the repository at this point in the history
  • Loading branch information
yachmena committed Sep 13, 2023
1 parent 03b67ea commit edb7a12
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions richmol/field.py
Original file line number Diff line number Diff line change
Expand Up @@ -1793,8 +1793,12 @@ def read(self, filename, name=None, thresh=None, **kwargs):
nind = group_sym.attrs['mmat_nind']
nptr = group_sym.attrs['mmat_nptr']
shape = group_sym.attrs['mmat_shape']
irrep_cart = [(int(el1), el2.decode('utf-8'))
for (el1, el2) in group_sym.attrs['mmat_irrep_cart']]
try:
irrep_cart = [(int(el1), el2.decode('utf-8'))
for (el1, el2) in group_sym.attrs['mmat_irrep_cart']]
except AttributeError:
irrep_cart = [(int(el1), el2)
for (el1, el2) in group_sym.attrs['mmat_irrep_cart']]
data = np.split(
group_sym['mmat_data'], np.cumsum(nnz)
)[:-1]
Expand Down

0 comments on commit edb7a12

Please sign in to comment.