Skip to content

Commit

Permalink
CLN: Finish isort core (#23765)
Browse files Browse the repository at this point in the history
  • Loading branch information
alimcmaster1 authored and jreback committed Nov 20, 2018
1 parent 1952afa commit 6fad5a0
Show file tree
Hide file tree
Showing 20 changed files with 227 additions and 359 deletions.
14 changes: 8 additions & 6 deletions pandas/core/arrays/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,18 @@
This is an experimental API and subject to breaking changes
without warning.
"""
import numpy as np

import operator

from pandas.core.dtypes.generic import ABCSeries, ABCIndexClass
from pandas.errors import AbstractMethodError
import numpy as np

from pandas.compat import PY3, set_function_name
from pandas.compat.numpy import function as nv
from pandas.compat import set_function_name, PY3
from pandas.core import ops
from pandas.errors import AbstractMethodError

from pandas.core.dtypes.common import is_list_like
from pandas.core.dtypes.generic import ABCIndexClass, ABCSeries

from pandas.core import ops

_not_implemented_message = "{} does not implement {}."

Expand Down
67 changes: 26 additions & 41 deletions pandas/core/arrays/categorical.py
Original file line number Diff line number Diff line change
@@ -1,61 +1,46 @@
# pylint: disable=E1101,W0232

import numpy as np
from warnings import warn
import textwrap
from warnings import warn

from pandas import compat
from pandas.compat import u, lzip
from pandas._libs import lib, algos as libalgos
import numpy as np

from pandas._libs import algos as libalgos, lib
import pandas.compat as compat
from pandas.compat import lzip, u
from pandas.compat.numpy import function as nv
from pandas.util._decorators import (
Appender, Substitution, cache_readonly, deprecate_kwarg)
from pandas.util._validators import validate_bool_kwarg, validate_fillna_kwargs

from pandas.core.dtypes.generic import (
ABCSeries, ABCIndexClass, ABCCategoricalIndex)
from pandas.core.dtypes.missing import isna, notna
from pandas.core.dtypes.inference import is_hashable
from pandas.core.dtypes.cast import (
maybe_infer_to_datetimelike,
coerce_indexer_dtype)
from pandas.core.dtypes.dtypes import CategoricalDtype
coerce_indexer_dtype, maybe_infer_to_datetimelike)
from pandas.core.dtypes.common import (
ensure_int64,
ensure_object,
ensure_platform_int,
is_extension_array_dtype,
is_dtype_equal,
is_datetimelike,
is_datetime64_dtype,
is_timedelta64_dtype,
is_categorical,
is_categorical_dtype,
is_float_dtype,
is_integer_dtype,
is_object_dtype,
is_list_like, is_sequence,
is_scalar, is_iterator,
is_dict_like)

from pandas.core.algorithms import factorize, take_1d, unique1d, take
ensure_int64, ensure_object, ensure_platform_int, is_categorical,
is_categorical_dtype, is_datetime64_dtype, is_datetimelike, is_dict_like,
is_dtype_equal, is_extension_array_dtype, is_float_dtype, is_integer_dtype,
is_iterator, is_list_like, is_object_dtype, is_scalar, is_sequence,
is_timedelta64_dtype)
from pandas.core.dtypes.dtypes import CategoricalDtype
from pandas.core.dtypes.generic import (
ABCCategoricalIndex, ABCIndexClass, ABCSeries)
from pandas.core.dtypes.inference import is_hashable
from pandas.core.dtypes.missing import isna, notna

from pandas.core.accessor import PandasDelegate, delegate_names
from pandas.core.base import (PandasObject,
NoNewAttributesMixin, _shared_docs)
import pandas.core.algorithms as algorithms
from pandas.core.algorithms import factorize, take, take_1d, unique1d
from pandas.core.base import NoNewAttributesMixin, PandasObject, _shared_docs
import pandas.core.common as com
from pandas.core.config import get_option
from pandas.core.missing import interpolate_2d
from pandas.compat.numpy import function as nv
from pandas.util._decorators import (
Appender, cache_readonly, deprecate_kwarg, Substitution)

import pandas.core.algorithms as algorithms

from pandas.core.sorting import nargsort

from pandas.io.formats import console
from pandas.io.formats.terminal import get_terminal_size
from pandas.util._validators import validate_bool_kwarg, validate_fillna_kwargs
from pandas.core.config import get_option

from .base import ExtensionArray


_take_msg = textwrap.dedent("""\
Interpreting negative values in 'indexer' as missing values.
In the future, this will change to meaning positional indices
Expand Down
41 changes: 15 additions & 26 deletions pandas/core/arrays/datetimelike.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,44 +5,33 @@

import numpy as np

from pandas._libs import lib, iNaT, NaT
from pandas._libs import NaT, iNaT, lib
from pandas._libs.tslibs import timezones
from pandas._libs.tslibs.timedeltas import delta_to_nanoseconds, Timedelta
from pandas._libs.tslibs.timestamps import maybe_integer_op_deprecated
from pandas._libs.tslibs.period import (
Period, DIFFERENT_FREQ_INDEX, IncompatibleFrequency)

DIFFERENT_FREQ_INDEX, IncompatibleFrequency, Period)
from pandas._libs.tslibs.timedeltas import Timedelta, delta_to_nanoseconds
from pandas._libs.tslibs.timestamps import maybe_integer_op_deprecated
import pandas.compat as compat
from pandas.errors import (
AbstractMethodError, NullFrequencyError, PerformanceWarning)
from pandas import compat

