Skip to content

Commit 774c2a9

Browse files
authored
REF: Move BaseIndexers and indexer.py functions into their own directory (#43065)
1 parent 93cd8f3 commit 774c2a9

File tree

9 files changed

+50
-19
lines changed

9 files changed

+50
-19
lines changed

pandas/api/indexers/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"""
44

55
from pandas.core.indexers import check_array_indexer
6-
from pandas.core.window.indexers import (
6+
from pandas.core.indexers.objects import (
77
BaseIndexer,
88
FixedForwardWindowIndexer,
99
VariableOffsetWindowIndexer,

pandas/core/generic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,9 @@
164164
from pandas._libs.tslibs import BaseOffset
165165

166166
from pandas.core.frame import DataFrame
167+
from pandas.core.indexers.objects import BaseIndexer
167168
from pandas.core.resample import Resampler
168169
from pandas.core.series import Series
169-
from pandas.core.window.indexers import BaseIndexer
170170

171171
# goal is to be able to define the docs close to function, while still being
172172
# able to share

pandas/core/indexers/__init__.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
from pandas.core.indexers.utils import (
2+
check_array_indexer,
3+
check_key_length,
4+
check_setitem_lengths,
5+
deprecate_ndim_indexing,
6+
is_empty_indexer,
7+
is_exact_shape_match,
8+
is_list_like_indexer,
9+
is_scalar_indexer,
10+
is_valid_positional_slice,
11+
length_of_indexer,
12+
maybe_convert_indices,
13+
unpack_1tuple,
14+
validate_indices,
15+
)
16+
17+
__all__ = [
18+
"is_valid_positional_slice",
19+
"is_list_like_indexer",
20+
"is_scalar_indexer",
21+
"is_empty_indexer",
22+
"check_setitem_lengths",
23+
"validate_indices",
24+
"maybe_convert_indices",
25+
"is_exact_shape_match",
26+
"length_of_indexer",
27+
"deprecate_ndim_indexing",
28+
"unpack_1tuple",
29+
"check_key_length",
30+
"check_array_indexer",
31+
]
File renamed without changes.
File renamed without changes.

pandas/core/window/ewm.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@
2626
from pandas.core.dtypes.missing import isna
2727

2828
import pandas.core.common as common # noqa: PDF018
29+
from pandas.core.indexers.objects import (
30+
BaseIndexer,
31+
ExponentialMovingWindowIndexer,
32+
GroupbyIndexer,
33+
)
2934
from pandas.core.util.numba_ import maybe_use_numba
3035
from pandas.core.window.common import zsqrt
3136
from pandas.core.window.doc import (
@@ -39,11 +44,6 @@
3944
template_see_also,
4045
window_agg_numba_parameters,
4146
)
42-
from pandas.core.window.indexers import (
43-
BaseIndexer,
44-
ExponentialMovingWindowIndexer,
45-
GroupbyIndexer,
46-
)
4747
from pandas.core.window.numba_ import (
4848
generate_ewma_numba_table_func,
4949
generate_numba_ewma_func,

pandas/core/window/expanding.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@
1818
from pandas.compat.numpy import function as nv
1919
from pandas.util._decorators import doc
2020

21+
from pandas.core.indexers.objects import (
22+
BaseIndexer,
23+
ExpandingIndexer,
24+
GroupbyIndexer,
25+
)
2126
from pandas.core.window.doc import (
2227
_shared_docs,
2328
args_compat,
@@ -30,11 +35,6 @@
3035
window_agg_numba_parameters,
3136
window_apply_parameters,
3237
)
33-
from pandas.core.window.indexers import (
34-
BaseIndexer,
35-
ExpandingIndexer,
36-
GroupbyIndexer,
37-
)
3838
from pandas.core.window.rolling import (
3939
BaseWindowGroupby,
4040
RollingAndExpandingMixin,

pandas/core/window/rolling.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@
5555
SelectionMixin,
5656
)
5757
import pandas.core.common as com
58+
from pandas.core.indexers.objects import (
59+
BaseIndexer,
60+
FixedWindowIndexer,
61+
GroupbyIndexer,
62+
VariableWindowIndexer,
63+
)
5864
from pandas.core.indexes.api import (
5965
DatetimeIndex,
6066
Index,
@@ -85,12 +91,6 @@
8591
window_agg_numba_parameters,
8692
window_apply_parameters,
8793
)
88-
from pandas.core.window.indexers import (
89-
BaseIndexer,
90-
FixedWindowIndexer,
91-
GroupbyIndexer,
92-
VariableWindowIndexer,
93-
)
9494
from pandas.core.window.numba_ import (
9595
generate_manual_numpy_nan_agg_with_axis,
9696
generate_numba_apply_func,

pandas/tests/window/test_base_indexer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
BaseIndexer,
1212
FixedForwardWindowIndexer,
1313
)
14-
from pandas.core.window.indexers import (
14+
from pandas.core.indexers.objects import (
1515
ExpandingIndexer,
1616
VariableOffsetWindowIndexer,
1717
)

0 commit comments

Comments
 (0)