Skip to content

Commit e1f720a

Browse files
committed
Merge remote-tracking branch 'origin/docs' into develop
2 parents 4f763c0 + 7e5dabd commit e1f720a

21 files changed

+1589
-1574
lines changed

brainbox/behavior/dlc.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,8 @@ def likelihood_threshold(dlc, threshold=0.9):
5656
features = np.unique(['_'.join(x.split('_')[:-1]) for x in dlc.keys()])
5757
for feat in features:
5858
nan_fill = dlc[f'{feat}_likelihood'] < threshold
59-
dlc[f'{feat}_x'][nan_fill] = np.nan
60-
dlc[f'{feat}_y'][nan_fill] = np.nan
61-
59+
dlc.loc[nan_fill, f'{feat}_x'] = np.nan
60+
dlc.loc[nan_fill, f'{feat}_y'] = np.nan
6261
return dlc
6362

6463

brainbox/examples/docs_wheel_moves.ipynb

Lines changed: 45 additions & 162 deletions
Large diffs are not rendered by default.

examples/data_release/data_release_behavior.ipynb

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616
},
1717
{
1818
"cell_type": "markdown",
19+
"id": "dd157e91",
20+
"metadata": {
21+
"collapsed": false
22+
},
1923
"source": [
2024
"## Overview of the Data\n",
2125
"We have released behavioral data throughout learning from our standardized training pipeline, implemented across 9 labs in 7 institutions. Users can download behavioral data from mice throughout their training, and analyse the transition from novice to expert behavior unfold. The behavioral data is associated with 198 mice up until 2020-03-23, as used in [The International Brain Laboratory et al. 2020](https://elifesciences.org/articles/63711). This dataset contains notably information on the sensory stimuli presented to the mouse, as well as mouse decisions and response times.\n",
@@ -35,10 +39,7 @@
3539
"Note:\n",
3640
"\n",
3741
"* The tag associated to this release is `2021_Q1_IBL_et_al_Behaviour`"
38-
],
39-
"metadata": {
40-
"collapsed": false
41-
}
42+
]
4243
}
4344
],
4445
"metadata": {
@@ -58,9 +59,9 @@
5859
"name": "python",
5960
"nbconvert_exporter": "python",
6061
"pygments_lexer": "ipython3",
61-
"version": "3.9.7"
62+
"version": "3.11.6"
6263
}
6364
},
6465
"nbformat": 4,
6566
"nbformat_minor": 5
66-
}
67+
}

examples/data_release/data_release_brainwidemap.ipynb

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616
},
1717
{
1818
"cell_type": "markdown",
19+
"id": "e9be5894",
20+
"metadata": {
21+
"collapsed": false
22+
},
1923
"source": [
2024
"## Overview of the Data\n",
2125
"We have released data from 459 Neuropixel recording sessions, which encompass 699 probe insertions, obtained in 139 subjects performing the IBL task across 12 different laboratories. As output of spike-sorting, there are 376730 units; of which 45085 are considered to be of good quality. In total, 138 brain regions were recorded in sufficient numbers for inclusion in IBL’s analyses [(IBL et al. 2023)](https://www.biorxiv.org/content/10.1101/2023.07.04.547681v2).\n",
@@ -35,10 +39,7 @@
3539
"\n",
3640
"## Receive updates on the data\n",
3741
"To receive a notification that we released new datasets, please fill up [this form](https://forms.gle/9ex2vL1JwV4QXnf98)\n"
38-
],
39-
"metadata": {
40-
"collapsed": false
41-
}
42+
]
4243
}
4344
],
4445
"metadata": {
@@ -58,7 +59,7 @@
5859
"name": "python",
5960
"nbconvert_exporter": "python",
6061
"pygments_lexer": "ipython3",
61-
"version": "3.9.7"
62+
"version": "3.11.6"
6263
}
6364
},
6465
"nbformat": 4,

examples/data_release/data_release_repro_ephys.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@
5757
"name": "python",
5858
"nbconvert_exporter": "python",
5959
"pygments_lexer": "ipython3",
60-
"version": "3.9.7"
60+
"version": "3.11.6"
6161
}
6262
},
6363
"nbformat": 4,
6464
"nbformat_minor": 5
65-
}
65+
}

examples/data_release/data_release_spikesorting_benchmarks.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,9 @@
8989
"name": "python",
9090
"nbconvert_exporter": "python",
9191
"pygments_lexer": "ipython3",
92-
"version": "3.9.7"
92+
"version": "3.11.6"
9393
}
9494
},
9595
"nbformat": 4,
9696
"nbformat_minor": 5
97-
}
97+
}

examples/exploring_data/data_download.ipynb

