Skip to content

Remove unused Index attributes #19397

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 4 commits into from
Jan 27, 2018
Merged
Show file tree
Hide file tree
Changes from 3 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
5 changes: 0 additions & 5 deletions pandas/core/indexes/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,10 @@ class Index(IndexOpsMixin, PandasObject):
_join_precedence = 1

# Cython methods
_arrmap = libalgos.arrmap_object
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so I think you can also remove some of the cython code which implements (not float/object though)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

arrmap_object is used in core.ops

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right, but can remve the rest of the code. pls add to the list.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right, but can remve the rest of the code. pls add to the list.

The rest of what code?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

arrmap in cython

_left_indexer_unique = libjoin.left_join_indexer_unique_object
_left_indexer = libjoin.left_join_indexer_object
_inner_indexer = libjoin.inner_join_indexer_object
_outer_indexer = libjoin.outer_join_indexer_object
_box_scalars = False

_typ = 'index'
_data = None
Expand All @@ -155,9 +153,6 @@ class Index(IndexOpsMixin, PandasObject):
asi8 = None
_comparables = ['name']
_attributes = ['name']
_allow_index_ops = True
_allow_datetime_index_ops = False
_allow_period_index_ops = False
_is_numeric_dtype = False
_can_hold_na = True

Expand Down
1 change: 0 additions & 1 deletion pandas/core/indexes/datetimes.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,6 @@ def _join_i8_wrapper(joinf, **kwargs):
_left_indexer = _join_i8_wrapper(libjoin.left_join_indexer_int64)
_left_indexer_unique = _join_i8_wrapper(
libjoin.left_join_indexer_unique_int64, with_indexers=False)
_arrmap = None

@classmethod
def _add_comparison_methods(cls):
Expand Down
1 change: 0 additions & 1 deletion pandas/core/indexes/interval.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,6 @@ class IntervalIndex(IntervalMixin, Index):
_typ = 'intervalindex'
_comparables = ['name']
_attributes = ['name', 'closed']
_allow_index_ops = True

# we would like our indexing holder to defer to us
_defer_to_indexing = True
Expand Down
5 changes: 1 addition & 4 deletions pandas/core/indexes/numeric.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import numpy as np
from pandas._libs import (index as libindex,
algos as libalgos, join as libjoin)
join as libjoin)
from pandas.core.dtypes.common import (
is_dtype_equal,
pandas_dtype,
Expand Down Expand Up @@ -158,7 +158,6 @@ class Int64Index(NumericIndex):
__doc__ = _num_index_shared_docs['class_descr'] % _int64_descr_args

_typ = 'int64index'
_arrmap = libalgos.arrmap_int64
_left_indexer_unique = libjoin.left_join_indexer_unique_int64
_left_indexer = libjoin.left_join_indexer_int64
_inner_indexer = libjoin.inner_join_indexer_int64
Expand Down Expand Up @@ -217,7 +216,6 @@ class UInt64Index(NumericIndex):
__doc__ = _num_index_shared_docs['class_descr'] % _uint64_descr_args

_typ = 'uint64index'
_arrmap = libalgos.arrmap_uint64
_left_indexer_unique = libjoin.left_join_indexer_unique_uint64
_left_indexer = libjoin.left_join_indexer_uint64
_inner_indexer = libjoin.inner_join_indexer_uint64
Expand Down Expand Up @@ -296,7 +294,6 @@ class Float64Index(NumericIndex):

_typ = 'float64index'
_engine_type = libindex.Float64Engine
_arrmap = libalgos.arrmap_float64
_left_indexer_unique = libjoin.left_join_indexer_unique_float64
_left_indexer = libjoin.left_join_indexer_float64
_inner_indexer = libjoin.inner_join_indexer_float64
Expand Down
1 change: 0 additions & 1 deletion pandas/core/indexes/period.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,6 @@ class PeriodIndex(DatelikeOps, DatetimeIndexOpsMixin, Int64Index):
DatetimeIndex : Index with datetime64 data
TimedeltaIndex : Index of timedelta64 data
"""
_box_scalars = True
_typ = 'periodindex'
_attributes = ['name', 'freq']

Expand Down
1 change: 0 additions & 1 deletion pandas/core/indexes/timedeltas.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ def _join_i8_wrapper(joinf, **kwargs):
_left_indexer = _join_i8_wrapper(libjoin.left_join_indexer_int64)
_left_indexer_unique = _join_i8_wrapper(
libjoin.left_join_indexer_unique_int64, with_indexers=False)
_arrmap = None

# define my properties & methods for delegation
_other_ops = []
Expand Down
1 change: 0 additions & 1 deletion pandas/core/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ class Series(base.IndexOpsMixin, generic.NDFrame):
_deprecations = generic.NDFrame._deprecations | frozenset(
['asobject', 'sortlevel', 'reshape', 'get_value', 'set_value',
'from_csv', 'valid'])
_allow_index_ops = True

def __init__(self, data=None, index=None, dtype=None, name=None,
copy=False, fastpath=False):
Expand Down
4 changes: 2 additions & 2 deletions pandas/tests/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,8 @@ class TestIndexOps(Ops):

def setup_method(self, method):
super(TestIndexOps, self).setup_method(method)
self.is_valid_objs = [o for o in self.objs if o._allow_index_ops]
self.not_valid_objs = [o for o in self.objs if not o._allow_index_ops]
self.is_valid_objs = self.objs
self.not_valid_objs = []

def test_none_comparison(self):

Expand Down