Skip to content

Commit 7d2e428

Browse files
committed
small workflow tweaks
1 parent b78df9a commit 7d2e428

2 files changed

Lines changed: 11 additions & 4 deletions

File tree

Makefile

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
RUN_ID = test
1+
RUN_ID = full3
22

33
RAW_DATA = data/raw.parquet
44
CONFIG = scripts/config.yaml
@@ -30,7 +30,7 @@ viz:
3030
streamlit run scripts/viz.py -- \
3131
--data=$(DATA) --preds=$(PRED_DIR) --scores=$(SCORES) --config=$(CONFIG)
3232

33-
$(SCORES): scripts/eval.py $(PREDS_FLAG) $(DATA)
33+
$(SCORES): scripts/eval.py $(PREDS_FLAG) $(DATA) $(CONFIG)
3434
python $< --preds=$(PRED_DIR) --data=$(DATA) --config=$(CONFIG) --output=$@
3535

3636
$(PLOT_PREDS): scripts/plot_preds.py $(CONFIG) $(DATA) $(PREDS_FLAG) $(SCORES)
@@ -39,8 +39,11 @@ $(PLOT_PREDS): scripts/plot_preds.py $(CONFIG) $(DATA) $(PREDS_FLAG) $(SCORES)
3939
$(PLOT_DATA): scripts/plot_data.py $(DATA)
4040
python $< --config=$(CONFIG) --data=$(DATA) --output=$@
4141

42-
$(PREDS_FLAG): $(PREDS)
43-
touch $@
42+
$(PLOT_DATA): scripts/plot_data.py $(DATA) $(CONFIG)
43+
python $< --config=$(CONFIG) --data=$(DATA) --output=$@
44+
45+
$(DIAGNOSTICS): scripts/diagnostics.py $(FITS) $(CONFIG)
46+
python $< --fits=$(FITS) --config=$(CONFIG) --output=$@
4447

4548
# output/run_id/pred/forecast_start=2021-01-01/part-0.parquet <== output/fits/fit_2021-01-01.pkl
4649
$(PRED_DIR)/forecast_start$(EQ)%/part-0.parquet: scripts/predict.py $(OUTPUT_DIR)/fits/fit_%.pkl $(DATA) $(CONFIG)

scripts/eval.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ def eval_all_forecasts(
2424
A pl.DataFrame with score name and score values, grouped by model, forecast start, quantile, and possibly other grouping factors
2525
"""
2626
forecast_starts = pred["forecast_start"].unique()
27+
28+
assert "score_funs" in config, (
29+
f"`score_funs` not among config keys: {config.keys()}"
30+
)
2731
score_funs = [getattr(iup.eval, fun_name) for fun_name in config["score_funs"]]
2832

2933
assert config["groups"] is not None

0 commit comments

Comments
 (0)