File tree Expand file tree Collapse file tree 3 files changed +48
-1
lines changed Expand file tree Collapse file tree 3 files changed +48
-1
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ set -e
4
+
5
+ # This script is called in a binder context. When this script is called, we are
6
+ # inside a git checkout of the scikit-learn/scikit-learn repo. This script is
7
+ # generating notebooks from the scikit-learn python examples.
8
+
9
+ if [[ ! -f /.dockerenv ]]; then
10
+ echo " This script was written for repo2docker and is supposed to run inside a docker container."
11
+ echo " Exiting because this script can delete data if run outside of a docker container."
12
+ exit 1
13
+ fi
14
+
15
+ # Back up content we need from the scikit-learn repo
16
+ TMP_CONTENT_DIR=/tmp/scikit-learn
17
+ mkdir -p $TMP_CONTENT_DIR
18
+ cp -r examples .binder $TMP_CONTENT_DIR
19
+ # delete everything in current directory including dot files and dot folders
20
+ find . -delete
21
+
22
+ # Generate notebooks and remove other files from examples folder
23
+ GENERATED_NOTEBOOKS_DIR=.generated-notebooks
24
+ cp -r $TMP_CONTENT_DIR /examples $GENERATED_NOTEBOOKS_DIR
25
+
26
+ find $GENERATED_NOTEBOOKS_DIR -name ' *.py' -exec sphx_glr_python_to_jupyter.py ' {}' +
27
+ NON_NOTEBOOKS=$( find $GENERATED_NOTEBOOKS_DIR -type f | grep -v ' \.ipynb' )
28
+ rm -f $NON_NOTEBOOKS
29
+
30
+ # Put the .binder folder back (may be useful for debugging purposes)
31
+ mv $TMP_CONTENT_DIR /.binder .
32
+ # Final clean up
33
+ rm -rf $TMP_CONTENT_DIR
34
+
35
+ # This is for compatibility with binder sphinx-gallery integration: this makes
36
+ # sure that the binder links generated by sphinx-gallery are correct even tough
37
+ # the repo we use for binder (scikit-learn/scikit-learn) is not the repo of the
38
+ # generated doc (scikit-learn/scikit-learn.github.io)
39
+ mkdir notebooks
40
+ ln -s ../$GENERATED_NOTEBOOKS_DIR notebooks/auto_examples
Original file line number Diff line number Diff line change
1
+ --find-links https://sklearn-nightly.scdn8.secure.raxcdn.com scikit-learn
2
+ matplotlib
3
+ scikit-image
4
+ pandas
5
+ sphinx-gallery
6
+ scikit-learn >= 0.22.dev0
7
+
Original file line number Diff line number Diff line change 267
267
'gallery_dirs' : ['auto_examples' ],
268
268
'binder' : {
269
269
'org' : 'scikit-learn' ,
270
- 'repo' : 'binder-examples ' ,
270
+ 'repo' : 'scikit-learn ' ,
271
271
'binderhub_url' : 'https://mybinder.org' ,
272
272
'branch' : binder_branch ,
273
273
'dependencies' : './binder/requirements.txt' ,
You can’t perform that action at this time.
0 commit comments