You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(risk-metrics): zero-volatility Sharpe is -inf, which serializes to null and crashes the renderer #230
On main (d845531), RiskCalculator._calculate_sharpe divides by returns.std(). A flat price series gives std == 0 and a Sharpe of -inf. Pydantic's JSON output turns -inf into null, and the risk renderer then raises TypeError on the null.
Found by the second-model review of the comment-sweep analysis branch, which reproduced it on both the base and the branch. The branch names the outcome (_zero_risk_sharpe) but keeps the -inf value.
Fix: define an explicit contract for an unavailable or unbounded ratio, for example None with a reason field, and test its JSON round trip through every consumer.
Activity
pullfrog commentedon Oct 14, 2026
linear-code commentedon Oct 14, 2026
AOJ-1365