quantstats-pro 0.4.3__tar.gz → 0.4.5__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. {quantstats_pro-0.4.3 → quantstats_pro-0.4.5}/.gitignore +2 -0
  2. {quantstats_pro-0.4.3 → quantstats_pro-0.4.5}/CHANGELOG.md +16 -0
  3. {quantstats_pro-0.4.3 → quantstats_pro-0.4.5}/PKG-INFO +3 -3
  4. {quantstats_pro-0.4.3 → quantstats_pro-0.4.5}/README.md +2 -2
  5. {quantstats_pro-0.4.3 → quantstats_pro-0.4.5}/quantstats/_compat.py +35 -1
  6. {quantstats_pro-0.4.3 → quantstats_pro-0.4.5}/quantstats/montecarlo/plotting.py +2 -2
  7. quantstats_pro-0.4.5/quantstats/version.py +1 -0
  8. quantstats_pro-0.4.3/quantstats/version.py +0 -1
  9. {quantstats_pro-0.4.3 → quantstats_pro-0.4.5}/LICENSE.txt +0 -0
  10. {quantstats_pro-0.4.3 → quantstats_pro-0.4.5}/pyproject.toml +0 -0
  11. {quantstats_pro-0.4.3 → quantstats_pro-0.4.5}/quantstats/__init__.py +0 -0
  12. {quantstats_pro-0.4.3 → quantstats_pro-0.4.5}/quantstats/_montecarlo.py +0 -0
  13. {quantstats_pro-0.4.3 → quantstats_pro-0.4.5}/quantstats/_numpy_compat.py +0 -0
  14. {quantstats_pro-0.4.3 → quantstats_pro-0.4.5}/quantstats/_plotting/__init__.py +0 -0
  15. {quantstats_pro-0.4.3 → quantstats_pro-0.4.5}/quantstats/_plotting/core.py +0 -0
  16. {quantstats_pro-0.4.3 → quantstats_pro-0.4.5}/quantstats/_plotting/wrappers.py +0 -0
  17. {quantstats_pro-0.4.3 → quantstats_pro-0.4.5}/quantstats/_reporting/__init__.py +0 -0
  18. {quantstats_pro-0.4.3 → quantstats_pro-0.4.5}/quantstats/_reporting/engine.py +0 -0
  19. {quantstats_pro-0.4.3 → quantstats_pro-0.4.5}/quantstats/_reporting/sections.py +0 -0
  20. {quantstats_pro-0.4.3 → quantstats_pro-0.4.5}/quantstats/alphadecay/__init__.py +0 -0
  21. {quantstats_pro-0.4.3 → quantstats_pro-0.4.5}/quantstats/alphadecay/core.py +0 -0
  22. {quantstats_pro-0.4.3 → quantstats_pro-0.4.5}/quantstats/alphadecay/plotting.py +0 -0
  23. {quantstats_pro-0.4.3 → quantstats_pro-0.4.5}/quantstats/montecarlo/__init__.py +0 -0
  24. {quantstats_pro-0.4.3 → quantstats_pro-0.4.5}/quantstats/montecarlo/analytics.py +0 -0
  25. {quantstats_pro-0.4.3 → quantstats_pro-0.4.5}/quantstats/montecarlo/base.py +0 -0
  26. {quantstats_pro-0.4.3 → quantstats_pro-0.4.5}/quantstats/montecarlo/core.py +0 -0
  27. {quantstats_pro-0.4.3 → quantstats_pro-0.4.5}/quantstats/montecarlo/models/__init__.py +0 -0
  28. {quantstats_pro-0.4.3 → quantstats_pro-0.4.5}/quantstats/montecarlo/models/bayesian.py +0 -0
  29. {quantstats_pro-0.4.3 → quantstats_pro-0.4.5}/quantstats/montecarlo/models/block_bootstrap.py +0 -0
  30. {quantstats_pro-0.4.3 → quantstats_pro-0.4.5}/quantstats/montecarlo/models/bootstrap.py +0 -0
  31. {quantstats_pro-0.4.3 → quantstats_pro-0.4.5}/quantstats/montecarlo/models/garch.py +0 -0
  32. {quantstats_pro-0.4.3 → quantstats_pro-0.4.5}/quantstats/montecarlo/models/gbm.py +0 -0
  33. {quantstats_pro-0.4.3 → quantstats_pro-0.4.5}/quantstats/montecarlo/models/heston.py +0 -0
  34. {quantstats_pro-0.4.3 → quantstats_pro-0.4.5}/quantstats/montecarlo/models/jump_diffusion.py +0 -0
  35. {quantstats_pro-0.4.3 → quantstats_pro-0.4.5}/quantstats/montecarlo/models/shuffle.py +0 -0
  36. {quantstats_pro-0.4.3 → quantstats_pro-0.4.5}/quantstats/montecarlo/models/trimmed.py +0 -0
  37. {quantstats_pro-0.4.3 → quantstats_pro-0.4.5}/quantstats/montecarlo/registry.py +0 -0
  38. {quantstats_pro-0.4.3 → quantstats_pro-0.4.5}/quantstats/plots.py +0 -0
  39. {quantstats_pro-0.4.3 → quantstats_pro-0.4.5}/quantstats/py.typed +0 -0
  40. {quantstats_pro-0.4.3 → quantstats_pro-0.4.5}/quantstats/report.html +0 -0
  41. {quantstats_pro-0.4.3 → quantstats_pro-0.4.5}/quantstats/report_alpha_decay.html +0 -0
  42. {quantstats_pro-0.4.3 → quantstats_pro-0.4.5}/quantstats/report_montecarlo.html +0 -0
  43. {quantstats_pro-0.4.3 → quantstats_pro-0.4.5}/quantstats/report_simple.html +0 -0
  44. {quantstats_pro-0.4.3 → quantstats_pro-0.4.5}/quantstats/reports.py +0 -0
  45. {quantstats_pro-0.4.3 → quantstats_pro-0.4.5}/quantstats/stats.py +0 -0
  46. {quantstats_pro-0.4.3 → quantstats_pro-0.4.5}/quantstats/utils.py +0 -0
