citybert/Makefile

43 lines
1.2 KiB
Makefile
Raw Normal View History

2023-05-04 22:41:31 +00:00
all: install data train eval
city_distances_full.csv: check generate_data.py
2023-05-04 19:09:36 +00:00
@echo "Generating distance data..."
@bash -c 'time python generate_data.py'
2023-05-04 10:03:15 +00:00
2023-05-04 22:41:31 +00:00
data: city_distances_full.csv
2023-05-04 19:05:33 +00:00
train: check train.py
2023-05-04 19:09:36 +00:00
@echo "Training embeddings..."
@bash -c 'time python train.py'
2023-05-04 19:05:33 +00:00
eval: check eval.py
2023-05-04 19:09:36 +00:00
@echo "Evaluating trained model..."
@bash -c 'time python eval.py'
2023-05-04 19:05:33 +00:00
2023-05-04 10:03:15 +00:00
lint:
2023-05-04 19:09:36 +00:00
@echo "Auto-linting files and performing final style checks..."
@isort --profile=black .
@black .
@flake8 --max-line-length=88 .
2023-05-04 10:03:15 +00:00
2023-05-04 19:05:33 +00:00
check: lint
@echo "Checking for unstaged or untracked changes..."
@git diff-index --quiet HEAD -- || { echo "Unstaged or untracked changes detected!"; exit 1; }
2023-05-04 10:03:15 +00:00
clean:
2023-05-04 19:09:36 +00:00
@echo "Removing outputs/ and checkpoints/ directories"
@rm -rf output/
2023-05-04 22:41:31 +00:00
@rm -rf checkpoints/
compress: plots/progress_35845_sm.png plots/progress_680065_sm.png
plots/progress_35845_sm.png: plots/progress_35845.png
@convert -resize 33% plots/progress_35845.png plots/progress_35845_sm.png
plots/progress_680065_sm.png: plots/progress_680065.png
@convert -resize 33% plots/progress_680065.png plots/progress_680065_sm.png
install:
pip install -r requirements.txt
.PHONY: data train eval lint check clean all