jquantstats 0.9.2__tar.gz → 0.9.3__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 (48) hide show
  1. jquantstats-0.9.3/.rhiza/completions/README.md +263 -0
  2. {jquantstats-0.9.2 → jquantstats-0.9.3}/PKG-INFO +5 -3
  3. {jquantstats-0.9.2 → jquantstats-0.9.3}/pyproject.toml +24 -5
  4. {jquantstats-0.9.2 → jquantstats-0.9.3}/src/jquantstats/portfolio.py +4 -4
  5. {jquantstats-0.9.2 → jquantstats-0.9.3}/.github/actions/configure-git-auth/README.md +0 -0
  6. {jquantstats-0.9.2 → jquantstats-0.9.3}/.gitignore +0 -0
  7. {jquantstats-0.9.2 → jquantstats-0.9.3}/.rhiza/requirements/README.md +0 -0
  8. {jquantstats-0.9.2 → jquantstats-0.9.3}/.rhiza/tests/README.md +0 -0
  9. {jquantstats-0.9.2 → jquantstats-0.9.3}/.rhiza/tests/stress/README.md +0 -0
  10. {jquantstats-0.9.2 → jquantstats-0.9.3}/LICENSE +0 -0
  11. {jquantstats-0.9.2 → jquantstats-0.9.3}/README.md +0 -0
  12. {jquantstats-0.9.2 → jquantstats-0.9.3}/src/jquantstats/__init__.py +0 -0
  13. {jquantstats-0.9.2 → jquantstats-0.9.3}/src/jquantstats/_cost_model.py +0 -0
  14. {jquantstats-0.9.2 → jquantstats-0.9.3}/src/jquantstats/_plots/__init__.py +0 -0
  15. {jquantstats-0.9.2 → jquantstats-0.9.3}/src/jquantstats/_plots/_data.py +0 -0
  16. {jquantstats-0.9.2 → jquantstats-0.9.3}/src/jquantstats/_plots/_portfolio.py +0 -0
  17. {jquantstats-0.9.2 → jquantstats-0.9.3}/src/jquantstats/_plots/_protocol.py +0 -0
  18. {jquantstats-0.9.2 → jquantstats-0.9.3}/src/jquantstats/_portfolio_attribution.py +0 -0
  19. {jquantstats-0.9.2 → jquantstats-0.9.3}/src/jquantstats/_portfolio_cost.py +0 -0
  20. {jquantstats-0.9.2 → jquantstats-0.9.3}/src/jquantstats/_portfolio_nav.py +0 -0
  21. {jquantstats-0.9.2 → jquantstats-0.9.3}/src/jquantstats/_portfolio_turnover.py +0 -0
  22. {jquantstats-0.9.2 → jquantstats-0.9.3}/src/jquantstats/_protocol.py +0 -0
  23. {jquantstats-0.9.2 → jquantstats-0.9.3}/src/jquantstats/_reports/__init__.py +0 -0
  24. {jquantstats-0.9.2 → jquantstats-0.9.3}/src/jquantstats/_reports/_data.py +0 -0
  25. {jquantstats-0.9.2 → jquantstats-0.9.3}/src/jquantstats/_reports/_formatting.py +0 -0
  26. {jquantstats-0.9.2 → jquantstats-0.9.3}/src/jquantstats/_reports/_portfolio.py +0 -0
  27. {jquantstats-0.9.2 → jquantstats-0.9.3}/src/jquantstats/_reports/_protocol.py +0 -0
  28. {jquantstats-0.9.2 → jquantstats-0.9.3}/src/jquantstats/_stats/__init__.py +0 -0
  29. {jquantstats-0.9.2 → jquantstats-0.9.3}/src/jquantstats/_stats/_basic.py +0 -0
  30. {jquantstats-0.9.2 → jquantstats-0.9.3}/src/jquantstats/_stats/_core.py +0 -0
  31. {jquantstats-0.9.2 → jquantstats-0.9.3}/src/jquantstats/_stats/_internals.py +0 -0
  32. {jquantstats-0.9.2 → jquantstats-0.9.3}/src/jquantstats/_stats/_montecarlo.py +0 -0
  33. {jquantstats-0.9.2 → jquantstats-0.9.3}/src/jquantstats/_stats/_performance.py +0 -0
  34. {jquantstats-0.9.2 → jquantstats-0.9.3}/src/jquantstats/_stats/_protocol.py +0 -0
  35. {jquantstats-0.9.2 → jquantstats-0.9.3}/src/jquantstats/_stats/_reporting.py +0 -0
  36. {jquantstats-0.9.2 → jquantstats-0.9.3}/src/jquantstats/_stats/_rolling.py +0 -0
  37. {jquantstats-0.9.2 → jquantstats-0.9.3}/src/jquantstats/_stats/_stats.py +0 -0
  38. {jquantstats-0.9.2 → jquantstats-0.9.3}/src/jquantstats/_types.py +0 -0
  39. {jquantstats-0.9.2 → jquantstats-0.9.3}/src/jquantstats/_utils/__init__.py +0 -0
  40. {jquantstats-0.9.2 → jquantstats-0.9.3}/src/jquantstats/_utils/_data.py +0 -0
  41. {jquantstats-0.9.2 → jquantstats-0.9.3}/src/jquantstats/_utils/_portfolio.py +0 -0
  42. {jquantstats-0.9.2 → jquantstats-0.9.3}/src/jquantstats/_utils/_protocol.py +0 -0
  43. {jquantstats-0.9.2 → jquantstats-0.9.3}/src/jquantstats/data.py +0 -0
  44. {jquantstats-0.9.2 → jquantstats-0.9.3}/src/jquantstats/exceptions.py +0 -0
  45. {jquantstats-0.9.2 → jquantstats-0.9.3}/src/jquantstats/py.typed +0 -0
  46. {jquantstats-0.9.2 → jquantstats-0.9.3}/src/jquantstats/result.py +0 -0
  47. {jquantstats-0.9.2 → jquantstats-0.9.3}/src/jquantstats/templates/_base.html +0 -0
  48. {jquantstats-0.9.2 → jquantstats-0.9.3}/src/jquantstats/templates/portfolio_report.html +0 -0