from pandas.tseries import frequencies
from pandas.tseries.offsets import Tick, DateOffset
from pandas.util._decorators import deprecate_kwarg

from pandas.core.dtypes.common import (
pandas_dtype,
needs_i8_conversion,
is_list_like,
is_offsetlike,
is_extension_array_dtype,
is_datetime64_dtype,
is_datetime64_any_dtype,
is_datetime64tz_dtype,
is_float_dtype,
is_integer_dtype,
is_bool_dtype,
is_period_dtype,
is_timedelta64_dtype,
is_object_dtype)
from pandas.core.dtypes.generic import ABCSeries, ABCDataFrame, ABCIndexClass
is_bool_dtype, is_datetime64_any_dtype, is_datetime64_dtype,
is_datetime64tz_dtype, is_extension_array_dtype, is_float_dtype,
is_integer_dtype, is_list_like, is_object_dtype, is_offsetlike,
is_period_dtype, is_timedelta64_dtype, needs_i8_conversion, pandas_dtype)
from pandas.core.dtypes.dtypes import DatetimeTZDtype
from pandas.core.dtypes.generic import ABCDataFrame, ABCIndexClass, ABCSeries
from pandas.core.dtypes.missing import isna

import pandas.core.common as com
from pandas.core.algorithms import checked_add_with_arr, take, unique1d
import pandas.core.common as com

from pandas.tseries import frequencies
from pandas.tseries.offsets import DateOffset, Tick

from .base import ExtensionOpsMixin
from pandas.util._decorators import deprecate_kwarg


def _make_comparison_op(cls, op):
Expand Down
31 changes: 12 additions & 19 deletions pandas/core/arrays/datetimes.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,35 +6,28 @@
from pytz import utc

from pandas._libs import lib, tslib
from pandas._libs.tslib import Timestamp, NaT, iNaT
from pandas._libs.tslib import NaT, Timestamp, iNaT
from pandas._libs.tslibs import (
ccalendar, normalize_date,
conversion, fields, timezones,
resolution as libresolution)

from pandas.util._decorators import cache_readonly, Appender
ccalendar, conversion, fields, normalize_date, resolution as libresolution,
timezones)
import pandas.compat as compat
from pandas.errors import PerformanceWarning
from pandas import compat
from pandas.util._decorators import Appender, cache_readonly