Lines changed: 60 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,26 @@
11
{
22
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": null,
6+
"metadata": {},
7+
"outputs": [],
8+
"source": [
9+
"# Turn off logging and disable tqdm this is a hidden cell on docs page\n",
10+
"import logging\n",
11+
"import os\n",
12+
"\n",
13+
"logger = logging.getLogger('ibllib')\n",
14+
"logger.setLevel(logging.CRITICAL)\n",
15+
"\n",
16+
"os.environ[\"TQDM_DISABLE\"] = \"1\""
17+
]
18+
},
319
{
420
"cell_type": "markdown",
521
"metadata": {
6-
"collapsed": false
22+
"collapsed": false,
23+
"nbsphinx": "hidden"
724
},
825
"source": [
926
"# Download the public datasets\n",
@@ -21,10 +38,10 @@
2138
"source": [
2239
"## Installation\n",
2340
"### Environment\n",
24-
"To use IBL data you will need a python environment with python > 3.7. To create a new environment from scratch you can install [anaconda](https://www.anaconda.com/products/distribution#download-section) and follow the instructions below to create a new python environment (more information can also be found [here](https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html))\n",
41+
"To use IBL data you will need a python environment with python > 3.8. To create a new environment from scratch you can install [anaconda](https://www.anaconda.com/products/distribution#download-section) and follow the instructions below to create a new python environment (more information can also be found [here](https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html))\n",
2542
"\n",
2643
"```\n",
27-
"conda create --name ibl python=3.9\n",
44+
"conda create --name ibl python=3.11\n",
2845
"```\n",
2946
"Make sure to always activate this environment before installing or working with the IBL data\n",
3047
"```\n",
@@ -149,54 +166,51 @@
149166
{
150167
"cell_type": "code",
151168
"execution_count": null,
169+
"metadata": {},
152170
"outputs": [],
153171
"source": [
154172
"# Find sessions that have spikes.times datasets\n",
155173
"sessions_with_spikes = one.search(project='brainwide', data='spikes.times')"
156-
],
157-
"metadata": {
158-
"collapsed": false
159-
}
174+
]
160175
},
161176
{
162177
"cell_type": "markdown",
178+
"metadata": {
179+
"collapsed": false
180+
},
163181
"source": [
164182
"[Click here](https://int-brain-lab.github.io/ONE/notebooks/one_search/one_search.html) for a complete guide to searching using ONE.\n",
165183
"\n",
166184
"\n",
167185
"### Find data associated with a release or publication\n",
168186
"Datasets are often associated to a publication, and are tagged as such to facilitate reproducibility of analysis. You can list all tags and their associated publications like this:"
169-
],
170-
"metadata": {
171-
"collapsed": false
172-
}
187+
]
173188
},
174189
{
175190
"cell_type": "code",
176191
"execution_count": null,
192+
"metadata": {},
177193
"outputs": [],
178194
"source": [
179195
"# List and print all tags in the public database\n",
180196
"tags = {t['name']: t['description'] for t in one.alyx.rest('tags', 'list') if t['public']}\n",
181197
"for key, value in tags.items():\n",
182198
" print(f\"{key}\\n{value}\\n\")"
183-
],
184-
"metadata": {
185-
"collapsed": false
186-
}
199+
]
187200
},
188201
{
189202
"cell_type": "markdown",
190-
"source": [
191-
"You can use the tag to restrict your searches to a specific data release and as a filter when browsing the public database:"
192-
],
193203
"metadata": {
194204
"collapsed": false
195-
}
205+
},
206+
"source": [
207+
"You can use the tag to restrict your searches to a specific data release and as a filter when browsing the public database:"
208+
]
196209
},
197210
{
198211
"cell_type": "code",
199212
"execution_count": null,
213+
"metadata": {},
200214
"outputs": [],
201215
"source": [
202216
"# Note that tags are associated with datasets originally\n",
@@ -212,10 +226,7 @@
212226
"# To return to the full cache containing an index of all IBL experiments\n",
213227
"ONE.cache_clear()\n",
214228
"one = ONE(base_url='https://openalyx.internationalbrainlab.org')"
215-
],
216-
"metadata": {
217-
"collapsed": false
218-
}
229+
]
219230
},
220231
{
221232
"cell_type": "markdown",
@@ -292,29 +303,28 @@
292303
{
293304
"cell_type": "code",
294305
"execution_count": null,
306+
"metadata": {
307+
"pycharm": {
308+
"name": "#%%\n"
309+
}
310+
},
295311
"outputs": [],
296312
"source": [
297313
"# Load in all trials datasets\n",
298314
"trials = one.load_object(eid, 'trials', collection='alf')\n",
299315
"\n",
300316
"# Load in a single wheel dataset\n",
301317
"wheel_times = one.load_dataset(eid, '_ibl_wheel.timestamps.npy')"
302-
],
303-
"metadata": {
304-
"collapsed": false,
305-
"pycharm": {
306-
"name": "#%%\n"
307-
}
308-
}
318+
]
309319
},
310320
{
311321
"cell_type": "markdown",
312-
"source": [
313-
"Examples for loading different objects can be found in the following tutorials [here](https://int-brain-lab.github.io/iblenv/loading_examples.html)."
314-
],
315322
"metadata": {
316323
"collapsed": false
317-
}
324+
},
325+
"source": [
326+
"Examples for loading different objects can be found in the following tutorials [here](https://int-brain-lab.github.io/iblenv/loading_examples.html)."
327+
]
318328
},
319329
{
320330
"cell_type": "markdown",
@@ -350,6 +360,13 @@
350360
},
351361
{
352362
"cell_type": "code",
363+
"execution_count": null,
364+
"metadata": {
365+
"pycharm": {
366+
"name": "#%%\n"
367+
}
368+
},
369+
"outputs": [],
353370
"source": [
354371
"# List details of all sessions (returns a list of dictionaries)\n",
355372
"_, det = one.search(details=True)\n",
@@ -360,27 +377,19 @@
360377
"\n",
361378
"# Searching for RS sessions with specific lab name\n",
362379
"sessions_lab = one.search(data='spikes', lab=lab_name)"
363-
],
364-
"metadata": {
365-
"collapsed": false,
366-
"pycharm": {
367-
"name": "#%%\n"
368-
}
369-
},
370-
"execution_count": null,
371-
"outputs": []
380+
]
372381
},
373382
{
374383
"cell_type": "markdown",
375-
"source": [
376-
"You can also get this list, using [one.alyx.rest](https://int-brain-lab.github.io/ONE/notebooks/one_advanced/one_advanced.html), however it is a little slower."
377-
],
378384
"metadata": {
379385
"collapsed": false,
380386
"pycharm": {
381387
"name": "#%% md\n"
382388
}
383-
}
389+
},
390+
"source": [
391+
"You can also get this list, using [one.alyx.rest](https://int-brain-lab.github.io/ONE/notebooks/one_advanced/one_advanced.html), however it is a little slower."
392+
]
384393
},
385394
{
386395
"cell_type": "code",
@@ -411,16 +420,16 @@
411420
"language_info": {
412421
"codemirror_mode": {
413422
"name": "ipython",
414-
"version": 2
423+
"version": 3
415424
},
416425
"file_extension": ".py",
417426
"mimetype": "text/x-python",
418427
"name": "python",
419428
"nbconvert_exporter": "python",
420-
"pygments_lexer": "ipython2",
421-
"version": "2.7.6"
429+
"pygments_lexer": "ipython3",
430+
"version": "3.11.6"
422431
}
423432
},
424433
"nbformat": 4,
425434
"nbformat_minor": 0
426-
}
435+
}

