Skip to content

Commit

Permalink
fix np.str deprecation in averages.py
Browse files Browse the repository at this point in the history
  • Loading branch information
tgastine committed Sep 3, 2024
1 parent 0663851 commit a0d3d28
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion python/magic/averages.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def to_json(o, level=0):
ret += "[" + ','.join(map(str, o.flatten().tolist())) + "]"
elif isinstance(o, np.ndarray) and np.issubdtype(o.dtype, np.bool_):
ret += "[" + ','.join(map(lambda x: '"{}"'.format(x), o.flatten().tolist())) + "]"
elif isinstance(o, np.ndarray) and np.issubdtype(o.dtype, np.str):
elif isinstance(o, np.ndarray) and np.issubdtype(o.dtype, np.str_):
ret += "[" + ','.join(map(lambda x: '"{}"'.format(x), o.flatten().tolist())) + "]"
elif isinstance(o, np.ndarray) and np.issubdtype(o.dtype, np.inexact):
ret += "[" + ','.join(map(lambda x: '{:.8e}'.format(x), o.flatten().tolist())) + "]"
Expand Down

0 comments on commit a0d3d28

Please sign in to comment.