8000 STYLE: Isort __init__ files by alimcmaster1 · Pull Request #26749 · pandas-dev/pandas · GitHub
[go: up one dir, main page]

Skip to content

STYLE: Isort __init__ files #26749

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 19 commits into from
Jun 28, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
ignore two files
  • Loading branch information
alimcmaster1 committed Jun 5, 2019
commit 81c9c7e2fcee92bc1e63a0ba59fc9a3856d52507
126 changes: 80 additions & 46 deletions pandas/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,69 +17,103 @@
"Missing required dependencies {0}".format(missing_dependencies))
del hard_dependencies, dependency, missing_dependencies

from datetime import datetime

from pandas._config import (
describe_option, get_option, option_context, options, reset_option,
set_option)

# numpy compat
from pandas.compat.numpy import (
_np_version_under1p14, _np_version_under1p15, _np_version_under1p16,
_np_version_under1p17)
from pandas.util._print_versions import show_versions
from pandas.util._tester import test

try:
from pandas._libs import (hashtable as _hashtable,
lib as _lib,
tslib as _tslib)
except ImportError as e: # pragma: no cover
# hack but overkill to use re
module = str(e).replace('cannot import name ', '')
raise ImportError("C extension: {0} not built. If you want to import "
"pandas from the source directory, you may need to run "
"'python setup.py build_ext --inplace --force' to build "
"the C extensions first.".format(module))

from datetime import datetime

from pandas._config import (get_option, set_option, reset_option,
describe_option, option_context, options)

# let init-time option registration happen
import pandas.arrays
from pandas.core.computation.api import eval
import pandas.core.config_init
from pandas.core.reshape.api import (
concat, crosstab, cut, get_dummies, lreshape, melt, merge, merge_asof,
merge_ordered, pivot, pivot_table, qcut, wide_to_long)

from pandas.core.api import (
# dtype
Int8Dtype, Int16Dtype, Int32Dtype, Int64Dtype, UInt8Dtype,
UInt16Dtype, UInt32Dtype, UInt64Dtype, CategoricalDtype,
PeriodDtype, IntervalDtype, DatetimeTZDtype,

# missing
isna, isnull, notna, notnull,

# indexes
Index, CategoricalIndex, Int64Index, UInt64Index, RangeIndex,
Float64Index, MultiIndex, IntervalIndex, TimedeltaIndex,
DatetimeIndex, PeriodIndex, IndexSlice,

# tseries
NaT, Period, period_range, Timedelta, timedelta_range,
Timestamp, date_range, bdate_range, Interval, interval_range,
DateOffset,

# conversion
to_numeric, to_datetime, to_timedelta,

# misc
np, Grouper, factorize, unique, value_counts, NamedAgg,
array, Categorical, set_eng_float_format, Series, DataFrame,
Panel)

from pandas.core.sparse.api import (
SparseArray, SparseDataFrame, SparseDtype, SparseSeries)
import pandas.testing
SparseArray, SparseDataFrame, SparseSeries, SparseDtype)

from pandas.tseries import offsets
from pandas.tseries.api import infer_freq
from pandas.tseries import offsets

# use the closest tagged version if possible
from ._version import get_versions
from pandas.core.computation.api import eval

from pandas.core.api import (
# dtype; missing; indexes; tseries; conversion; misc
Categorical, CategoricalDtype, CategoricalIndex, DataFrame, DateOffset,
DatetimeIndex, DatetimeTZDtype, Float64Index, Grouper, Index, IndexSlice,
Int8Dtype, Int16Dtype, Int32Dtype, Int64Dtype, Int64Index, Interval,
IntervalDtype, IntervalIndex, MultiIndex, NamedAgg, NaT, Panel, Period,
PeriodDtype, PeriodIndex, RangeIndex, Series, Timedelta, TimedeltaIndex,
Timestamp, UInt8Dtype, UInt16Dtype, UInt32Dtype, UInt64Dtype, UInt64Index,
array, bdate_range, date_range, factorize, interval_range, isna, isnull,
notna, notnull, np, period_range, set_eng_float_format, timedelta_range,
to_datetime, to_numeric, to_timedelta, unique, value_counts)
from pandas.core.reshape.api import (
concat, lreshape, melt, wide_to_long, merge, merge_asof,
merge_ordered, crosstab, pivot, pivot_table, get_dummies,
cut, qcut)

from pandas.util._print_versions import show_versions

from pandas.io.api import (
# excel; packers; parsers; pickle; pytables; sql; misc
ExcelFile, ExcelWriter, HDFStore, read_clipboard, read_csv, read_excel,
read_feather, read_fwf, read_gbq, read_hdf, read_html, read_json,
read_msgpack, read_parquet, read_pickle, read_sas, read_sql,
read_sql_query, read_sql_table, read_stata, read_table, to_msgpack,
to_pickle)
# excel
ExcelFile, ExcelWriter, read_excel,

# packers
read_msgpack, to_msgpack,

try:
from pandas._libs import (hashtable as _hashtable,
lib as _lib,
tslib as _tslib)
except ImportError as e: # pragma: no cover
# hack but overkill to use re
module = str(e).replace('cannot import name ', '')
raise ImportError("C extension: {0} not built. If you want to import "
"pandas from the source directory, you may need to run "
"'python setup.py build_ext --inplace --force' to build "
"the C extensions first.".format(module))
# parsers
read_csv, read_fwf, read_table,

# pickle
read_pickle, to_pickle,

# pytables
HDFStore, read_hdf,

# sql
read_sql, read_sql_query,
read_sql_table,

# misc
read_clipboard, read_parquet, read_feather, read_gbq,
read_html, read_json, read_stata, read_sas)

from pandas.util._tester import test
import pandas.testing
import pandas.arrays

# use the closest tagged version if possible
from ._version import get_versions
v = get_versions()
__version__ = v.get('closest-tag', v['version'])
__git_version__ = v.get('full-revisionid')
Expand Down
8 changes: 4 additions & 4 deletions pandas/io/msgpack/__init__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
# coding: utf-8

from collections import namedtuple
import os # noqa

from pandas.io.msgpack._packer import Packer # noqa
from pandas.io.msgpack._unpacker import Unpacker, unpack, unpackb # noqa
from pandas.io.msgpack._version import version # noqa
from pandas.io.msgpack.exceptions import * # noqa
from pandas.io.msgpack._version import version # noqa


class ExtType(namedtuple('ExtType', 'code data')):
Expand All @@ -20,7 +17,10 @@ def __new__(cls, code, data):
raise ValueError("code must be 0~127")
return super().__new__(cls, code, data)

import os # noqa

from pandas.io.msgpack._packer import Packer # noqa
from pandas.io.msgpack._unpacker import unpack, unpackb, Unpacker # noqa


def pack(o, stream, **kwargs):
Expand Down
4 changes: 3 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -157,4 +157,6 @@ skip=
asv_bench/benchmarks/offset.py
asv_bench/benchmarks/dtypes.py
asv_bench/benchmarks/strings.py
asv_bench/benchmarks/period.py
asv_bench/benchmarks/period.py
pandas/__init__.py
pandas/io/msgpack/__init__.py
Copy link
Contributor

Choose a reason for hiding this comment

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

extra line needed

0