Skip to content

Commit ff2b70c

Browse files
mroeschkeMatt Roeschke
and
Matt Roeschke
authored
REF: Rename NonFixedVariableWindowIndexer to VariableOffsetWindowIndexer (#35059)
Co-authored-by: Matt Roeschke <[email protected]>
1 parent 867aea2 commit ff2b70c

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

doc/source/user_guide/computation.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -597,15 +597,15 @@ You can view other examples of ``BaseIndexer`` subclasses `here <https://github.
597597

598598
.. versionadded:: 1.1
599599

600-
One subclass of note within those examples is the ``NonFixedVariableWindowIndexer`` that allows
600+
One subclass of note within those examples is the ``VariableOffsetWindowIndexer`` that allows
601601
rolling operations over a non-fixed offset like a ``BusinessDay``.
602602

603603
.. ipython:: python
604604
605-
from pandas.api.indexers import NonFixedVariableWindowIndexer
605+
from pandas.api.indexers import VariableOffsetWindowIndexer
606606
df = pd.DataFrame(range(10), index=pd.date_range('2020', periods=10))
607607
offset = pd.offsets.BDay(1)
608-
indexer = NonFixedVariableWindowIndexer(index=df.index, offset=offset)
608+
indexer = VariableOffsetWindowIndexer(index=df.index, offset=offset)
609609
df
610610
df.rolling(indexer).sum()
611611

doc/source/whatsnew/v1.1.0.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,7 @@ Other API changes
673673
- ``loc`` lookups with an object-dtype :class:`Index` and an integer key will now raise ``KeyError`` instead of ``TypeError`` when key is missing (:issue:`31905`)
674674
- Using a :func:`pandas.api.indexers.BaseIndexer` with ``count``, ``min``, ``max``, ``median``, ``skew``, ``cov``, ``corr`` will now return correct results for any monotonic :func:`pandas.api.indexers.BaseIndexer` descendant (:issue:`32865`)
675675
- Added a :func:`pandas.api.indexers.FixedForwardWindowIndexer` class to support forward-looking windows during ``rolling`` operations.
676-
- Added a :func:`pandas.api.indexers.NonFixedVariableWindowIndexer` class to support ``rolling`` operations with non-fixed offsets (:issue:`34994`)
676+
- Added a :func:`pandas.api.indexers.VariableOffsetWindowIndexer` class to support ``rolling`` operations with non-fixed offsets (:issue:`34994`)
677677
- Added :class:`pandas.errors.InvalidIndexError` (:issue:`34570`).
678678
- :meth:`DataFrame.swaplevels` now raises a ``TypeError`` if the axis is not a :class:`MultiIndex`.
679679
Previously an ``AttributeError`` was raised (:issue:`31126`)

pandas/api/indexers/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
from pandas.core.window.indexers import (
77
BaseIndexer,
88
FixedForwardWindowIndexer,
9-
NonFixedVariableWindowIndexer,
9+
VariableOffsetWindowIndexer,
1010
)
1111

1212
__all__ = [
1313
"check_array_indexer",
1414
"BaseIndexer",
1515
"FixedForwardWindowIndexer",
16-
"NonFixedVariableWindowIndexer",
16+
"VariableOffsetWindowIndexer",
1717
]

pandas/core/window/indexers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def get_window_bounds(
107107
)
108108

109109

110-
class NonFixedVariableWindowIndexer(BaseIndexer):
110+
class VariableOffsetWindowIndexer(BaseIndexer):
111111
"""Calculate window boundaries based on a non-fixed offset such as a BusinessDay"""
112112

113113
def __init__(

pandas/tests/window/test_base_indexer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from pandas import DataFrame, Series, date_range
55
import pandas._testing as tm
66
from pandas.api.indexers import BaseIndexer, FixedForwardWindowIndexer
7-
from pandas.core.window.indexers import ExpandingIndexer, NonFixedVariableWindowIndexer
7+
from pandas.core.window.indexers import ExpandingIndexer, VariableOffsetWindowIndexer
88

99
from pandas.tseries.offsets import BusinessDay
1010

@@ -249,7 +249,7 @@ def test_non_fixed_variable_window_indexer(closed, expected_data):
249249
index = date_range("2020", periods=10)
250250
df = DataFrame(range(10), index=index)
251251
offset = BusinessDay(1)
252-
indexer = NonFixedVariableWindowIndexer(index=index, offset=offset)
252+
indexer = VariableOffsetWindowIndexer(index=index, offset=offset)
253253
result = df.rolling(indexer, closed=closed).sum()
254254
expected = DataFrame(expected_data, index=index)
255255
tm.assert_frame_equal(result, expected)

0 commit comments

Comments
 (0)