@@ -27,3 +27,5 @@ AGENTS.md
27
27
  CONTEXT.md
28
28
  .local/
29
29
  .sandbox/
30
+ san_alpha_decay.ipynb
31
+ san_alpha_decay.html
@@ -1,6 +1,22 @@
1
1
  Changelog
2
2
  ===========
3
3
 
4
+ 0.4.5
5
+ -----
6
+
7
+ **Bug Fixes**
8
+
9
+ - Fixed ``html_montecarlo`` Max Drawdown boxplot crashing on matplotlib 3.7–3.9
10
+ (``TypeError`` from ``orientation=`` / ``tick_labels=``). Uses a signature-based
11
+ compatibility shim so the plot works from matplotlib 3.7 through 3.11+.
12
+
13
+ 0.4.4
14
+ -----
15
+
16
+ **README / Docs**
17
+
18
+ - Cleaned up install and import code snippets in README (removed inline comments).
19
+
4
20
  0.4.3
5
21
  -----
6
22
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: quantstats-pro
3
- Version: 0.4.3
3
+ Version: 0.4.5
4
4
  Summary: Drop-in replacement for QuantStats — advanced risk engines, institutional HTML tearsheets, and actionable portfolio analytics for quants
5
5
  Project-URL: Homepage, https://github.com/diegoalvarezmgl/quantstats-pro
6
6
  Project-URL: Documentation, https://github.com/diegoalvarezmgl/quantstats-pro
@@ -64,11 +64,11 @@ Where original quantstats stops at classic performance stats and a single HTML t
64
64
  Built for systematic traders, portfolio managers, and quant researchers who need production-grade tearsheets from a returns series.
65
65
 
66
66
  ```bash
67
- pip install quantstats-pro # replaces: pip install quantstats
67
+ pip install quantstats-pro
68
68
  ```
