Skip to content

Commit

Permalink
some cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
TomAugspurger committed Dec 5, 2018
1 parent 4f1ee37 commit a117de4
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 15 deletions.
5 changes: 0 additions & 5 deletions pandas/core/dtypes/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,6 @@ class _DtypeOpsMixin(object):
na_value = np.nan
_metadata = ()

@property
def _ndarray_na_value(self):
"""Private method internal to pandas"""
raise AbstractMethodError(self)

def __eq__(self, other):
"""Check whether 'other' is equal to self.
Expand Down
1 change: 0 additions & 1 deletion pandas/core/dtypes/cast.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,6 @@ def changeit():

def maybe_promote(dtype, fill_value=np.nan):
# if we passed an array here, determine the fill value by dtype

if isinstance(fill_value, np.ndarray):
if issubclass(fill_value.dtype.type, (np.datetime64, np.timedelta64)):
fill_value = iNaT
Expand Down
1 change: 0 additions & 1 deletion pandas/core/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -9661,7 +9661,6 @@ def describe_categorical_1d(data):

if is_datetime64_any_dtype(data):
tz = data.dt.tz
# astype for ndarray / datetimearray compat.
asint = data.dropna().values.view('i8')
top = Timestamp(top)
if top.tzinfo is not None and tz is not None:
Expand Down
13 changes: 5 additions & 8 deletions pandas/core/indexes/datetimelike.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,9 @@ def equals(self, other):

@staticmethod
def _join_i8_wrapper(joinf, dtype, with_indexers=True):
"""Create the join wrapper methods."""
"""
Create the join wrapper methods.
"""
from pandas.core.arrays.datetimelike import DatetimeLikeArrayMixin

@staticmethod
Expand Down Expand Up @@ -195,7 +197,7 @@ def sort_values(self, return_indexer=False, ascending=True):
else:
sorted_values = np.sort(self._ndarray_values)
attribs = self._get_attributes_dict()
freq = self.freq
freq = attribs['freq']

if freq is not None and not is_period_dtype(self):
if freq.n > 0 and not ascending:
Expand Down Expand Up @@ -637,12 +639,6 @@ def _time_shift(self, periods, freq=None):
result.name = self.name
return result

# -
# dispatch

def _has_same_tz(self, other):
return self._data._has_same_tz(other)

@classmethod
def _create_comparison_method(cls, op):
"""
Expand Down Expand Up @@ -702,6 +698,7 @@ def index_method(self, *args, **kwargs):
if pin_name:
result.name = self.name
return result
return result

index_method.__name__ = method.__name__
index_method.__doc__ = method.__doc__
Expand Down
1 change: 1 addition & 0 deletions pandas/core/indexes/datetimes.py
Original file line number Diff line number Diff line change
Expand Up @@ -1257,6 +1257,7 @@ def slice_indexer(self, start=None, end=None, step=None, kind=None):
False)
month_name = wrap_array_method(DatetimeArray.month_name, True)
day_name = wrap_array_method(DatetimeArray.day_name, True)
_has_same_tz = wrap_array_method(DatetimeArray._has_same_tz, box=False)

# --------------------------------------------------------------------

Expand Down

0 comments on commit a117de4

Please sign in to comment.