from pandas.core.dtypes.common import (
_NS_DTYPE,
is_object_dtype,
is_int64_dtype,
is_datetime64tz_dtype,
is_datetime64_dtype)
_NS_DTYPE, is_datetime64_dtype, is_datetime64tz_dtype, is_int64_dtype,
is_object_dtype)
from pandas.core.dtypes.dtypes import DatetimeTZDtype
from pandas.core.dtypes.missing import isna
from pandas.core.dtypes.generic import ABCIndexClass, ABCSeries
from pandas.core.dtypes.missing import isna

import pandas.core.common as com
from pandas.core.algorithms import checked_add_with_arr
from pandas.core import ops

from pandas.tseries.frequencies import to_offset, get_period_alias
from pandas.tseries.offsets import Tick, generate_range

from pandas.core.algorithms import checked_add_with_arr
from pandas.core.arrays import datetimelike as dtl
import pandas.core.common as com

from pandas.tseries.frequencies import get_period_alias, to_offset
from pandas.tseries.offsets import Tick, generate_range

_midnight = time(0, 0)

Expand Down
26 changes: 11 additions & 15 deletions pandas/core/arrays/integer.py
Original file line number Diff line number Diff line change
@@ -1,31 +1,27 @@
import copy
import sys
import warnings
import copy
import numpy as np

import numpy as np

from pandas._libs import lib
from pandas.compat import range, set_function_name, string_types, u
from pandas.util._decorators import cache_readonly
from pandas.compat import u, range, string_types
from pandas.compat import set_function_name

from pandas.core import nanops
from pandas.core.dtypes.base import ExtensionDtype
from pandas.core.dtypes.cast import astype_nansafe
from pandas.core.dtypes.generic import ABCSeries, ABCIndexClass
from pandas.core.dtypes.common import (
is_integer, is_scalar, is_float,
is_bool_dtype,
is_float_dtype,
is_integer_dtype,
is_object_dtype,
is_list_like)
from pandas.core.arrays import ExtensionArray, ExtensionOpsMixin
from pandas.core.dtypes.base import ExtensionDtype
is_bool_dtype, is_float, is_float_dtype, is_integer, is_integer_dtype,
is_list_like, is_object_dtype, is_scalar)
from pandas.core.dtypes.dtypes import register_extension_dtype
from pandas.core.dtypes.generic import ABCIndexClass, ABCSeries
from pandas.core.dtypes.missing import isna, notna

from pandas.core import nanops
from pandas.core.arrays import ExtensionArray, ExtensionOpsMixin

from pandas.io.formats.printing import (
format_object_summary, format_object_attrs, default_pprint)
default_pprint, format_object_attrs, format_object_summary)


class _IntegerDtype(ExtensionDtype):
Expand Down
35 changes: 17 additions & 18 deletions pandas/core/arrays/interval.py
Original file line number Diff line number Diff line change
@@ -1,31 +1,30 @@
from operator import le, lt
import textwrap
import numpy as np

from operator import le, lt
import numpy as np

from pandas._libs.interval import (Interval, IntervalMixin,
intervals_to_interval_bounds)
from pandas._libs.interval import (
Interval, IntervalMixin, intervals_to_interval_bounds)
from pandas.compat import add_metaclass
from pandas.compat.numpy import function as nv
import pandas.core.common as com
from pandas.core.config import get_option
from pandas.util._decorators import Appender
from pandas.util._doctools import _WritableDoc

