Skip to content

Commit

Permalink
DOFArray: support untaggable arrays in setstate
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiasdiener committed Aug 11, 2023
1 parent 6e8a963 commit b55dc72
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion meshmode/dof_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,12 @@ def __setstate__(self, state):
assert len(axes_tags[idx]) == ary.ndim
assert isinstance(axes_tags[idx], list)

d = actx.from_numpy(ary)._with_new_tags(tags[idx])
try:
d = actx.from_numpy(ary)._with_new_tags(tags[idx])
except AttributeError:
# 'actx.from_numpy' might return an array that does not have
# '_with_new_tags' (e.g., np.ndarray).
d = actx.from_numpy(ary)

for ida, ax in enumerate(axes_tags[idx]):
d = actx.tag_axis(ida, ax, d)
Expand Down

0 comments on commit b55dc72

Please sign in to comment.