Skip to content

Commit

Permalink
Fix int overflow bug due to older numpy version
Browse files Browse the repository at this point in the history
  • Loading branch information
lauraporta committed Jul 25, 2024
1 parent cb98655 commit 58678cc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion derotation/load_data/custom_data_loaders.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 58678cc

Please sign in to comment.