@@ -0,0 +1,263 @@
1
+ # Shell Completion for Rhiza Make Targets
2
+
3
+ This directory contains shell completion scripts for Bash and Zsh that provide tab-completion for make targets in Rhiza-based projects.
4
+
5
+ ## Features
6
+
7
+ - ✅ Tab-complete all available make targets
8
+ - ✅ Show target descriptions in Zsh
9
+ - ✅ Complete common make variables (DRY_RUN, BUMP, ENV, etc.)
10
+ - ✅ Works with any Rhiza-based project
11
+ - ✅ Auto-discovers targets from Makefile and included .mk files
12
+
13
+ ## Installation
14
+
15
+ ### Bash
16
+
17
+ #### Method 1: Source in your shell config
18
+
19
+ Add to your `~/.bashrc` or `~/.bash_profile`:
20
+
21
+ ```bash
22
+ # Rhiza make completion
23
+ if [ -f /path/to/project/.rhiza/completions/rhiza-completion.bash ]; then
24
+ source /path/to/project/.rhiza/completions/rhiza-completion.bash
25
+ fi
26
+ ```
27
+
28
+ Replace `/path/to/project` with the actual path to your Rhiza project.
29
+
30
+ #### Method 2: System-wide installation
31
+
32
+ ```bash
33
+ # Copy to bash completion directory
34
+ sudo cp .rhiza/completions/rhiza-completion.bash /etc/bash_completion.d/rhiza
35
+
36
+ # Reload completions
37
+ source /etc/bash_completion.d/rhiza
38
+ ```
39
+
40
+ #### Method 3: User-local installation
41
+
42
+ ```bash
43
+ # Create local completion directory
44
+ mkdir -p ~/.local/share/bash-completion/completions
45
+
46
+ # Copy completion script
47
+ cp .rhiza/completions/rhiza-completion.bash ~/.local/share/bash-completion/completions/make
48
+
49
+ # Reload bash
50
+ source ~/.bashrc
51
+ ```
52
+
53
+ ### Zsh
54
+
55
+ #### Method 1: User-local installation (Recommended)
56
+
57
+ ```bash
58
+ # Create completion directory
59
+ mkdir -p ~/.zsh/completion
60
+
61
+ # Copy completion script
62
+ cp .rhiza/completions/rhiza-completion.zsh ~/.zsh/completion/_make
63
+
64
+ # Add to ~/.zshrc (if not already present)
65
+ echo 'fpath=(~/.zsh/completion $fpath)' >> ~/.zshrc
66
+ echo 'autoload -U compinit && compinit' >> ~/.zshrc
67
+
68
+ # Reload zsh
69
+ source ~/.zshrc
70
+ ```
71
+
72
+ #### Method 2: Source directly
73
+
74
+ Add to your `~/.zshrc`:
75
+
76
+ ```zsh
77
+ # Rhiza make completion
78
+ if [ -f /path/to/project/.rhiza/completions/rhiza-completion.zsh ]; then
79
+ source /path/to/project/.rhiza/completions/rhiza-completion.zsh
80
+ fi
81
+ ```
82
+
83
+ #### Method 3: System-wide installation
84
+
85
+ ```bash
86
+ # Copy to system completion directory
87
+ sudo cp .rhiza/completions/rhiza-completion.zsh /usr/local/share/zsh/site-functions/_make
88
+
89
+ # Reload zsh
90
+ exec zsh
91
+ ```
92
+
93
+ ## Usage
94
+
95
+ Once installed, you can tab-complete make targets:
96
+
97
+ ```bash
98
+ # Tab-complete targets
99
+ make <TAB>
100
+
101
+ # Complete with prefix
102
+ make te<TAB> # Expands to: make test
103
+
104
+ # Complete variables
105
+ make BUMP=<TAB> # Shows: patch, minor, major
106
+
107
+ # Works with any target
108
+ make doc<TAB> # Shows: docs, docker-build, docker-run, etc.
109
+ ```
110
+
111
+ ### Zsh Benefits
112
+
113
+ In Zsh, you'll also see descriptions for targets:
114
+
115
+ ```bash
116
+ make <TAB>
117
+ # Shows:
118
+ # test -- run all tests
119
+ # fmt -- check the pre-commit hooks and the linting
120
+ # install -- install
121
+ # book -- build documentation site via zensical
122
+ # ...
123
+ ```
124
+
125
+ ## Common Variables
126
+
127
+ The completion scripts understand these common variables:
128
+
129
+ | Variable | Values | Description |
130
+ |----------|--------|-------------|
131
+ | `DRY_RUN` | `1` | Preview mode without making changes |
132
+ | `BUMP` | `patch`, `minor`, `major` | Version bump type |
133
+ | `ENV` | `dev`, `staging`, `prod` | Target environment |
134
+ | `COVERAGE_FAIL_UNDER` | (number) | Minimum coverage threshold |
135
+ | `PYTHON_VERSION` | (version) | Override Python version |
136
+
137
+ Example usage:
138
+
139
+ ```bash
140
+ # Tab-complete after typing DRY_
141
+ make DRY_<TAB> # Expands to: make DRY_RUN=1
142
+
143
+ # Tab-complete variable values
144
+ make BUMP=<TAB> # Shows: patch minor major
145
+
146
+ # Combine with targets
147
+ make bump BUMP=<TAB>
148
+ ```
149
+
150
+ ## Troubleshooting
151
+
152
+ ### Bash: Completions not working
153
+
154
+ 1. Check if bash-completion is installed:
155
+ ```bash
156
+ # Debian/Ubuntu
157
+ sudo apt-get install bash-completion
158
+
159
+ # macOS
160
+ brew install bash-completion@2
161
+ ```
162
+
163
+ 2. Ensure completion is enabled in your shell:
164
+ ```bash
165
+ # Add to ~/.bashrc if not present
166
+ if [ -f /etc/bash_completion ]; then
167
+ . /etc/bash_completion
168
+ fi
169
+ ```
170
+
171
+ 3. Reload your shell configuration:
172
+ ```bash
173
+ source ~/.bashrc
174
+ ```
175
+
176
+ ### Zsh: Completions not working
177
+
178
+ 1. Check if compinit is called in your `~/.zshrc`:
179
+ ```zsh
180
+ autoload -U compinit && compinit
181
+ ```
182
+
183
+ 2. Clear the completion cache:
184
+ ```bash
185
+ rm -f ~/.zcompdump
186
+ compinit
187
+ ```
188
+
189
+ 3. Ensure the script is in your fpath:
190
+ ```zsh
191
+ echo $fpath
192
+ ```
193
+
194
+ 4. Reload your shell configuration:
195
+ ```zsh
196
+ source ~/.zshrc
197
+ ```
198
+
199
+ ### No targets appearing
200
+
201
+ 1. Ensure you're in a directory with a Makefile:
202
+ ```bash
203
+ ls -la Makefile
204
+ ```
205
+
206
+ 2. Test that make can parse the Makefile:
207
+ ```bash
208
+ make -qp 2>/dev/null | head
209
+ ```
210
+
211
+ 3. Manually source the completion script to test:
212
+ ```bash
213
+ # Bash
214
+ source .rhiza/completions/rhiza-completion.bash
215
+
216
+ # Zsh
217
+ source .rhiza/completions/rhiza-completion.zsh
218
+ ```
219
+
220
+ ## Optional Aliases
221
+
222
+ You can add shortcuts in your shell config:
223
+
224
+ ```bash
225
+ # Add to ~/.bashrc or ~/.zshrc
226
+ alias m='make'
227
+
228
+ # For bash:
229
+ complete -F _rhiza_make_completion m
230
+
231
+ # For zsh:
232
+ compdef _rhiza_make m
233
+ ```
234
+
235
+ Then use:
236
+ ```bash
237
+ m te<TAB> # Expands to: m test
238
+ ```
239
+
240
+ ## Technical Details
241
+
242
+ ### How it works
243
+
244
+ 1. **Target Discovery**: Parses `make -qp` output to find all targets
245
+ 2. **Description Extraction**: Looks for `##` comments after target names
246
+ 3. **Variable Detection**: Includes common Makefile variables
247
+ 4. **Dynamic Completion**: Regenerates list each time you tab
248
+
249
+ ### Performance
250
+
251
+ - Completions are generated on-demand (when you press Tab)
252
+ - For large Makefiles (100+ targets), there may be a small delay
253
+ - Results are not cached to ensure targets are always current
254
+
255
+ ## See Also
256
+
257
+ - [Tools Reference](../../docs/reference/TOOLS_REFERENCE.md) - Complete command reference
258
+ - [Quick Reference](../../docs/guides/QUICK_REFERENCE.md) - Quick command reference
259
+ - [Extending Rhiza](../../docs/guides/EXTENDING_RHIZA.md) - How to add custom targets
260
+
261
+ ---
262
+
263
+ *Last updated: 2026-02-15*
@@ -1,14 +1,16 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: jquantstats
3
- Version: 0.9.2
3
+ Version: 0.9.3
4
4
  Summary: Analytics for quants
