Skip to content

Commit

Permalink
Update hdf5.py
Browse files Browse the repository at this point in the history
The function _convert_scalar_item contained np.asscalar which was depreciated in NumPy v1.16:

`scalar_value = np.asscalar(np.asarray(item['value']))`

This line has been changed to 

`scalar_value = np.asarray(item['value']).item()`
  • Loading branch information
jacrossley authored Jun 17, 2024
1 parent a5392d4 commit 228da7e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion phconvert/hdf5.py
Original file line number Diff line number Diff line change
Expand Up @@ -791,7 +791,7 @@ def _convert_scalar_item(item):
if not np.isscalar(item['value']):
try:
# sequences are converted to array then to scalar
scalar_value = np.asscalar(np.asarray(item['value']))
scalar_value = np.asarray(item['value']).item()
except ValueError:
raise Invalid_PhotonHDF5('Cannot convert "%s" to scalar.'
% item['meta_path'])
Expand Down

0 comments on commit 228da7e

Please sign in to comment.