-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
133 lines (104 loc) · 2.69 KB
/
Makefile
File metadata and controls
133 lines (104 loc) · 2.69 KB
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
all:
setup:
sudo apt-get install -y python3 language-pack-fr
pip3 install -r requirements.txt
check:
./graphit.py --help
:
tail -1 data.csv
:
./graphit.py --noshow 38
ls -lh 38.png
FONT = Yahfie/Yahfie-Heavy.ttf
ZIPFILE = Yahfie-Normal.font.zip
xkcd.ttf: fontname.py ~/.fonts
wget https://www.ffonts.net/$(ZIPFILE)
unzip -p $(ZIPFILE) $(FONT) > $@
./fontname.py xkcd $@
cp $@ ~/.fonts/
rm -f ~/.cache/matplotlib/fontlist-*.json
rm -f $(ZIPFILE)
fontname.py:
pip3 install fonttools
wget https://github.com/chrissimpkins/fontname.py/raw/master/fontname.py
chmod +x fontname.py
~/.fonts:
mkdir $@
clean:
pip uninstall -y fonttools
rm -f xkcd.ttf fontname.py
depts = \
31 34 13 42 69 38 76 75 59 \
33 67 30 73 74 50 06 35 \
idf pc gc
nonoise = \
05 04
graphit = ./graphit.py --noshow --round --week --style fast
radar: opts = --two-months
radar: met.opt = --zoom 350 --proj-val
radar:
for dept in $(nonoise); do \
$(graphit) $$dept $(opts) & \
done; \
for dept in $(depts); do \
$(graphit) $$dept $(opts) --noise & \
done; \
$(graphit) met $(met.opt) $(opts) --noise & \
$(graphit) met --full & \
wait
met:
./graphit.py \
--style fast \
--week --round --noise \
--zoom 150 \
--proj-val --proj $$((12 - `date +%u`)) \
met
help.fr:
curl -sL https://github.com/ofa-/graphit/blob/master/help.fr.md \
| sed '/<article/ s:>:\n:' \
| sed '1,/<article/ d; /<\/article/,$$ d' \
| sed 's:<svg.*</svg>::g' \
> help.fr.md.html
fetch:
./fetch.sh
wait-for-data.csv:
@(\
today=`date +%F` ;\
last_data() { tail -1 data.csv | cut -d ';' -f2; } ;\
while true; do \
./fetch.sh ;\
printf "." ;\
if [ "`last_data`" = $$today ]; then break; fi;\
sleep 1m ;\
done ) 2>/dev/null
day.dc:
day.dc: day = $(shell tail -1 data.csv | cut -d\; -f2)
%.dc:
grep $(day) data.csv | grep -v '"97' \
| cut -f5 -d\; | xargs | tr ' ' + | bc
%.dc: day = $*
waves-toll:
./waves-toll.py
death-rate:
./waves-toll.py |\
jq '.[] | ."nb morts" / ."nb jours"' |\
awk '{printf("%.0f\n", $$1)}'
insee.%: release = 2023-02-24
insee.diff: prev_rel = $(shell ls | grep insee_dc.20 | sort -r | sed -n 2p)
insee.diff:
diff -ru $(prev_rel) insee_dc.$(release) |\
egrep '^\+' | sed '1d' |\
cut -c 1-8 | uniq -c
insee.fetch: zip_file = $(release)_detail.zip
insee.fetch:
: home: https://www.insee.fr/fr/statistiques/4487988
curl -k $(insee.url)/$(zip_file) > $(zip_file)
mkdir -p insee_dc.$(release)
cd insee_dc.$(release); 7z x ../$(zip_file)
rm -f $(zip_file)
ln -sfT insee_dc.$(release) insee_dc
insee.url = https://www.insee.fr/fr/statistiques/fichier/4487988
insee.stat:
./insee_dc.py --baseline-noise --age-split
insee.home:
./insee_dc.py --baseline-noise --age-split --at-home