69
69
 
70
70
  ```python
71
- import quantstats as qs # import unchanged
71
+ import quantstats as qs
72
72
  ```
73
73
 
74
74
  > **Note:** QuantStats Pro **cannot coexist** with the original `quantstats`
@@ -12,11 +12,11 @@ Where original quantstats stops at classic performance stats and a single HTML t
12
12
  Built for systematic traders, portfolio managers, and quant researchers who need production-grade tearsheets from a returns series.
13
13
 
14
14
  ```bash
15
- pip install quantstats-pro # replaces: pip install quantstats
15
+ pip install quantstats-pro
16
16
  ```
17
17
 
18
18
  ```python
19
- import quantstats as qs # import unchanged
19
+ import quantstats as qs
20
20
  ```
21
21
 
22
22
  > **Note:** QuantStats Pro **cannot coexist** with the original `quantstats`
@@ -8,8 +8,10 @@ and numpy, ensuring that quantstats functions work consistently across various
8
8
  dependency versions. It handles deprecated functionality and version-specific changes.
9
9
  """
10
10
 
11
+ import inspect
11
12
  import warnings
12
- from collections.abc import Callable
13
+ from collections.abc import Callable, Mapping
14
+ from typing import Any
13
15
 
14
16
  import numpy as np
15
17
  import pandas as pd
@@ -429,3 +431,35 @@ def safe_yfinance_download(tickers: str | list[str],
429
431
  return pd.DataFrame(columns=['Open', 'High', 'Low', 'Close', 'Volume', 'Adj Close'])
430
432
 
431
433
  return result
434
+
435
+
436
+ def boxplot_compat_kwargs(
437
+ labels: list[str],
438
+ *,
439
+ horizontal: bool = True,
440
+ params: Mapping[str, Any] | None = None,
441
+ ) -> dict[str, Any]:
442
+ """
443
+ Build Axes.boxplot kwargs compatible across matplotlib 3.7–3.11+.
444
+
445
+ Matplotlib renamed ``labels`` → ``tick_labels`` in 3.9 (``labels`` removed
446
+ in 3.11) and replaced ``vert=False`` with ``orientation='horizontal'`` in
447
+ 3.10 (``vert`` deprecated in 3.11). Our declared floor is matplotlib>=3.7,
448
+ so callers must not hard-code the newest names.
449
+ """
450
+ if params is None:
451
+ from matplotlib.axes import Axes
452
+
453
+ params = inspect.signature(Axes.boxplot).parameters
454
+
455
+ kwargs: dict[str, Any] = {}
456
+ if horizontal:
457
+ if "orientation" in params:
458
+ kwargs["orientation"] = "horizontal"
459
+ else:
460
+ kwargs["vert"] = False
461
+ if "tick_labels" in params:
462
+ kwargs["tick_labels"] = labels
463
+ else:
464
+ kwargs["labels"] = labels
465
+ return kwargs
@@ -14,6 +14,7 @@ matplotlib.use("Agg", force=False)
14
14
  import matplotlib.pyplot as plt
15
15
  import numpy as np
16
16
 
17
+ from .._compat import boxplot_compat_kwargs
17
18
  from . import analytics
18
19
 
19
20
  _PRIMARY = "#348dc1"
@@ -247,11 +248,10 @@ def maxdd_distribution_figure(
247
248
 
248
249
  bp = ax.boxplot(
249
250
  data,
250
- orientation="horizontal",
251
- tick_labels=labels,
252
251
  patch_artist=True,
253
252
  showfliers=False,
254
253
  medianprops={"color": _MEDIAN, "linewidth": 1.5},
254
+ **boxplot_compat_kwargs(labels, horizontal=True),
255
255
  )
256
256
  for i, patch in enumerate(bp["boxes"]):
257
257
  if i < n_hist:
@@ -0,0 +1 @@
1
+ version = "0.4.5"
@@ -1 +0,0 @@
1
- version = "0.4.3"