Skip to content

Commit 43e732e

Browse files
dependabot[bot]tschmclaude
authored
chore(deps)(deps): bump the python-dependencies group with 4 updates (#896)
Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Thomas Schmelzer <thomas.schmelzer@gmail.com> Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 15890a6 commit 43e732e

4 files changed

Lines changed: 110 additions & 102 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ dependencies = [
1111
"narwhals>=2.0.0",
1212
"numpy>=2.0.0",
1313
"plotly>=6.1.1",
14-
"polars>=1.42.1",
14+
"polars>=1.43.0",
1515
"scipy>=1.14.1"
1616
]
1717
license = "MIT"

src/jquantstats/_utils/_data.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,9 @@ def exponential_stdev(self, window: int = 30, is_halflife: bool = False) -> pl.D
284284
285285
Returns:
286286
DataFrame of rolling EWMA standard deviations with the same
287-
columns as the input returns.
287+
columns as the input returns. The first row is ``null``: an
288+
unbiased standard deviation of a single observation is
289+
undefined, as in ``pandas.Series.ewm(...).std()``.
288290
289291
"""
290292
asset_cols = self._asset_cols()

tests/test_jquantstats/test__utils/test_data_mutation_kills.py

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -292,16 +292,21 @@ def test_exponential_stdev_defaults_span_30(varied_data):
292292
assert default.equals(explicit)
293293

294294

295-
def test_exponential_stdev_halflife_first_row_defined(varied_data):
296-
"""min_samples=1 must yield a value already at the first row (half-life mode)."""
295+
def test_exponential_stdev_halflife_second_row_defined(varied_data):
296+
"""min_samples=1 must yield a value from the second row on (half-life mode).
297+
298+
Row 0 is ``None`` by construction: an unbiased standard deviation of a
299+
single observation is undefined (this matches ``pandas.ewm(...).std()``).
300+
A larger ``min_samples`` would leave row 1 null too.
301+
"""
297302
result = varied_data.utils.exponential_stdev(window=5, is_halflife=True)
298-
assert result["A"][0] is not None
303+
assert result["A"][1] is not None
299304

300305

301-
def test_exponential_stdev_span_first_row_defined(varied_data):
302-
"""min_samples=1 must yield a value already at the first row (span mode)."""
306+
def test_exponential_stdev_span_second_row_defined(varied_data):
307+
"""min_samples=1 must yield a value from the second row on (span mode)."""
303308
result = varied_data.utils.exponential_stdev(window=5, is_halflife=False)
304-
assert result["A"][0] is not None
309+
assert result["A"][1] is not None
305310

306311

307312
def test_exponential_stdev_halflife_constant_returns_zero():
@@ -310,7 +315,8 @@ def test_exponential_stdev_halflife_constant_returns_zero():
310315
result = data.utils.exponential_stdev(window=5, is_halflife=True)
311316
values = result["A"].to_list()
312317
assert len(values) == 30
313-
for v in values:
318+
assert values[0] is None
319+
for v in values[1:]:
314320
assert v is not None
315321
assert abs(v) <= TOL_FLOAT64
316322

0 commit comments

Comments
 (0)