Skip to content

Commit

Permalink
Fix for bloackrock with numpy2
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelgarcia committed Jan 15, 2025
1 parent a43fff6 commit 5f2573f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions neo/rawio/blackrockrawio.py
Original file line number Diff line number Diff line change
Expand Up @@ -1357,7 +1357,7 @@ def __match_nsx_and_nev_segment_ids(self, nsx_nb):

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

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


nsx_parameters = {
"nb_data_points": int(
(self.__get_file_size(filename) - bytes_in_headers)
Expand All @@ -1995,8 +1996,8 @@ def __get_nsx_param_variant_a(self, nsx_nb):
),
"labels": labels,
"units": np.array([units] * self.__nsx_basic_header[nsx_nb]["channel_count"]),
"min_analog_val": -1 * np.array(dig_factor),
"max_analog_val": np.array(dig_factor),
"min_analog_val": -1 * np.array(dig_factor, dtype="float"),
"max_analog_val": np.array(dig_factor, dtype="float"),
"min_digital_val": np.array([-1000] * self.__nsx_basic_header[nsx_nb]["channel_count"]),
"max_digital_val": np.array([1000] * self.__nsx_basic_header[nsx_nb]["channel_count"]),
"timestamp_resolution": 30000,
Expand Down

0 comments on commit 5f2573f

Please sign in to comment.