from pandas.core.dtypes.cast import maybe_convert_platform
from pandas.core.dtypes.common import (is_categorical_dtype, is_float_dtype,
is_integer_dtype, is_interval_dtype,
is_scalar, is_string_dtype,
is_datetime64_any_dtype,
is_timedelta64_dtype, is_interval,
pandas_dtype)
from pandas.core.dtypes.common import (
is_categorical_dtype, is_datetime64_any_dtype, is_float_dtype,
is_integer_dtype, is_interval, is_interval_dtype, is_scalar,
is_string_dtype, is_timedelta64_dtype, pandas_dtype)
from pandas.core.dtypes.dtypes import IntervalDtype
from pandas.core.dtypes.generic import (ABCDatetimeIndex, ABCPeriodIndex,
ABCSeries, ABCIntervalIndex,
ABCInterval)
from pandas.core.dtypes.generic import (
ABCDatetimeIndex, ABCInterval, ABCIntervalIndex, ABCPeriodIndex, ABCSeries)
from pandas.core.dtypes.missing import isna, notna

import pandas.core.common as com
from pandas.core.config import get_option
from pandas.core.indexes.base import Index, ensure_index
from pandas.util._decorators import Appender
from pandas.util._doctools import _WritableDoc

from . import ExtensionArray, Categorical
from . import Categorical, ExtensionArray

_VALID_CLOSED = {'left', 'right', 'both', 'neither'}
_interval_shared_docs = {}
Expand Down
45 changes: 16 additions & 29 deletions pandas/core/arrays/period.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,48 +4,35 @@

import numpy as np

from pandas import compat
from pandas.compat.numpy import function as nv
from pandas._libs.tslib import NaT, iNaT
from pandas._libs.tslibs.period import (
Period, IncompatibleFrequency, DIFFERENT_FREQ_INDEX,
get_period_field_arr, period_asfreq_arr,
)
from pandas._libs.tslibs import period as libperiod
from pandas._libs.tslibs.timedeltas import delta_to_nanoseconds, Timedelta
from pandas._libs.tslibs.fields import isleapyear_arr
from pandas.util._decorators import cache_readonly, Appender
from pandas._libs.tslibs.period import (
DIFFERENT_FREQ_INDEX, IncompatibleFrequency, Period, get_period_field_arr,
period_asfreq_arr)
from pandas._libs.tslibs.timedeltas import Timedelta, delta_to_nanoseconds
import pandas.compat as compat
from pandas.compat.numpy import function as nv
from pandas.util._decorators import Appender, cache_readonly
from pandas.util._validators import validate_fillna_kwargs
import pandas.core.algorithms as algos

from pandas.core.dtypes.common import (
is_integer_dtype, is_float_dtype, is_period_dtype,
pandas_dtype,
is_datetime64_dtype,
is_categorical_dtype,
is_list_like,
is_array_like,
is_object_dtype,
is_string_dtype,
is_datetime_or_timedelta_dtype,
is_dtype_equal,
ensure_object,
_TD_DTYPE,
)
_TD_DTYPE, ensure_object, is_array_like, is_categorical_dtype,
is_datetime64_dtype, is_datetime_or_timedelta_dtype, is_dtype_equal,
is_float_dtype, is_integer_dtype, is_list_like, is_object_dtype,
is_period_dtype, is_string_dtype, pandas_dtype)
from pandas.core.dtypes.dtypes import PeriodDtype
from pandas.core.dtypes.generic import (
ABCSeries, ABCIndexClass, ABCPeriodIndex
)
from pandas.core.dtypes.generic import ABCIndexClass, ABCPeriodIndex, ABCSeries
from pandas.core.dtypes.missing import isna, notna
from pandas.core.missing import pad_1d, backfill_1d

import pandas.core.algorithms as algos
from pandas.core.arrays import ExtensionArray, datetimelike as dtl
import pandas.core.common as com
from pandas.core.missing import backfill_1d, pad_1d

from pandas.tseries import frequencies
from pandas.tseries.offsets import Tick

from pandas.core.arrays import ExtensionArray
from pandas.core.arrays import datetimelike as dtl


def _field_accessor(name, alias, docstring=None):
def f(self):
Expand Down
Loading

0 comments on commit 6fad5a0

Please sign in to comment.