Skip to content

Commit 611b43d

Browse files
committed
Merge remote-tracking branch 'origin/develop' into docs
2 parents c9a04e6 + d63e62b commit 611b43d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+1597
-712
lines changed

.github/workflows/ibllib_ci.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,13 @@ jobs:
3333
- name: Install deps
3434
run: |
3535
python -m pip install --upgrade pip
36-
python -m pip install flake8 pytest
36+
python -m pip install flake8 pytest flake8-docstrings
3737
pip install -r requirements.txt
3838
pip install -e .
3939
- name: Flake8
4040
run: |
4141
python -m flake8
42+
python -m flake8 --select D --ignore E ibllib/qc/camera.py
4243
- name: Brainbox tests
4344
run: |
4445
cd brainbox

brainbox/behavior/dlc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import scipy.interpolate as interpolate
1010
from scipy.stats import zscore
1111

12-
from neurodsp.smooth import smooth_interpolate_savgol
12+
from ibldsp.smooth import smooth_interpolate_savgol
1313
from iblutil.numerical import bincount2D
1414
import brainbox.behavior.wheel as bbox_wheel
1515

brainbox/metrics/electrode_drift.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import numpy as np
22

3-
from neurodsp import smooth, utils, fourier
3+
from ibldsp import smooth, utils, fourier
44
from iblutil.numerical import bincount2D
55

66

brainbox/metrics/single_units.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -981,7 +981,7 @@ def quick_unit_metrics(spike_clusters, spike_times, spike_amps, spike_depths,
981981
r.amp_std_dB[ir] = np.array(camp['log_amps'].std())
982982
srp = metrics.slidingRP_all(spikeTimes=spike_times, spikeClusters=spike_clusters,
983983
**{'sampleRate': 30000, 'binSizeCorr': 1 / 30000})
984-
r.slidingRP_viol[srp['cidx']] = srp['value']
984+
r.slidingRP_viol[ir] = srp['value']
985985

986986
# loop over each cluster to compute the rest of the metrics
987987
for ic in np.arange(nclust):

examples/archive/ibllib/synchronisation_ephys.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import neurodsp.utils
1+
import ibldsp.utils
22
import spikeglx
33
import ibllib.io.extractors.ephys_fpga
44

@@ -15,7 +15,7 @@
1515

1616
# if the data is needed as well, loop over the file
1717
# raw data contains raw ephys traces, while raw_sync contains the 16 sync traces
18-
wg = neurodsp.utils.WindowGenerator(sr.ns, BATCH_SIZE_SAMPLES, overlap=1)
18+
wg = ibldsp.utils.WindowGenerator(sr.ns, BATCH_SIZE_SAMPLES, overlap=1)
1919
for first, last in wg.firstlast:
2020
rawdata, rawsync = sr.read_samples(first, last)
2121
wg.print_progress()

examples/loading_data/loading_raw_ephys_data.ipynb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,13 +107,13 @@
107107
"print(f'raw AP band sample for event at time {t_event}: {s_event}')\n",
108108
"\n",
109109
"# get the AP data surrounding samples\n",
110-
"window_secs_ap = [-0.05, 0.05] # we'll look at 100ms before the event and 200ms after the event for AP\n",
110+
"window_secs_ap = [-0.05, 0.05] # we'll look at 50ms before and after the event for AP\n",
111111
"first, last = (int(window_secs_ap[0] * sr_ap.fs) + s_event, int(window_secs_ap[1] * sr_ap.fs + s_event))\n",
112112
"raw_ap = sr_ap[first:last, :-sr_ap.nsync].T\n",
113113
"\n",
114114
"# get the LF data surrounding samples\n",
115-
"window_secs_ap = [-0.750, 0.750] # we'll look at 100ms before the event and 200ms after the event\n",
116-
"sample_lf = s_event // 12 # NB: for neuropixel probes this is always 12\n",
115+
"window_secs_ap = [-0.750, 0.750] # we'll look at 750ms before and after the event because LF varies more slowly in time\n",
116+
"sample_lf = s_event // 12 # NB: for neuropixel probes this is always 12 because AP is sampled at 12x the frequency of LF\n",
117117
"first, last = (int(window_secs_ap[0] * sr_lf.fs) + sample_lf, int(window_secs_ap[1] * sr_lf.fs + sample_lf))\n",
118118
"raw_lf = sr_lf[first:last, :-sr_lf.nsync].T"
119119
]
@@ -236,7 +236,7 @@
236236
"metadata": {},
237237
"outputs": [],
238238
"source": [
239-
"from neurodsp.voltage import destripe\n",
239+
"from ibldsp.voltage import destripe\n",
240240
"# Reminder : If not done before, remove first the sync channel from raw data\n",
241241
"# Apply destriping algorithm to data\n",
242242
"destriped = destripe(raw_ap, fs=sr_ap.fs)"
@@ -445,7 +445,7 @@
445445
"source": [
446446
"## Useful modules\n",
447447
"* [ibllib.io.spikeglx](https://int-brain-lab.github.io/ibl-neuropixel/_autosummary/spikeglx.html)\n",
448-
"* [ibllib.voltage.dsp](https://int-brain-lab.github.io/ibl-neuropixel/_autosummary/neurodsp.voltage.html)\n",
448+
"* [ibllib.voltage.dsp](https://int-brain-lab.github.io/ibl-neuropixel/_autosummary/ibldsp.voltage.html)\n",
449449
"* [brainbox.io.spikeglx.stream](https://int-brain-lab.github.io/iblenv/_autosummary/brainbox.io.spikeglx.html#brainbox.io.spikeglx.stream)\n",
450450
"* [viewephys](https://github.com/oliche/viewephys) to visualise raw data snippets (Note: this package is not within `ibllib` but standalone)"
451451
]

examples/one/histology/coverage_map.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import matplotlib.pyplot as plt
22
import numpy as np
33
from one.api import ONE
4-
from neurodsp.utils import fcn_cosine
4+
from ibldsp.utils import fcn_cosine
55

66
import iblatlas.atlas as atlas
77
from ibllib.pipes.histology import coverage

ibllib/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import logging
33
import warnings
44

5-
__version__ = '2.29.0'
5+
__version__ = '2.34.1'
66
warnings.filterwarnings('always', category=DeprecationWarning, module='ibllib')
77

88
# if this becomes a full-blown library we should let the logging configuration to the discretion of the dev

ibllib/ephys/ephysqc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from iblutil.util import Bunch
1212
import spikeglx
1313
import neuropixel
14-
from neurodsp import fourier, utils, voltage
14+
from ibldsp import fourier, utils, voltage
1515
from tqdm import tqdm
1616

1717
from brainbox.io.spikeglx import Streamer

ibllib/ephys/spikes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ def ks2_to_alf(ks_path, bin_path, out_path, bin_file=None, ampfactor=1, label=No
142142
"""
143143
m = ephysqc.phy_model_from_ks2_path(ks2_path=ks_path, bin_path=bin_path, bin_file=bin_file)
144144
ac = phylib.io.alf.EphysAlfCreator(m)
145-
ac.convert(out_path, label=label, force=force, ampfactor=ampfactor)
145+
ac.convert(out_path, label=label, force=force, ampfactor=float(ampfactor))
146146

147147

148148
def ks2_to_tar(ks_path, out_path, force=False):

0 commit comments

Comments
 (0)