Skip to content

Commit ade13db

Browse files
committed
Merge branch 'master' into fix_edf_handle
2 parents 1e3c6bc + de6b3b5 commit ade13db

23 files changed

+81
-33
lines changed

neo/io/igorproio.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ def _wave_to_analogsignal(self, content, dirpath):
142142
_time_unit_structure = header["dimUnits"].ravel()
143143
# For the files we've seen so far, the first element of _time_unit_structure contains the units.
144144
# If someone has a file for which this assumption does not hold an Exception will be raised.
145-
if not all([element == b'' for element in _time_unit_structure[1:]]):
145+
if not all([element == b"" for element in _time_unit_structure[1:]]):
146146
raise Exception(
147147
"Neo cannot yet handle the units in this file. "
148148
"Please create a new issue in the Neo issue tracker at "

neo/rawio/axographrawio.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -814,7 +814,17 @@ def _scan_axograph_file(self):
814814
# channel_info will be cast to _signal_channel_dtype
815815
buffer_id = ""
816816
stream_id = "0"
817-
channel_info = (name, str(i), 1 / sampling_period, f.byte_order + dtype, units, gain, offset, stream_id, buffer_id)
817+
channel_info = (
818+
name,
819+
str(i),
820+
1 / sampling_period,
821+
f.byte_order + dtype,
822+
units,
823+
gain,
824+
offset,
825+
stream_id,
826+
buffer_id,
827+
)
818828

819829
self.logger.debug("channel_info: {channel_info}")
820830
self.logger.debug("")

neo/rawio/axonrawio.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,9 @@ def _parse_header(self):
229229
gain, offset = 1.0, 0.0
230230
stream_id = "0"
231231
buffer_id = "0"
232-
signal_channels.append((name, str(chan_id), self._sampling_rate, sig_dtype, units, gain, offset, stream_id, buffer_id))
232+
signal_channels.append(
233+
(name, str(chan_id), self._sampling_rate, sig_dtype, units, gain, offset, stream_id, buffer_id)
234+
)
233235

234236
signal_channels = np.array(signal_channels, dtype=_signal_channel_dtype)
235237

neo/rawio/baserawio.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,10 @@
9494
_signal_stream_dtype = [
9595
("name", "U64"), # not necessarily unique
9696
("id", "U64"), # must be unique
97-
("buffer_id", "U64"), # should be "" (empty string) when the stream is not nested under a buffer or the buffer is undefined for some reason.
97+
(
98+
"buffer_id",
99+
"U64",
100+
), # should be "" (empty string) when the stream is not nested under a buffer or the buffer is undefined for some reason.
98101
]
99102

100103
_signal_channel_dtype = [

neo/rawio/brainvisionrawio.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,9 @@ def _parse_header(self):
118118
offset = 0
119119
stream_id = "0"
120120
buffer_id = "0"
121-
sig_channels.append((name, chan_id, self._sampling_rate, sig_dtype, units, gain, offset, stream_id, buffer_id))
121+
sig_channels.append(
122+
(name, chan_id, self._sampling_rate, sig_dtype, units, gain, offset, stream_id, buffer_id)
123+
)
122124
sig_channels = np.array(sig_channels, dtype=_signal_channel_dtype)
123125

124126
# No spikes

neo/rawio/elanrawio.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,6 @@ def _parse_header(self):
158158
# unique buffer and stream
159159
signal_buffers = np.array([("Signals", "0")], dtype=_signal_buffer_dtype)
160160
signal_streams = np.array([("Signals", "0", "0")], dtype=_signal_stream_dtype)
161-
162161

163162
sig_channels = []
164163
for c, chan_info in enumerate(channel_infos[:-2]):
@@ -172,7 +171,17 @@ def _parse_header(self):
172171
stream_id = "0"
173172
buffer_id = "0"
174173
sig_channels.append(
175-
(chan_name, chan_id, self._sampling_rate, sig_dtype, chan_info["units"], gain, offset, stream_id, buffer_id)
174+
(
175+
chan_name,
176+
chan_id,
177+
self._sampling_rate,
178+
sig_dtype,
179+
chan_info["units"],
180+
gain,
181+
offset,
182+
stream_id,
183+
buffer_id,
184+
)
176185
)
177186

178187
sig_channels = np.array(sig_channels, dtype=_signal_channel_dtype)

neo/rawio/intanrawio.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,6 @@ def _parse_header(self):
242242

243243
stream_ids = np.unique(signal_channels["stream_id"])
244244
signal_streams = np.zeros(stream_ids.size, dtype=_signal_stream_dtype)
245-
246245

247246
# we need to sort the data because the string of stream_index 10 is mis-sorted.
248247
buffer_ids = []

neo/rawio/maxwellrawio.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,13 +111,12 @@ def _parse_header(self):
111111
raise NotImplementedError(f"This version {version} is not supported")
112112

113113
signal_streams = np.array(signal_streams, dtype=_signal_stream_dtype)
114-
114+
115115
# one stream per buffer
116116
signal_buffers = np.zeros(signal_streams.size, dtype=_signal_buffer_dtype)
117117
signal_buffers["id"] = signal_streams["id"]
118118
signal_buffers["name"] = signal_streams["name"]
119119

120-
121120
# create signal channels
122121
max_sig_length = 0
123122
self._signals = {}
@@ -160,7 +159,6 @@ def _parse_header(self):
160159
warnings.warn(f"No 'routed' group found for well {stream_id}")
161160
well_indices_to_remove.append(stream_index)
162161
continue
163-
164162

165163
channel_ids = np.array(mapping["channel"])
166164
electrode_ids = np.array(mapping["electrode"])
@@ -173,7 +171,9 @@ def _parse_header(self):
173171
ch_name = f"ch{chan_id} elec{elec_id}"
174172
offset_uV = 0
175173
buffer_id = stream_id
176-
sig_channels.append((ch_name, str(chan_id), sr, "uint16", "uV", gain_uV, offset_uV, stream_id, buffer_id))
174+
sig_channels.append(
175+
(ch_name, str(chan_id), sr, "uint16", "uV", gain_uV, offset_uV, stream_id, buffer_id)
176+
)
177177

178178
self._signals[stream_id] = sigs
179179
max_sig_length = max(max_sig_length, sigs.shape[1])

neo/rawio/micromedrawio.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,9 @@ def _parse_header(self):
130130
chan_id = str(c)
131131
stream_id = "0"
132132
buffer_id = "0"
133-
signal_channels.append((chan_name, chan_id, sampling_rate, sig_dtype, units, gain, offset, stream_id, buffer_id))
133+
signal_channels.append(
134+
(chan_name, chan_id, sampling_rate, sig_dtype, units, gain, offset, stream_id, buffer_id)
135+
)
134136

135137
signal_channels = np.array(signal_channels, dtype=_signal_channel_dtype)
136138

neo/rawio/neuralynxrawio/neuralynxrawio.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,17 @@ def _parse_header(self):
279279
gain *= -1
280280
offset = 0.0
281281
signal_channels.append(
282-
(chan_name, str(chan_id), info["sampling_rate"], "int16", units, gain, offset, stream_id, buffer_id)
282+
(
283+
chan_name,
284+
str(chan_id),
285+
info["sampling_rate"],
286+
"int16",
287+
units,
288+
gain,
289+
offset,
290+
stream_id,
291+
buffer_id,
292+
)
283293
)
284294
self.ncs_filenames[chan_uid] = filename
285295
keys = [

0 commit comments

Comments
 (0)