From 228da7e9ba90a74523e3867f68e4d0aa8973bbff Mon Sep 17 00:00:00 2001 From: jacrossley <40207794+jacrossley@users.noreply.github.com> Date: Mon, 17 Jun 2024 16:00:37 +0100 Subject: [PATCH] Update hdf5.py 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()` --- phconvert/hdf5.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phconvert/hdf5.py b/phconvert/hdf5.py index 32d638f..502010d 100644 --- a/phconvert/hdf5.py +++ b/phconvert/hdf5.py @@ -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'])