UV ?= uv

.PHONY: help data train test 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 test    run 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

test:
	$(UV) run pytest

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 {} +
