← ClaudeAtlas

lib-quantstatslisted

The tearsheet library whose cagr(rf=...) accepts your risk-free rate and silently discards it - "cagr" sits on an exclusion list inside _prepare_returns, which dispatches on the caller's function name. TRIGGER - quantstats, "import quantstats as qs", qs.reports.html, qs.stats.sharpe, qs.stats.cagr, qs.stats.value_at_risk, expected_shortfall, gain_to_pain_ratio, rolling_volatility, qs.extend_pandas, tearsheet, quantstats-lumi; or a wildly negative Sharpe. Memory is stale on status and correctness - 0.0.81 shipped in a single-day hotfix burst on 2026-01-13 with no default-branch commits since, and the cagr bug survived it. SKIP for optimizing against these measures (lib-riskfolio, lib-skfolio) and for PSR/DSR, which it does not have (backtest-validation). SKIP when the question is WHICH library to choose, or names no library at all - both belong to the domain skill.
howard-lynn-ye/fin-skills · ★ 1 · AI & Automation · score 77
Install: claude install-skill howard-lynn-ye/fin-skills
# quantstats One-call HTML tearsheets and performance analytics — enormously popular, and the source of more quietly wrong published numbers than anything else in this domain. | | | |---|---| | pip / import | `QuantStats` / `quantstats` (conventionally `import quantstats as qs`) | | Version | **0.0.81** (2026-01-13) · Python `>=3.10` | | Licence | Apache-2.0 | | Status | ⚠️ **burst-maintained** — 7,612★ / 32 issues; no default-branch commits since 2026-01-13 | The maintenance pattern matters because of the bugs below: 0.0.78 ("2026 Modernization Update") shipped with circular-import errors hot-fixed through 0.0.79, 0.0.80 and 0.0.81 **the same day**, and the metric bugs survived it. Forks: `quantstats-lumi` 1.1.5, `quantstats-reloaded` 0.1.0. ## The trap that costs you money 🚨 **CONFIRMED BUG: `quantstats.stats.cagr()` discards `rf`.** The signature is `cagr(returns, rf=0.0, compounded=True, periods=252)` and the docstring says it computes the CAGR *"of excess returns"*. **The parameter has no effect.** Root cause in `quantstats/utils.py::_prepare_returns`, which dispatches on the **caller's function name**: ```python function = inspect.stack()[1][3] unnecessary_function_calls = ["_prepare_benchmark", "cagr", "gain_to_pain_ratio", "rolling_volatility"] if function not in unnecessary_function_calls: if rf > 0: return to_excess_returns(data, rf, nperiods) ``` `"cagr"` is on the exclusion list, so `rf` is accepted and silently dropped. The **same list disable