5
- Project-URL: repository, https://github.com/jebel-quant/jquantstats
5
+ Project-URL: Homepage, https://github.com/jebel-quant/jquantstats
6
+ Project-URL: Repository, https://github.com/jebel-quant/jquantstats
6
7
  Author-email: tschm <thomas.schmelzer@gmail.com>
7
8
  License-Expression: MIT
8
9
  License-File: LICENSE
9
10
  Classifier: Development Status :: 5 - Production/Stable
10
11
  Classifier: Intended Audience :: Financial and Insurance Industry
11
12
  Classifier: Intended Audience :: Science/Research
13
+ Classifier: License :: OSI Approved :: MIT License
12
14
  Classifier: Programming Language :: Python :: 3 :: Only
13
15
  Classifier: Programming Language :: Python :: 3.11
14
16
  Classifier: Programming Language :: Python :: 3.12
@@ -20,7 +22,7 @@ Requires-Dist: jinja2>=3.1.0
20
22
  Requires-Dist: narwhals>=2.0.0
21
23
  Requires-Dist: numpy>=2.0.0
22
24
  Requires-Dist: plotly>=6.0.0
23
- Requires-Dist: polars>=1.18.0
25
+ Requires-Dist: polars>=1.35.2
24
26
  Requires-Dist: scipy>=1.14.1
