@@ -447,8 +447,8 @@ def test_build_insights_payload_structure(tmp_path: Path):
447447def _three_horizon_fixture (tmp_path : Path ) -> pd .DataFrame :
448448 """DE+FR with eos/mid/qtr; US only eos (excluded from curves)."""
449449 rows_by_hz = {
450- "qtr " : {"ridge" : 0.28 , "trend" : 0.32 , "xgboost" : 0.26 },
451- "mid " : {"ridge" : 0.22 , "trend" : 0.30 , "xgboost" : 0.20 },
450+ "mid " : {"ridge" : 0.30 , "trend" : 0.34 , "xgboost" : 0.28 },
451+ "qtr " : {"ridge" : 0.22 , "trend" : 0.30 , "xgboost" : 0.20 },
452452 "eos" : {"ridge" : 0.15 , "trend" : 0.28 , "xgboost" : 0.14 },
453453 }
454454 for cc , hz in [("de" , "eos" ), ("de" , "mid" ), ("de" , "qtr" ), ("fr" , "eos" ), ("fr" , "mid" ), ("fr" , "qtr" )]:
@@ -527,15 +527,15 @@ def test_horizon_skill_curves_inner_join_countries():
527527 df = _three_horizon_fixture (Path (tmp ))
528528 payload = build_horizon_skill_curves_payload (df )
529529 assert len (payload ["horizons" ]) == 3
530- assert [h ["id" ] for h in payload ["horizons" ]] == ["qtr " , "mid " , "eos" ]
530+ assert [h ["id" ] for h in payload ["horizons" ]] == ["mid " , "qtr " , "eos" ]
531531 maize = payload ["by_crop" ]["maize" ]
532532 assert maize ["n_countries" ] == 2
533533 assert set (maize ["countries" ]) == {"DE" , "FR" }
534534 assert "US" in maize ["excluded_countries" ]
535535
536536 xgb = next (f for f in maize ["families" ] if f ["model" ] == "xgboost" )
537537 nrmse_by_hz = {p ["horizon" ]: p ["median_nrmse" ] for p in xgb ["points" ]}
538- assert nrmse_by_hz ["qtr " ] > nrmse_by_hz ["mid " ] > nrmse_by_hz ["eos" ]
538+ assert nrmse_by_hz ["mid " ] > nrmse_by_hz ["qtr " ] > nrmse_by_hz ["eos" ]
539539
540540
541541def test_build_insights_payload_includes_qtr_and_curves (tmp_path : Path ):
0 commit comments