Skip to content

Commit 5f2573f

Browse files
committed
Fix for bloackrock with numpy2
1 parent a43fff6 commit 5f2573f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

neo/rawio/blackrockrawio.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1357,7 +1357,7 @@ def __match_nsx_and_nev_segment_ids(self, nsx_nb):
13571357

13581358
# Show warning if spikes do not fit any segment (+- 1 sampling 'tick')
13591359
# Spike should belong to segment before
1360-
mask_outside = (ev_ids == i) & (data["timestamp"] < int(seg["timestamp"]) - nsx_offset - nsx_period)
1360+
mask_outside = (ev_ids == i) & (data["timestamp"] < int(seg["timestamp"]) - int(nsx_offset) - int(nsx_period))
13611361

13621362
if len(data[mask_outside]) > 0:
13631363
warnings.warn(f"Spikes outside any segment. Detected on segment #{i}")
@@ -1987,6 +1987,7 @@ def __get_nsx_param_variant_a(self, nsx_nb):
19871987
else:
19881988
units = "uV"
19891989

1990+
19901991
nsx_parameters = {
19911992
"nb_data_points": int(
19921993
(self.__get_file_size(filename) - bytes_in_headers)
@@ -1995,8 +1996,8 @@ def __get_nsx_param_variant_a(self, nsx_nb):
19951996
),
19961997
"labels": labels,
19971998
"units": np.array([units] * self.__nsx_basic_header[nsx_nb]["channel_count"]),
1998-
"min_analog_val": -1 * np.array(dig_factor),
1999-
"max_analog_val": np.array(dig_factor),
1999+
"min_analog_val": -1 * np.array(dig_factor, dtype="float"),
2000+
"max_analog_val": np.array(dig_factor, dtype="float"),
20002001
"min_digital_val": np.array([-1000] * self.__nsx_basic_header[nsx_nb]["channel_count"]),
20012002
"max_digital_val": np.array([1000] * self.__nsx_basic_header[nsx_nb]["channel_count"]),
20022003
"timestamp_resolution": 30000,

0 commit comments

Comments
 (0)