25
27
  Provides-Extra: plot
26
28
  Requires-Dist: kaleido==1.3.0; extra == 'plot'
@@ -1,7 +1,7 @@
1
1
  # Main project metadata
2
2
  [project]
3
3
  name = 'jquantstats'
4
- version = "0.9.2"
4
+ version = "0.9.3"
5
5
  description = "Analytics for quants"
6
6
  authors = [{name='tschm', email= 'thomas.schmelzer@gmail.com'}]
7
7
  readme = "README.md"
@@ -11,7 +11,7 @@ dependencies = [
11
11
  "narwhals>=2.0.0",
12
12
  "numpy>=2.0.0",
13
13
  "plotly>=6.0.0",
14
- "polars>=1.18.0",
14
+ "polars>=1.35.2",
15
15
  "scipy>=1.14.1"
16
16
  ]
17
17
  license = "MIT"
@@ -26,11 +26,13 @@ classifiers = [
26
26
  "Programming Language :: Python :: 3.11",
27
27
  "Programming Language :: Python :: 3.12",
28
28
  "Programming Language :: Python :: 3.13",
29
+ "License :: OSI Approved :: MIT License",
29
30
  ]
30
31
 
31
32
  # Project URLs for documentation and reference
32
33
  [project.urls]
33
- repository = "https://github.com/jebel-quant/jquantstats"
34
+ Homepage = "https://github.com/jebel-quant/jquantstats"
35
+ Repository = "https://github.com/jebel-quant/jquantstats"
34
36
 