examples/exploring_data/data_structure.ipynb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -270,16 +270,16 @@
270270
"language_info": {
271271
"codemirror_mode": {
272272
"name": "ipython",
273-
"version": 2
273+
"version": 3
274274
},
275275
"file_extension": ".py",
276276
"mimetype": "text/x-python",
277277
"name": "python",
278278
"nbconvert_exporter": "python",
279-
"pygments_lexer": "ipython2",
280-
"version": "2.7.6"
279+
"pygments_lexer": "ipython3",
280+
"version": "3.11.6"
281281
}
282282
},
283283
"nbformat": 4,
284284
"nbformat_minor": 0
285-
}
285+
}

examples/loading_data/loading_ephys_data.ipynb

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,14 @@
1717
},
1818
"outputs": [],
1919
"source": [
20-
"# Turn off logging, this is a hidden cell on docs page\n",
20+
"# Turn off logging and disable tqdm this is a hidden cell on docs page\n",
2121
"import logging\n",
22+
"import os\n",
23+
"\n",
2224
"logger = logging.getLogger('ibllib')\n",
23-
"logger.setLevel(logging.CRITICAL)"
25+
"logger.setLevel(logging.CRITICAL)\n",
26+
"\n",
27+
"os.environ[\"TQDM_DISABLE\"] = \"1\""
2428
]
2529
},
2630
{
@@ -217,9 +221,9 @@
217221
"name": "python",
218222
"nbconvert_exporter": "python",
219223
"pygments_lexer": "ipython3",
220-
"version": "3.9.7"
224+
"version": "3.11.6"
221225
}
222226
},
223227
"nbformat": 4,
224228
"nbformat_minor": 5
225-
}
229+
}

0 commit comments

Comments
 (0)