From 4119ea810f54106959048584c28728214e3e656d Mon Sep 17 00:00:00 2001 From: utkarshp1161 Date: Wed, 21 May 2025 16:26:57 -0400 Subject: [PATCH] fix: was removed from the ndarray class in NumPy 2.0. Use np.ptp(arr, ...) instead. --- atomai/utils/preproc.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/atomai/utils/preproc.py b/atomai/utils/preproc.py index 85782cd..f9212ee 100644 --- a/atomai/utils/preproc.py +++ b/atomai/utils/preproc.py @@ -757,7 +757,7 @@ def torch_format_image(image_data: np.ndarray, else: pass if norm: - image_data = (image_data - image_data.min()) / image_data.ptp() + image_data = (image_data - image_data.min()) / np.ptp(image_data)#image_data.ptp() image_data = torch.from_numpy(image_data).float() return image_data @@ -786,7 +786,7 @@ def torch_format_spectra(spectra: np.ndarray, else: pass if norm: - spectra = (spectra - spectra.min()) / spectra.ptp() + spectra = (spectra - spectra.min()) / np.ptp(spectra)#spectra.ptp() spectra = torch.from_numpy(spectra).float() return spectra