35
37
  # Optional dependencies that can be installed with extras (e.g., pip install jquantstats[plot])
36
38
  [project.optional-dependencies]
@@ -45,12 +47,29 @@ web = [
45
47
  dev = [
46
48
  "pandas>=2.2.3", # required by quantstats (comparison tests only — not a runtime dependency)
47
49
  "pyarrow>=22.0.0",
48
- "yfinance==1.3.0",
49
- "ipython==9.13.0",
50
+ "yfinance==1.4.1",
51
+ "ipython==9.14.0",
50
52
  "quantstats==0.0.81", # reference implementation used in test_quantstats.py for metric validation
51
53
  "httpx>=0.28.1",
52
54
  "marimo>=0.23.6",
53
55
  ]
56
+ test = [
57
+ "pytest>=8.0",
58
+ "pytest-cov>=6.0",
59
+ "pytest-html>=4.0",
60
+ "pytest-mock>=3.0",
61
+ "pytest-xdist>=3.0",
62
+ "pytest-timeout>=2.0",
63
+ "pytest-benchmark>=5.2.3",
64
+ "hypothesis>=6.150.0",
65
+ "syrupy>=4.9.1",
66
+ "pygal>=3.1.0",
67
+ "python-dotenv>=1.0",
68
+ ]
69
+ lint = [
70
+ "pre-commit>=4.0",
71
+ "ty>=0.0.30",
72
+ ]
54
73
 
55
74
 
56
75
  # Build system configuration
@@ -522,7 +522,7 @@ class Portfolio(
522
522
  """
523
523
  if self._stats_cache is None:
524
524
  object.__setattr__(self, "_stats_cache", self.data.stats)
525
- return self._stats_cache # type: ignore[return-value]
525
+ return cast("Stats", self._stats_cache)
526
526
 
527
527
  @property
528
528
  def plots(self) -> PortfolioPlots:
@@ -539,7 +539,7 @@ class Portfolio(
539
539
  """
540
540
  if self._plots_cache is None:
541
541
  object.__setattr__(self, "_plots_cache", PortfolioPlots(self))
542
- return self._plots_cache # type: ignore[return-value]
542
+ return cast(PortfolioPlots, self._plots_cache)
543
543
 
544
544
  @property
545
545
  def report(self) -> Report:
@@ -556,7 +556,7 @@ class Portfolio(
556
556
  """
557
557
  if self._report_cache is None:
558
558
  object.__setattr__(self, "_report_cache", Report(self))
559
- return self._report_cache # type: ignore[return-value]
559
+ return cast(Report, self._report_cache)
560
560
 
561
561
  @property
562
562
  def utils(self) -> "PortfolioUtils":
@@ -576,7 +576,7 @@ class Portfolio(
576
576
  from ._utils import PortfolioUtils
577
577
 
578
578
  object.__setattr__(self, "_utils_cache", PortfolioUtils(self))
579
- return self._utils_cache # type: ignore[return-value]
579
+ return cast("PortfolioUtils", self._utils_cache)
580
580
 
581
581
  # ── Portfolio transforms ───────────────────────────────────────────────────
582
582
 
File without changes
File without changes
File without changes