-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathrun.sh
executable file
·41 lines (37 loc) · 1.43 KB
/
run.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
#!/bin/bash
# To provide a list of project names, run with ./run.sh -p "proj1 proj2 ..."
# To provide the database password: ./run.sh -pwd passwordstring
# Or with multiple options: ./run.sh -p "proj1 proj2 ..." -pwd passwordstring
# nwchem works, but takes a long time, so we don't include it in the regular refresh
projects="spack lammps petsc Nek5000 E3SM qmcpack qdpxx LATTE namd fast-export enzo-dev tau2 xpress-apex" # nwchem"
pwd=""
html=false
while true; do
case "$1" in
-p | --projects) projects="$2"; shift 2 ;;
-pwd ) pwd="$2"; shift 2 ;;
-hmtl ) html=true; shift 1;;
-- ) shift; break ;;
* ) break ;;
esac
done
echo "Projects: $projects";
echo "Password: $pwd";
if [ ! -d tmp ]; then mkdir tmp; fi
# Create a simple python script version of the notebook(s)
jupyter nbconvert --to script PatternsTest.ipynb
sed -ie "s|project_name=[\"'].*[\"']|project_name=sys.argv[1]|" PatternsTest.py
for project in $projects ; do
echo ">>>>>>> PatternsTest $project"
sed -e "s|project_name='.*'|project_name='$project'|" -e "s|get_data(.*)|get_data(dbpwd='$pwd')|" PatternsTest.ipynb > $project-PatternsTest.ipynb
####python ./PatternsTest.py $project
if [ "$html" = true ]; then
jupyter nbconvert --to html --execute $project-PatternsTest.ipynb
fi
mv $project-PatternsTest.* tmp/
done
if [ "$html" = true ]; then
if [ "$USER" = norris ]; then
rsync -avz tmp/*.html ix:public_html/ideas-uo/notebooks/html/
fi
fi