Skip to content

Commit

Permalink
flake and bump version number
Browse files Browse the repository at this point in the history
  • Loading branch information
oliche committed Mar 19, 2024
1 parent 667bb21 commit c40c613
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 19 deletions.
2 changes: 2 additions & 0 deletions release_notes.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# 0.10.0
## 0.10.1 2024-03-19
- ensure compatibility with spikeglx 202309 metadata coordinates
## 0.10.0 2024-03-14
- add support for online spikeglx reader

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

setuptools.setup(
name="ibl-neuropixel",
version="0.10.0",
version="0.10.1",
author="The International Brain Laboratory",
description="Collection of tools for Neuropixel 1.0 and 2.0 probes data",
long_description=long_description,
Expand Down
14 changes: 6 additions & 8 deletions src/ibldsp/cadzow.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,17 +135,15 @@ def cadzow_np1(
WAV = scipy.fft.rfft(wav[:, :])
padgain = scipy.signal.windows.hann(npad * 2)[:npad]
WAV = np.r_[
np.flipud(WAV[1 : npad + 1, :]) * padgain[:, np.newaxis],
np.flipud(WAV[1: npad + 1, :]) * padgain[:, np.newaxis],
WAV,
np.flipud(WAV[-npad - 2 : -1, :]) * np.flipud(np.r_[padgain, 1])[:, np.newaxis],
np.flipud(WAV[-npad - 2: -1, :]) * np.flipud(np.r_[padgain, 1])[:, np.newaxis],
] # apply padding
x = np.r_[
np.flipud(h["x"][1 : npad + 1]), h["x"], np.flipud(h["x"][-npad - 2 : -1])
]
x = np.r_[np.flipud(h["x"][1: npad + 1]), h["x"], np.flipud(h["x"][-npad - 2: -1])]
y = np.r_[
np.flipud(h["y"][1 : npad + 1]) - 120,
np.flipud(h["y"][1: npad + 1]) - 120,
h["y"],
np.flipud(h["y"][-npad - 2 : -1]) + 120,
np.flipud(h["y"][-npad - 2: -1]) + 120,
]
WAV_ = np.zeros_like(WAV)
gain = np.zeros(ntr + npad * 2 + 1)
Expand All @@ -167,6 +165,6 @@ def cadzow_np1(
)
WAV_[firstx:lastx, :] += array * gw[:, np.newaxis]

WAV_ = WAV_[npad : -npad - 1] # remove padding
WAV_ = WAV_[npad: -npad - 1] # remove padding
wav_ = scipy.fft.irfft(WAV_)
return wav_
4 changes: 2 additions & 2 deletions src/ibldsp/smooth.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,15 @@ def rolling_window(x, window_len=11, window="blackman"):
'bartlett', 'blackman'"
)

s = np.r_[x[window_len - 1 : 0 : -1], x, x[-1:-window_len:-1]]
s = np.r_[x[window_len - 1: 0: -1], x, x[-1:-window_len:-1]]
# print(len(s))
if window == "flat": # moving average
w = np.ones(window_len, "d")
else:
w = eval("np." + window + "(window_len)")

y = np.convolve(w / w.sum(), s, mode="valid")
return y[round((window_len / 2 - 1)) : round(-(window_len / 2))]
return y[round((window_len / 2 - 1)): round(-(window_len / 2))]


def non_uniform_savgol(x, y, window, polynom):
Expand Down
10 changes: 5 additions & 5 deletions src/neuropixel.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,10 +357,10 @@ def _process_NP24(self, overwrite=False):

for first, last in wg.firstlast:
chunk_ap = self.sr[first:last, : self.napch].T
chunk_ap_sync = self.sr[first:last, self.idxsyncch :].T
chunk_ap_sync = self.sr[first:last, self.idxsyncch:].T
chunk_lf = self.extract_lfp(self.sr[first:last, : self.napch].T)
chunk_lf_sync = self.extract_lfp_sync(
self.sr[first:last, self.idxsyncch :].T
self.sr[first:last, self.idxsyncch:].T
)

chunk_ap2save = self._ind2save(
Expand Down Expand Up @@ -466,7 +466,7 @@ def _process_NP21(self, overwrite=False, offset=0, **kwargs):

chunk_lf = self.extract_lfp(self.sr[first:last, : self.napch].T)
chunk_lf_sync = self.extract_lfp_sync(
self.sr[first:last, self.idxsyncch :].T
self.sr[first:last, self.idxsyncch:].T
)

chunk_lf2save = self._ind2save(
Expand Down Expand Up @@ -670,7 +670,7 @@ def _ind2save(self, chunk, chunk_sync, wg, ratio=1, etype="ap"):
chunk[:, slice(*ind2save)].T
/ self.sr.channel_conversion_sample2v[etype][: self.napch],
chunk_sync[:, slice(*ind2save)].T
/ self.sr.channel_conversion_sample2v[etype][self.idxsyncch :],
/ self.sr.channel_conversion_sample2v[etype][self.idxsyncch:],
]
).astype(np.int16)

Expand All @@ -686,7 +686,7 @@ def extract_lfp(self, chunk):
"""

chunk[:, : self.samples_taper] *= self.taper[: self.samples_taper]
chunk[:, -self.samples_taper :] *= self.taper[self.samples_taper :]
chunk[:, -self.samples_taper:] *= self.taper[self.samples_taper:]
chunk = scipy.signal.sosfiltfilt(self.sos_lp, chunk)
chunk = chunk[:, :: self.ratio]
return chunk
Expand Down
4 changes: 2 additions & 2 deletions src/tests/integration/cpu/test_destripe.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def test_parallel_computation(self):
self.sglx_instances.append(sr_four_append)
assert sr_four_append.ns == 2 * sr_four.ns
assert np.array_equal(
sr_four_append[sr_four.ns :, :], sr_four_append[: sr_four.ns, :]
sr_four_append[sr_four.ns:, :], sr_four_append[: sr_four.ns, :]
)
assert np.array_equal(sr_four_append[: sr_four.ns, :], sr_four[:, :])
assert np.array_equal(sr_four_append[sr_four.ns :, :], sr_four[:, :])
assert np.array_equal(sr_four_append[sr_four.ns:, :], sr_four[:, :])
2 changes: 1 addition & 1 deletion src/tests/unit/cpu/test_waveforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def test_extract_waveforms(self):
# with NaNs
assert wfs[0, self.channels[0], self.trough_offset] == 1.0
assert np.all(
np.isnan(wfs[0, self.num_channels // 2 + self.channels[0] + 1 :, :])
np.isnan(wfs[0, self.num_channels // 2 + self.channels[0] + 1:, :])
)

for i in range(1, 8):
Expand Down

0 comments on commit c40c613

Please sign in to comment.