-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path.test_notebooks.sh
executable file
·35 lines (34 loc) · 1.12 KB
/
.test_notebooks.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
#!/bin/bash
set -e
FILES=`find . -wholename "./notebooks/*.ipynb" ! -name '*checkpoint*'`
export PYTHONPATH=${PYTHONPATH}:${PWD}/
echo "PYTHONPATH=${PYTHONPATH}"
for NOTEBOOK in $FILES
do
echo ">>> Processing ${NOTEBOOK}"
BASENAME=${NOTEBOOK%.*}
PYTHONFILE=${BASENAME}".py"
# if [[ $NOTEBOOK =~ .*f16.* ]] || [[ $NOTEBOOK =~ .*csaf_env_example.* ]]; then
# EXAMPLE="f16"
# else
# if [[ $NOTEBOOK =~ .*cansat.* ]]; then
# EXAMPLE="cansat"
# else
# if [[ $NOTEBOOK =~ .*dubins.* ]]; then
# EXAMPLE="rejoin"
# else
# echo "Unknown example!"
# exit 1
# fi
# fi
# fi
# # Now actually execute the commands
# echo ">>> Adjust example paths: ln -s ${PWD}/examples/${EXAMPLE} /csaf-system"
# sudo ln -s ${PWD}/examples/${EXAMPLE} /csaf-system
echo ">>> Converting ${NOTEBOOK}: jupyter nbconvert --to python $NOTEBOOK"
jupyter nbconvert --to python $NOTEBOOK
echo ">>> Testing ${NOTEBOOK}: ipython $PYTHONFILE"
ipython $PYTHONFILE
# echo ">>> Testing ${NOTEBOOK} complete! Removing symlink: rm /csaf-system"
# sudo rm /csaf-system
done