Build artifacts/prezero_priority.json from the anonymized glass fill-level export (11,701 rows, 449 containers, 1,338 location/material series). The contract tier rule yields high 88, medium 248, low 113 with 1,192 overfull readings.
Add /prezero/summary, /prezero/priority, and /prezero/containers/{id} to the internal FastAPI service, with startup validation, filtering/pagination, recent reading history, and 503 isolation when the artifact is missing. Raw CSV stays gitignored; the derived 1.1 MB artifact is the source of truth. This is a priority proof, not a route: the dataset has no coordinates.
55 lines
1.5 KiB
Makefile
55 lines
1.5 KiB
Makefile
UV ?= uv
|
|
|
|
.PHONY: help data train small prezero figures test lint check serve docker clean
|
|
|
|
help:
|
|
@printf '%s\n' \
|
|
'make data parse/clean the raw CSV, join weather + holidays, export JSON' \
|
|
'make train fit the 28-day holdout model, export metrics/forecasts/model' \
|
|
'make small train + print the busy-hour classifier metrics from the raw CSV' \
|
|
'make prezero build artifacts/prezero_priority.json from the fill-level CSV' \
|
|
'make figures regenerate docs/figures/*.svg from artifacts/metrics.json' \
|
|
'make test run pytest' \
|
|
'make lint run ruff static checks' \
|
|
'make check CI gate: sync --frozen, ruff, compileall, pytest' \
|
|
'make serve run the FastAPI service on :8000' \
|
|
'make docker build the multi-stage image (pulsecast-ml:local)' \
|
|
'make clean remove caches and generated artifacts (keeps data/raw)'
|
|
|
|
data:
|
|
$(UV) run python -m pulsecast.pipeline
|
|
|
|
train:
|
|
$(UV) run python -m pulsecast.train
|
|
|
|
small:
|
|
$(UV) run python scripts/train_small.py
|
|
|
|
prezero:
|
|
$(UV) run python scripts/build_prezero.py
|
|
|
|
figures:
|
|
$(UV) run python scripts/plot_metrics.py
|
|
|
|
test:
|
|
$(UV) run pytest
|
|
|
|
lint:
|
|
$(UV) run ruff check src tests scripts main.py
|
|
|
|
check:
|
|
$(UV) sync --frozen
|
|
$(UV) run ruff check src tests scripts main.py
|
|
$(UV) run python -m compileall src scripts
|
|
$(UV) run pytest -q
|
|
|
|
serve:
|
|
$(UV) run uvicorn pulsecast.server:app --host 0.0.0.0 --port 8000
|
|
|
|
docker:
|
|
docker build -t pulsecast-ml:local .
|
|
|
|
clean:
|
|
rm -rf data/cache artifacts .pytest_cache
|
|
find . -type d -name __pycache__ -prune -exec rm -rf {} +
|