Skip to content

feat: 2026 Modernization - Python 3.10+, Monte Carlo, Bug Fixes#494

Merged
ranaroussi merged 1 commit intomainfrom
ranaroussi/2026-updates
Jan 13, 2026
Merged

feat: 2026 Modernization - Python 3.10+, Monte Carlo, Bug Fixes#494
ranaroussi merged 1 commit intomainfrom
ranaroussi/2026-updates

Conversation

@ranaroussi
Copy link
Copy Markdown
Owner

@ranaroussi ranaroussi commented Jan 13, 2026

Summary

Major modernization release bringing QuantStats into 2026 with modern Python support, new Monte Carlo simulation features, and comprehensive bug fixes.

Breaking Changes

  • Python 3.10+ required (dropped 3.8, 3.9 support)

Dependency Updates (backwards compatible)

  • pandas>=1.5.0 (compat layer handles 1.x and 2.x differences)
  • numpy>=1.24.0
  • scipy>=1.11.0, seaborn>=0.13.0, matplotlib>=3.7.0

New Features

Bug Fixes (15+ issues resolved)

Code Quality

  • Migrated from setup.py to pyproject.toml
  • Added comprehensive type hints to 20+ stats.py functions
  • Added py.typed marker for PEP 561
  • Simplified compatibility layers (removed obsolete version checks)
  • README converted from RST to Markdown

Test Plan

  • All 104 existing tests pass
  • Monte Carlo simulations work correctly
  • HTML reports generate properly with and without benchmarks
  • Parameters feature works in HTML reports
  • Type hints validated with pyright

🤖 Generated with Claude Code

## Packaging & Dependencies
- Migrated from setup.py to pyproject.toml
- Python 3.10+ minimum (dropped 3.8, 3.9)
- pandas 2.0+, numpy 1.24+, scipy 1.11+, seaborn 0.13+, matplotlib 3.7+

## New Features
- Monte Carlo simulation module (_montecarlo.py)
  - Confidence intervals for returns, Sharpe, drawdown, CAGR
  - Bootstrap resampling with configurable simulations
  - Path simulation and Monte Carlo plots
- Parameters table in HTML reports (issue #472)
- Average drawdown line in underwater plot (issue #489)
- Chrome dark mode support (issue #492)

## Bug Fixes (15+ issues resolved)
- #491: HTML report with benchmark Series
- #486: reports.metrics vs reports.full inconsistency
- #485: Benchmark Omega always same as strategy
- #484: make_index incorrect calculation
- #481: NaN in EOY Returns vs Benchmark
- #480: Inconsistent metrics benchmark vs return-only
- #479: EOY Returns vs Benchmark section issues
- #475: Double "%" in HTML report
- #477: Noisy variance warning messages
- #467: CVaR calculation for DataFrame inputs
- Fixed timezone normalization for cross-market comparisons
- Fixed FutureWarning for deprecated pandas pct_change()
- Fixed parameters kwarg not being used in html reports

## Code Quality
- Added comprehensive type hints to 20+ stats.py functions
- Uses Python 3.10+ union syntax (X | Y)
- Added py.typed marker for PEP 561
- Simplified _compat.py and _numpy_compat.py (removed obsolete checks)
- README converted from RST to Markdown

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@ranaroussi ranaroussi force-pushed the ranaroussi/2026-updates branch from b33f933 to 7509f0d Compare January 13, 2026 14:10
@ranaroussi ranaroussi merged commit f002900 into main Jan 13, 2026
1 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant