Skip to content

Commit

Permalink
Reduce conversions between lists and arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelbray32 committed Oct 2, 2023
1 parent df2ed88 commit 6e000d1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/spikegadgets_to_nwb/convert_ephys.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def _get_data(self, selection: Tuple[slice]) -> np.ndarray:
# find the stream where this piece of slice begins
io_stream = np.argmin(i >= file_start_ind) - 1
# get the data from that stream
data.extend(
data.append(
(
self.neo_io[io_stream].get_analogsignal_chunk(
block_index=self.block_index,
Expand All @@ -170,7 +170,7 @@ def _get_data(self, selection: Tuple[slice]) -> np.ndarray:
time_index[-1] - i, # if finished in this stream
)

data = (np.array(data) * self.conversion).astype("int16")
data = (np.concatenate(data) * self.conversion).astype("int16")
return data

def _get_maxshape(self) -> Tuple[int, int]:
Expand Down

0 comments on commit 6e000d1

Please sign in to comment.