From 58678cce48d7cdeaa56e275014e08b1974e0b60c Mon Sep 17 00:00:00 2001 From: lauraporta <29216006+lauraporta@users.noreply.github.com> Date: Thu, 25 Jul 2024 16:33:25 +0100 Subject: [PATCH] Fix int overflow bug due to older numpy version --- derotation/load_data/custom_data_loaders.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/derotation/load_data/custom_data_loaders.py b/derotation/load_data/custom_data_loaders.py index 66ff6e9..e9e81b3 100644 --- a/derotation/load_data/custom_data_loaders.py +++ b/derotation/load_data/custom_data_loaders.py @@ -67,7 +67,8 @@ def get_analog_signals(path_to_aux: str, channel_names: list) -> tuple: _description_ """ - data = np.fromfile(path_to_aux, dtype=np.int16) + data = np.fromfile(path_to_aux, dtype=np.int16) # Has to be read as int16 + data = data.astype(np.int32) # cast data to int32 to avoid overflow data = data.reshape((-1, len(channel_names))) data = convert_to_volts(data)