INNER CODE UNIT · Python
_write_backtest_summary
initial-d/ml-quant-trading · src/mlquant/cli/main.py:91
def _write_backtest_summary(
output_dir: Path,
metrics: dict,
*,
config_path: str,
costs_bps: float,
evaluation: dict | None = None,
) -> tuple[Path, Path]:
"""Write portable JSON and Markdown summaries for sharing and review."""
clean_metrics = {
key: value if not isinstance(value, float) or math.isfinite(value) else None
for key, value in metrics.items()
}
payload = {
"project": "ml-quant-trading",
"repository": PROJECT_URL,
"reproduction_report": REPRODUCTION_REPORT_URL,
"workflow": "synthetic factor-to-backtest demo",