Skip to content

Commit

Permalink
Mark other rolling as unstable
Browse files Browse the repository at this point in the history
  • Loading branch information
stinodego committed Jan 24, 2024
1 parent 2cc3592 commit b03b5b7
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 3 deletions.
10 changes: 10 additions & 0 deletions py-polars/polars/functions/lazy.py
Original file line number Diff line number Diff line change
Expand Up @@ -2031,6 +2031,7 @@ def from_epoch(
raise ValueError(msg)


@unstable()
def rolling_cov(
a: str | Expr,
b: str | Expr,
Expand All @@ -2042,6 +2043,10 @@ def rolling_cov(
"""
Compute the rolling covariance between two columns/ expressions.
.. warning::
This functionality is considered **unstable**. It may be changed
at any point without it being considered a breaking change.
The window at a given row includes the row itself and the
`window_size - 1` elements before it.
Expand Down Expand Up @@ -2071,6 +2076,7 @@ def rolling_cov(
)


@unstable()
def rolling_corr(
a: str | Expr,
b: str | Expr,
Expand All @@ -2082,6 +2088,10 @@ def rolling_corr(
"""
Compute the rolling correlation between two columns/ expressions.
.. warning::
This functionality is considered **unstable**. It may be changed
at any point without it being considered a breaking change.
The window at a given row includes the row itself and the
`window_size - 1` elements before it.
Expand Down
53 changes: 50 additions & 3 deletions py-polars/polars/series/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -5398,6 +5398,7 @@ def zip_with(self, mask: Series, other: Series) -> Self:
"""
return self._from_pyseries(self._s.zip_with(mask._s, other._s))

@unstable()
def rolling_min(
self,
window_size: int,
Expand All @@ -5409,6 +5410,10 @@ def rolling_min(
"""
Apply a rolling min (moving min) over the values in this array.
.. warning::
This functionality is considered **unstable**. It may be changed
at any point without it being considered a breaking change.
A window of length `window_size` will traverse the array. The values that fill
this window will (optionally) be multiplied with the weights given by the
`weight` vector. The resulting values will be aggregated to their min.
Expand Down Expand Up @@ -5456,6 +5461,7 @@ def rolling_min(
.to_series()
)

@unstable()
def rolling_max(
self,
window_size: int,
Expand All @@ -5467,6 +5473,10 @@ def rolling_max(
"""
Apply a rolling max (moving max) over the values in this array.
.. warning::
This functionality is considered **unstable**. It may be changed
at any point without it being considered a breaking change.
A window of length `window_size` will traverse the array. The values that fill
this window will (optionally) be multiplied with the weights given by the
`weight` vector. The resulting values will be aggregated to their max.
Expand Down Expand Up @@ -5514,6 +5524,7 @@ def rolling_max(
.to_series()
)

@unstable()
def rolling_mean(
self,
window_size: int,
Expand All @@ -5525,6 +5536,10 @@ def rolling_mean(
"""
Apply a rolling mean (moving mean) over the values in this array.
.. warning::
This functionality is considered **unstable**. It may be changed
at any point without it being considered a breaking change.
A window of length `window_size` will traverse the array. The values that fill
this window will (optionally) be multiplied with the weights given by the
`weight` vector. The resulting values will be aggregated to their mean.
Expand Down Expand Up @@ -5572,6 +5587,7 @@ def rolling_mean(
.to_series()
)

@unstable()
def rolling_sum(
self,
window_size: int,
Expand All @@ -5583,6 +5599,10 @@ def rolling_sum(
"""
Apply a rolling sum (moving sum) over the values in this array.
.. warning::
This functionality is considered **unstable**. It may be changed
at any point without it being considered a breaking change.
A window of length `window_size` will traverse the array. The values that fill
this window will (optionally) be multiplied with the weights given by the
`weight` vector. The resulting values will be aggregated to their sum.
Expand Down Expand Up @@ -5630,6 +5650,7 @@ def rolling_sum(
.to_series()
)

@unstable()
def rolling_std(
self,
window_size: int,
Expand All @@ -5642,6 +5663,10 @@ def rolling_std(
"""
Compute a rolling std dev.
.. warning::
This functionality is considered **unstable**. It may be changed
at any point without it being considered a breaking change.
A window of length `window_size` will traverse the array. The values that fill
this window will (optionally) be multiplied with the weights given by the
`weight` vector. The resulting values will be aggregated to their std dev.
Expand Down Expand Up @@ -5692,6 +5717,7 @@ def rolling_std(
.to_series()
)

@unstable()
def rolling_var(
self,
window_size: int,
Expand All @@ -5704,6 +5730,10 @@ def rolling_var(
"""
Compute a rolling variance.
.. warning::
This functionality is considered **unstable**. It may be changed
at any point without it being considered a breaking change.
A window of length `window_size` will traverse the array. The values that fill
this window will (optionally) be multiplied with the weights given by the
`weight` vector. The resulting values will be aggregated to their variance.
Expand Down Expand Up @@ -5754,6 +5784,7 @@ def rolling_var(
.to_series()
)

@unstable()
def rolling_map(
self,
function: Callable[[Series], Any],
Expand All @@ -5767,8 +5798,8 @@ def rolling_map(
Compute a custom rolling window function.
.. warning::
Computing custom functions is extremely slow. Use specialized rolling
functions such as :func:`Series.rolling_sum` if at all possible.
This functionality is considered **unstable**. It may be changed
at any point without it being considered a breaking change.
Parameters
----------
Expand All @@ -5791,7 +5822,8 @@ def rolling_map(
Warnings
--------
Computing custom functions is extremely slow. Use specialized rolling
functions such as :func:`Series.rolling_sum` if at all possible.
Examples
--------
Expand All @@ -5809,6 +5841,7 @@ def rolling_map(
]
"""

@unstable()
def rolling_median(
self,
window_size: int,
Expand All @@ -5820,6 +5853,10 @@ def rolling_median(
"""
Compute a rolling median.
.. warning::
This functionality is considered **unstable**. It may be changed
at any point without it being considered a breaking change.
Parameters
----------
window_size
Expand Down Expand Up @@ -5867,6 +5904,7 @@ def rolling_median(
.to_series()
)

@unstable()
def rolling_quantile(
self,
quantile: float,
Expand All @@ -5880,6 +5918,10 @@ def rolling_quantile(
"""
Compute a rolling quantile.
.. warning::
This functionality is considered **unstable**. It may be changed
at any point without it being considered a breaking change.
The window at a given row will include the row itself and the `window_size - 1`
elements before it.
Expand Down Expand Up @@ -5947,10 +5989,15 @@ def rolling_quantile(
.to_series()
)

@unstable()
def rolling_skew(self, window_size: int, *, bias: bool = True) -> Series:
"""
Compute a rolling skew.
.. warning::
This functionality is considered **unstable**. It may be changed
at any point without it being considered a breaking change.
The window at a given row includes the row itself and the
`window_size - 1` elements before it.
Expand Down

0 comments on commit b03b5b7

Please sign in to comment.