Skip to content

REF: Move BaseIndexers and indexer.py functions into their own directory #43065

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pandas/api/indexers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""

from pandas.core.indexers import check_array_indexer
from pandas.core.window.indexers import (
from pandas.core.indexers.objects import (
BaseIndexer,
FixedForwardWindowIndexer,
VariableOffsetWindowIndexer,
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,9 @@
from pandas._libs.tslibs import BaseOffset

from pandas.core.frame import DataFrame
from pandas.core.indexers.objects import BaseIndexer
from pandas.core.resample import Resampler
from pandas.core.series import Series
from pandas.core.window.indexers import BaseIndexer

# goal is to be able to define the docs close to function, while still being
# able to share
Expand Down
31 changes: 31 additions & 0 deletions pandas/core/indexers/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
from pandas.core.indexers.utils import (
check_array_indexer,
check_key_length,
check_setitem_lengths,
deprecate_ndim_indexing,
is_empty_indexer,
is_exact_shape_match,
is_list_like_indexer,
is_scalar_indexer,
is_valid_positional_slice,
length_of_indexer,
maybe_convert_indices,
unpack_1tuple,
validate_indices,
)

__all__ = [
"is_valid_positional_slice",
"is_list_like_indexer",
"is_scalar_indexer",
"is_empty_indexer",
"check_setitem_lengths",
"validate_indices",
"maybe_convert_indices",
"is_exact_shape_match",
"length_of_indexer",
"deprecate_ndim_indexing",
"unpack_1tuple",
"check_key_length",
"check_array_indexer",
]
File renamed without changes.
File renamed without changes.
10 changes: 5 additions & 5 deletions pandas/core/window/ewm.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@
from pandas.core.dtypes.missing import isna

import pandas.core.common as common # noqa: PDF018
from pandas.core.indexers.objects import (
BaseIndexer,
ExponentialMovingWindowIndexer,
GroupbyIndexer,
)
from pandas.core.util.numba_ import maybe_use_numba
from pandas.core.window.common import zsqrt
from pandas.core.window.doc import (
Expand All @@ -39,11 +44,6 @@
template_see_also,
window_agg_numba_parameters,
)
from pandas.core.window.indexers import (
BaseIndexer,
ExponentialMovingWindowIndexer,
GroupbyIndexer,
)
from pandas.core.window.numba_ import (
generate_ewma_numba_table_func,
generate_numba_ewma_func,
Expand Down
10 changes: 5 additions & 5 deletions pandas/core/window/expanding.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@
from pandas.compat.numpy import function as nv
from pandas.util._decorators import doc

from pandas.core.indexers.objects import (
BaseIndexer,
ExpandingIndexer,
GroupbyIndexer,
)
from pandas.core.window.doc import (
_shared_docs,
args_compat,
Expand All @@ -30,11 +35,6 @@
window_agg_numba_parameters,
window_apply_parameters,
)
from pandas.core.window.indexers import (
BaseIndexer,
ExpandingIndexer,
GroupbyIndexer,
)
from pandas.core.window.rolling import (
BaseWindowGroupby,
RollingAndExpandingMixin,
Expand Down
12 changes: 6 additions & 6 deletions pandas/core/window/rolling.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@
SelectionMixin,
)
import pandas.core.common as com
from pandas.core.indexers.objects import (
BaseIndexer,
FixedWindowIndexer,
GroupbyIndexer,
VariableWindowIndexer,
)
from pandas.core.indexes.api import (
DatetimeIndex,
Index,
Expand Down Expand Up @@ -85,12 +91,6 @@
window_agg_numba_parameters,
window_apply_parameters,
)
from pandas.core.window.indexers import (
BaseIndexer,
FixedWindowIndexer,
GroupbyIndexer,
VariableWindowIndexer,
)
from pandas.core.window.numba_ import (
generate_manual_numpy_nan_agg_with_axis,
generate_numba_apply_func,
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/window/test_base_indexer.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
BaseIndexer,
FixedForwardWindowIndexer,
)
from pandas.core.window.indexers import (
from pandas.core.indexers.objects import (
ExpandingIndexer,
VariableOffsetWindowIndexer,
)
Expand Down