-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathrun.sh
executable file
·48 lines (41 loc) · 1007 Bytes
/
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
42
43
44
45
46
47
48
#!/bin/bash
echo "[TENAX] loading data..."
if [ -d "CSIndex" ]; then
(cd CSIndex;
git pull
)
else
git clone https://github.com/aserg-ufmg/CSIndex.git
fi
## installing python dependencies
echo "[TENAX] installing dependencies"
sudo -H pip3 install -r requirements.txt
DATA="/tmp/ranking.csv"
echo "[TENAX] generating data at ${DATA}"
python rank.py | sort -nr > ${DATA}
echo "[TENAX] generating plots at data directory"
## generate plots
plot() {
# inputs
LEVEL=${1}
OUTFILENAME=${2}
# tempo file
TMPFILE="/tmp/scores"
grep "$LEVEL" ${DATA} | awk '{print $1}' | cut -f1 -d, > "$TMPFILE"
(cd R
Rscript --vanilla genhistograms.R "$TMPFILE" "$LEVEL" "$OUTFILENAME" >/dev/null 2>&1
)
}
plot "PQ-1A" pq1a
plot "PQ-1B" pq1b
plot "PQ-1C" pq1c
plot "PQ-1D" pq1d
plot "PQ-2" pq2
plot "\-\-" sembolsa
## generate grid with all plots
(cd R
./gengrid.R
)
## generating json
echo "[TENAX] generating json for website"
python csvtojson.py > docs/data.json