Skip to content

Commit 90c1c21

Browse files
committed
ENH raise error in 00_setup_colab if not run from Colab
1 parent c3b0991 commit 90c1c21

16 files changed

Lines changed: 74 additions & 17 deletions

doc/Makefile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ merge-notebooks:
4747
> $(NBDIR)/merged_for_colab.ipynb
4848
echo "Saved in $(NBDIR)/merged_for_colab.ipynb"
4949

50-
51-
merge-notebooks-model-fitting:
5250
python merge_notebooks.py \
5351
$(NBDIR)/00_setup_colab.ipynb \
5452
$(NBDIR)/01_plot_explainable_variance.ipynb \

tutorials/notebooks/shortclips/00_download_shortclips.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989
"name": "python",
9090
"nbconvert_exporter": "python",
9191
"pygments_lexer": "ipython3",
92-
"version": "3.8.3"
92+
"version": "3.10.9"
9393
}
9494
},
9595
"nbformat": 4,

tutorials/notebooks/shortclips/00_setup_colab.ipynb

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,17 @@
7272
"# - Set up an email and username to use git, git-annex, and datalad (required to download the data)\n# - Add NeuroDebian to the package sources\n# - Update the gpg keys to use NeuroDebian\n# - Update the list of available packages\n# - Install Inkscape to use more features from Pycortex, and install git-annex to download the data\n# - Install the tutorial helper package, and all the required dependencies"
7373
]
7474
},
75+
{
76+
"cell_type": "code",
77+
"execution_count": null,
78+
"metadata": {
79+
"collapsed": false
80+
},
81+
"outputs": [],
82+
"source": [
83+
"try:\n import google.colab # noqa\n in_colab = True\nexcept ImportError:\n in_colab = False\nif not in_colab:\n raise RuntimeError(\"This script is only meant to be run from Google \"\n \"Colab. You can skip it if you run the tutorials \"\n \"on your machine.\")"
84+
]
85+
},
7586
{
7687
"cell_type": "markdown",
7788
"metadata": {},
@@ -132,7 +143,7 @@
132143
"name": "python",
133144
"nbconvert_exporter": "python",
134145
"pygments_lexer": "ipython3",
135-
"version": "3.8.3"
146+
"version": "3.10.9"
136147
}
137148
},
138149
"nbformat": 4,

tutorials/notebooks/shortclips/01_plot_explainable_variance.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@
319319
"name": "python",
320320
"nbconvert_exporter": "python",
321321
"pygments_lexer": "ipython3",
322-
"version": "3.8.3"
322+
"version": "3.10.9"
323323
}
324324
},
325325
"nbformat": 4,

tutorials/notebooks/shortclips/02_plot_ridge_regression.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@
406406
"name": "python",
407407
"nbconvert_exporter": "python",
408408
"pygments_lexer": "ipython3",
409-
"version": "3.8.3"
409+
"version": "3.10.9"
410410
}
411411
},
412412
"nbformat": 4,

tutorials/notebooks/shortclips/03_plot_wordnet_model.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,7 @@
653653
"name": "python",
654654
"nbconvert_exporter": "python",
655655
"pygments_lexer": "ipython3",
656-
"version": "3.8.3"
656+
"version": "3.10.9"
657657
}
658658
},
659659
"nbformat": 4,

tutorials/notebooks/shortclips/04_plot_hemodynamic_response.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@
352352
"name": "python",
353353
"nbconvert_exporter": "python",
354354
"pygments_lexer": "ipython3",
355-
"version": "3.8.3"
355+
"version": "3.10.9"
356356
}
357357
},
358358
"nbformat": 4,

tutorials/notebooks/shortclips/05_plot_motion_energy_model.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@
341341
"name": "python",
342342
"nbconvert_exporter": "python",
343343
"pygments_lexer": "ipython3",
344-
"version": "3.8.3"
344+
"version": "3.10.9"
345345
}
346346
},
347347
"nbformat": 4,

tutorials/notebooks/shortclips/06_plot_banded_ridge_model.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@
510510
"name": "python",
511511
"nbconvert_exporter": "python",
512512
"pygments_lexer": "ipython3",
513-
"version": "3.8.3"
513+
"version": "3.10.9"
514514
}
515515
},
516516
"nbformat": 4,

tutorials/notebooks/shortclips/07_extract_motion_energy.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@
136136
"name": "python",
137137
"nbconvert_exporter": "python",
138138
"pygments_lexer": "ipython3",
139-
"version": "3.8.3"
139+
"version": "3.10.9"
140140
}
141141
},
142142
"nbformat": 4,

0 commit comments

Comments
 (0)