-
Notifications
You must be signed in to change notification settings - Fork 208
/
Copy pathrun_examples.sh
executable file
·56 lines (48 loc) · 1.67 KB
/
run_examples.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/opt/homebrew/bin/bash
# Script to run all example notebooks.
set -euxo pipefail
CMD="jupyter nbconvert --to notebook --inplace --execute --ExecutePreprocessor.timeout=600"
excluded=(
"examples/transformations/signature_method.ipynb"
)
if [ "$1" = true ]; then
excluded+=(
"examples/datasets/load_data_from_web.ipynb"
"examples/benchmarking/published_results.ipynb"
"examples/benchmarking/reference_results.ipynb"
"examples/benchmarking/bakeoff_results.ipynb"
"examples/benchmarking/regression.ipynb"
"examples/clustering/partitional_clustering.ipynb"
"examples/classification/hybrid.ipynb"
"examples/classification/deep_learning.ipynb"
"examples/classification/dictionary_based.ipynb"
"examples/classification/distance_based.ipynb"
"examples/classification/feature_based.ipynb"
"examples/classification/interval_based.ipynb"
"examples/classification/shapelet_based.ipynb"
"examples/classification/convolution_based.ipynb"
"examples/similarity_search/code_speed.ipynb"
)
fi
shopt -s lastpipe
notebooks=()
runtimes=()
# Loop over all notebooks in the examples directory.
find "examples" -name "*.ipynb" -print0 |
while IFS= read -r -d "" notebook; do
# Skip notebooks in the excluded list.
if printf "%s\0" "${excluded[@]}" | grep -Fxqz -- "$notebook"; then
echo "Skipping: $notebook"
# Run the notebook.
else
echo "Running: $notebook"
start=$(date +%s)
$CMD "$notebook"
end=$(date +%s)
notebooks+=("$notebook")
runtimes+=($((end-start)))
fi
done
# print runtimes and notebooks
echo "Runtimes:"
paste <(printf "%s\n" "${runtimes[@]}") <(printf "%s\n" "${notebooks[@]}")