<commit_before>
# use this variable to include plots in zip archive
# included_plots := $(wildcard topic_plot/*)
included_plots := 

data_files := $(addprefix data/,info.json tw.json meta.csv dt.json doc_len.json)

no_zip = F

model_test_small.html: insert_model.py
	python insert_model.py \
	    --info test_small/info.json \
	    --tw test_small/tw.json \
	    --meta test_small/meta.csv \
	    --dt test_small/dt.json \
	    index.html > $@

model_test_big.html: insert_model.py
	python insert_model.py \
	    --info test_big/info.json \
	    --tw test_big/tw.json \
	    --meta test_big/meta.csv \
	    --dt test_big/dt.json \
	    index.html > $@

model.html: insert_model.py
	python insert_model.py \
	    --info data/info.json \
	    --tw data/tw.json \
	    --meta data/meta.csv \
	    --dt data/dt.json \
	    index.html > $@

# TODO new files
model.zip: model.html
	zip $@ model.js index.js model.html css/* lib/* $(included_plots)

# TODO new files
live.zip: index.html
	zip $@ model.js index.js index.html css/* lib/* \
	    $(data_files) \
	    $(included_plots)

lint:
	jsl -conf jsl.conf

prepare_small:
	R -e 'source("prepare_data.R"); prepare_data("test_small","test_small",no_zip=$(no_zip))'

prepare_big:
	R -e 'source("prepare_data.R"); prepare_data(Sys.glob("test_big/*/"),"test_big",no_zip=$(no_zip))'

select_small:
	rm -f data
	ln -s test_small data

select_big:
	rm -f data
	ln -s test_big data

.PHONY: lint prepare_small prepare_big<commit_msg>Makefile partial update<commit_after>
# use this variable to include plots in zip archive
# included_plots := $(wildcard topic_plot/*)
included_plots := 

data_files := $(addprefix data/,info.json tw.json meta.csv dt.json doc_len.json)

no_zip = F

model_test_small.html: insert_model.py
	python insert_model.py \
	    --info test_small/info.json \
	    --tw test_small/tw.json \
	    --meta test_small/meta.csv \
	    --dt test_small/dt.json \
	    index.html > $@

model_test_big.html: insert_model.py
	python insert_model.py \
	    --info test_big/info.json \
	    --tw test_big/tw.json \
	    --meta test_big/meta.csv \
	    --dt test_big/dt.json \
	    index.html > $@

model.html: insert_model.py
	python insert_model.py \
	    --info data/info.json \
	    --tw data/tw.json \
	    --meta data/meta.csv \
	    --dt data/dt.json \
	    index.html > $@

# TODO omit zips and JSZip sources
model.zip: model.html
	zip $@ model.html js/* css/* lib/* $(included_plots)

lint:
	jsl -conf jsl.conf

prepare_small:
	R -e 'source("prepare_data.R"); prepare_data("test_small","test_small",no_zip=$(no_zip))'

prepare_big:
	R -e 'source("prepare_data.R"); prepare_data(Sys.glob("test_big/*/"),"test_big",no_zip=$(no_zip))'

select_small:
	rm -f data
	ln -s test_small data

select_big:
	rm -f data
	ln -s test_big data

.PHONY: lint prepare_small prepare_big select_small select_big
{'fraction_non_alphanumeric': 0.1415525114155251, 'fraction_numerical': 0.0, 'mean_word_length': 2.9555555555555557, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7257432', 'n_tokens_mistral': 1109, 'n_tokens_neox': 1047, 'n_words': 234}