Skip to content

Commit b1aa28c

Browse files
committed
CLN: move pandas.util.*
validators, depr_module, decorators, print_versions to _ leading
1 parent ce092a6 commit b1aa28c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+70
-69
lines changed

asv_bench/benchmarks/attrs_caching.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from .pandas_vb_common import *
2-
from pandas.util.decorators import cache_readonly
2+
from pandas.util._decorators import cache_readonly
33

44

55
class DataFrameAttributes(object):

doc/source/merging.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
1414
import matplotlib.pyplot as plt
1515
plt.close('all')
16-
import pandas.util.doctools as doctools
16+
import pandas.util._doctools as doctools
1717
p = doctools.TablePlotter()
1818
1919

pandas/__init__.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,17 @@
5050
import pandas.tools.plotting
5151
plot_params = pandas.plotting._style._Options(deprecated=True)
5252
# do not import deprecate to top namespace
53-
scatter_matrix = pandas.util.decorators.deprecate(
53+
scatter_matrix = pandas.util._decorators.deprecate(
5454
'pandas.scatter_matrix', pandas.plotting.scatter_matrix,
5555
'pandas.plotting.scatter_matrix')
5656

57-
from pandas.util.print_versions import show_versions
57+
from pandas.util._print_versions import show_versions
5858
from pandas.io.api import *
5959
from pandas.util._tester import test
6060
import pandas.testing
6161

6262
# extension module deprecations
63-
from pandas.util.depr_module import _DeprecatedModule
63+
from pandas.util._depr_module import _DeprecatedModule
6464

6565
json = _DeprecatedModule(deprmod='pandas.json',
6666
moved={'dumps': 'pandas.io.json.dumps',

pandas/compat/numpy/function.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
"""
2020

2121
from numpy import ndarray
22-
from pandas.util.validators import (validate_args, validate_kwargs,
23-
validate_args_and_kwargs)
22+
from pandas.util._validators import (validate_args, validate_kwargs,
23+
validate_args_and_kwargs)
2424
from pandas.errors import UnsupportedFunctionCall
2525
from pandas.core.dtypes.common import is_integer, is_bool
2626
from pandas.compat import OrderedDict

pandas/core/api.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
from pandas.core.resample import TimeGrouper
3636

3737
# see gh-14094.
38-
from pandas.util.depr_module import _DeprecatedModule
38+
from pandas.util._depr_module import _DeprecatedModule
3939

4040
_removals = ['day', 'bday', 'businessDay', 'cday', 'customBusinessDay',
4141
'customBusinessMonthEnd', 'customBusinessMonthBegin',

pandas/core/base.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
from pandas.core.dtypes.missing import isnull
1010
from pandas.core.dtypes.generic import ABCDataFrame, ABCSeries, ABCIndexClass
1111
from pandas.core.dtypes.common import is_object_dtype, is_list_like, is_scalar
12-
from pandas.util.validators import validate_bool_kwarg
12+
from pandas.util._validators import validate_bool_kwarg
1313

1414
from pandas.core import common as com
1515
import pandas.core.nanops as nanops
1616
import pandas._libs.lib as lib
1717
from pandas.compat.numpy import function as nv
18-
from pandas.util.decorators import (Appender, cache_readonly,
19-
deprecate_kwarg, Substitution)
18+
from pandas.util._decorators import (Appender, cache_readonly,
19+
deprecate_kwarg, Substitution)
2020
from pandas.core.common import AbstractMethodError
2121

2222
_shared_docs = dict()

pandas/core/categorical.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@
3434
import pandas.core.common as com
3535
from pandas.core.missing import interpolate_2d
3636
from pandas.compat.numpy import function as nv
37-
from pandas.util.decorators import (Appender, cache_readonly,
38-
deprecate_kwarg, Substitution)
37+
from pandas.util._decorators import (Appender, cache_readonly,
38+
deprecate_kwarg, Substitution)
3939

4040
from pandas.io.formats.terminal import get_terminal_size
41-
from pandas.util.validators import validate_bool_kwarg
41+
from pandas.util._validators import validate_bool_kwarg
4242
from pandas.core.config import get_option
4343

4444

pandas/core/computation/eval.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from pandas.core.computation.scope import _ensure_scope
1212
from pandas.compat import string_types
1313
from pandas.core.computation.engines import _engines
14-
from pandas.util.validators import validate_bool_kwarg
14+
from pandas.util._validators import validate_bool_kwarg
1515

1616

1717
def _check_engine(engine):

pandas/core/frame.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@
8080
OrderedDict, raise_with_traceback)
8181
from pandas import compat
8282
from pandas.compat.numpy import function as nv
83-
from pandas.util.decorators import Appender, Substitution
84-
from pandas.util.validators import validate_bool_kwarg
83+
from pandas.util._decorators import Appender, Substitution
84+
from pandas.util._validators import validate_bool_kwarg
8585

8686
from pandas.core.indexes.period import PeriodIndex
8787
from pandas.core.indexes.datetimes import DatetimeIndex

pandas/core/generic.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@
5151
from pandas.compat import (map, zip, lzip, lrange, string_types,
5252
isidentifier, set_function_name)
5353
import pandas.core.nanops as nanops
54-
from pandas.util.decorators import Appender, Substitution, deprecate_kwarg
55-
from pandas.util.validators import validate_bool_kwarg
54+
from pandas.util._decorators import Appender, Substitution, deprecate_kwarg
55+
from pandas.util._validators import validate_bool_kwarg
5656
from pandas.core import config
5757

5858
# goal is to be able to define the docs close to function, while still being

pandas/core/groupby.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@
5454
from pandas.core.sorting import (get_group_index_sorter, get_group_index,
5555
compress_group_index, get_flattened_iterator,
5656
decons_obs_group_ids, get_indexer_dict)
57-
from pandas.util.decorators import (cache_readonly, Substitution,
58-
Appender, make_signature)
57+
from pandas.util._decorators import (cache_readonly, Substitution,
58+
Appender, make_signature)
5959
from pandas.io.formats.printing import pprint_thing
60-
from pandas.util.validators import validate_kwargs
60+
from pandas.util._validators import validate_kwargs
6161

6262
import pandas.core.algorithms as algorithms
6363
import pandas.core.common as com

pandas/core/indexes/base.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@
4141

4242
from pandas.core.base import PandasObject, IndexOpsMixin
4343
import pandas.core.base as base
44-
from pandas.util.decorators import (Appender, Substitution, cache_readonly,
45-
deprecate, deprecate_kwarg)
44+
from pandas.util._decorators import (Appender, Substitution, cache_readonly,
45+
deprecate, deprecate_kwarg)
4646
from pandas.core.indexes.frozen import FrozenList
4747
import pandas.core.common as com
4848
import pandas.core.dtypes.concat as _concat

pandas/core/indexes/category.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from pandas.core.algorithms import take_1d
1717

1818

19-
from pandas.util.decorators import Appender, cache_readonly
19+
from pandas.util._decorators import Appender, cache_readonly
2020
from pandas.core.config import get_option
2121
from pandas.core.indexes.base import Index, _index_shared_docs
2222
import pandas.core.base as base

pandas/core/indexes/datetimelike.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
from pandas._libs.period import Period
2929

3030
from pandas.core.indexes.base import Index, _index_shared_docs
31-
from pandas.util.decorators import Appender, cache_readonly
31+
from pandas.util._decorators import Appender, cache_readonly
3232
import pandas.core.dtypes.concat as _concat
3333
import pandas.tseries.frequencies as frequencies
3434

pandas/core/indexes/datetimes.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@
4141
from pandas.core.tools.datetimes import (
4242
parse_time_string, normalize_date, to_time)
4343
from pandas.core.tools.timedeltas import to_timedelta
44-
from pandas.util.decorators import (Appender, cache_readonly,
45-
deprecate_kwarg, Substitution)
44+
from pandas.util._decorators import (Appender, cache_readonly,
45+
deprecate_kwarg, Substitution)
4646
import pandas.core.common as com
4747
import pandas.tseries.offsets as offsets
4848
import pandas.core.tools.datetimes as tools

pandas/core/indexes/interval.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
from pandas.core.indexes.multi import MultiIndex
2929
from pandas.compat.numpy import function as nv
3030
from pandas.core import common as com
31-
from pandas.util.decorators import cache_readonly, Appender
31+
from pandas.util._decorators import cache_readonly, Appender
3232
from pandas.core.config import get_option
3333

3434
import pandas.core.indexes.base as ibase

pandas/core/indexes/multi.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
is_null_slice)
2727

2828
import pandas.core.base as base
29-
from pandas.util.decorators import (Appender, cache_readonly,
30-
deprecate, deprecate_kwarg)
29+
from pandas.util._decorators import (Appender, cache_readonly,
30+
deprecate, deprecate_kwarg)
3131
import pandas.core.common as com
3232
import pandas.core.missing as missing
3333
import pandas.core.algorithms as algos

pandas/core/indexes/numeric.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from pandas.core import algorithms
1212
from pandas.core.indexes.base import (
1313
Index, InvalidIndexError, _index_shared_docs)
14-
from pandas.util.decorators import Appender, cache_readonly
14+
from pandas.util._decorators import Appender, cache_readonly
1515
import pandas.core.indexes.base as ibase
1616

1717

pandas/core/indexes/period.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@
4040
from pandas.core.indexes.base import _index_shared_docs, _ensure_index
4141

4242
from pandas import compat
43-
from pandas.util.decorators import (Appender, Substitution, cache_readonly,
44-
deprecate_kwarg)
43+
from pandas.util._decorators import (Appender, Substitution, cache_readonly,
44+
deprecate_kwarg)
4545
from pandas.compat import zip, u
4646

4747
import pandas.core.indexes.base as ibase

pandas/core/indexes/range.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from pandas.compat import lrange, range
1414
from pandas.compat.numpy import function as nv
1515
from pandas.core.indexes.base import Index, _index_shared_docs
16-
from pandas.util.decorators import Appender, cache_readonly
16+
from pandas.util._decorators import Appender, cache_readonly
1717
import pandas.core.indexes.base as ibase
1818

1919
from pandas.core.indexes.numeric import Int64Index

pandas/core/indexes/timedeltas.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
from pandas.core.indexes.base import _index_shared_docs
2828
import pandas.core.common as com
2929
import pandas.core.dtypes.concat as _concat
30-
from pandas.util.decorators import Appender, Substitution, deprecate_kwarg
30+
from pandas.util._decorators import Appender, Substitution, deprecate_kwarg
3131
from pandas.core.indexes.datetimelike import TimelikeOps, DatetimeIndexOpsMixin
3232
from pandas.core.tools.timedeltas import (
3333
to_timedelta, _coerce_scalar_to_timedelta_type)

pandas/core/internals.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@
6464
from pandas._libs.lib import BlockPlacement
6565

6666
import pandas.core.computation.expressions as expressions
67-
from pandas.util.decorators import cache_readonly
68-
from pandas.util.validators import validate_bool_kwarg
67+
from pandas.util._decorators import cache_readonly
68+
from pandas.util._validators import validate_bool_kwarg
6969

7070
from pandas import compat, _np_version_under1p9
7171
from pandas.compat import range, map, zip, u

pandas/core/ops.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
tslib as libts, algos as libalgos, iNaT)
1616

1717
from pandas import compat
18-
from pandas.util.decorators import Appender
18+
from pandas.util._decorators import Appender
1919
import pandas.core.computation.expressions as expressions
2020

2121
from pandas.compat import bind_method

pandas/core/panel.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
from pandas.core.ops import _op_descriptions
3535
from pandas.core.series import Series
3636
from pandas.core.reshape.util import cartesian_product
37-
from pandas.util.decorators import (deprecate, Appender)
37+
from pandas.util._decorators import (deprecate, Appender)
3838

3939
_shared_doc_kwargs = dict(
4040
axes='items, major_axis, minor_axis',

pandas/core/resample.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
from pandas._libs.lib import Timestamp
2626
from pandas._libs.period import IncompatibleFrequency
2727

28-
from pandas.util.decorators import Appender
28+
from pandas.util._decorators import Appender
2929
from pandas.core.generic import _shared_docs
3030
_shared_docs_kwargs = dict()
3131

pandas/core/reshape/merge.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
from pandas.core.dtypes.missing import na_value_for_dtype
3535
from pandas.core.internals import (items_overlap_with_suffix,
3636
concatenate_block_managers)
37-
from pandas.util.decorators import Appender, Substitution
37+
from pandas.util._decorators import Appender, Substitution
3838

3939
from pandas.core.sorting import is_int64_overflow_possible
4040
import pandas.core.algorithms as algos

pandas/core/reshape/reshape.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
from pandas._libs import algos as _algos, reshape as _reshape
3131

3232
from pandas.core.frame import _shared_docs
33-
from pandas.util.decorators import Appender
33+
from pandas.util._decorators import Appender
3434
from pandas.core.index import MultiIndex, _get_na_value
3535

3636

pandas/core/series.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@
7070
import pandas.core.common as com
7171
import pandas.core.nanops as nanops
7272
import pandas.io.formats.format as fmt
73-
from pandas.util.decorators import Appender, deprecate_kwarg, Substitution
74-
from pandas.util.validators import validate_bool_kwarg
73+
from pandas.util._decorators import Appender, deprecate_kwarg, Substitution
74+
from pandas.util._validators import validate_bool_kwarg
7575

7676
from pandas._libs import index as libindex, tslib as libts, lib, iNaT
7777
from pandas.core.config import get_option

pandas/core/sparse/array.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
import pandas.core.algorithms as algos
3636
import pandas.core.ops as ops
3737
import pandas.io.formats.printing as printing
38-
from pandas.util.decorators import Appender
38+
from pandas.util._decorators import Appender
3939
from pandas.core.indexes.base import _index_shared_docs
4040

4141

pandas/core/sparse/frame.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
import pandas.core.generic as generic
2727
from pandas.core.sparse.series import SparseSeries, SparseArray
2828
from pandas.core.sparse.libsparse import BlockIndex, get_blocks
29-
from pandas.util.decorators import Appender
29+
from pandas.util._decorators import Appender
3030
import pandas.core.ops as ops
3131

3232

pandas/core/sparse/list.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
from pandas.core.dtypes.common import is_scalar
77
from pandas.core.sparse.array import SparseArray
8-
from pandas.util.validators import validate_bool_kwarg
8+
from pandas.util._validators import validate_bool_kwarg
99
from pandas.core.sparse import libsparse as splib
1010

1111

pandas/core/sparse/series.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import pandas.core.common as com
2222
import pandas.core.ops as ops
2323
import pandas._libs.index as _index
24-
from pandas.util.decorators import Appender
24+
from pandas.util._decorators import Appender
2525

2626
from pandas.core.sparse.array import (
2727
make_sparse, _sparse_array_op, SparseArray,

pandas/core/strings.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
from pandas.core.algorithms import take_1d
1818
import pandas.compat as compat
1919
from pandas.core.base import AccessorProperty, NoNewAttributesMixin
20-
from pandas.util.decorators import Appender
20+
from pandas.util._decorators import Appender
2121
import re
2222
import pandas._libs.lib as lib
2323
import warnings

pandas/core/window.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@
3737
from pandas.tseries.offsets import DateOffset
3838
from pandas import compat
3939
from pandas.compat.numpy import function as nv
40-
from pandas.util.decorators import (Substitution, Appender,
41-
cache_readonly)
40+
from pandas.util._decorators import (Substitution, Appender,
41+
cache_readonly)
4242
from pandas.core.generic import _shared_docs
4343
from textwrap import dedent
4444

pandas/io/excel.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
import pandas.compat.openpyxl_compat as openpyxl_compat
3030
from warnings import warn
3131
from distutils.version import LooseVersion
32-
from pandas.util.decorators import Appender
32+
from pandas.util._decorators import Appender
3333
from textwrap import fill
3434

3535
__all__ = ["read_excel", "ExcelWriter", "ExcelFile"]

pandas/io/formats/style.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
from pandas.core.generic import _shared_docs
3030
import pandas.core.common as com
3131
from pandas.core.indexing import _maybe_numeric_slice, _non_reducing_slice
32-
from pandas.util.decorators import Appender
32+
from pandas.util._decorators import Appender
3333
try:
3434
import matplotlib.pyplot as plt
3535
from matplotlib import colors

pandas/io/parsers.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
_NA_VALUES, _infer_compression)
3838
from pandas.core.tools import datetimes as tools
3939

40-
from pandas.util.decorators import Appender
40+
from pandas.util._decorators import Appender
4141

4242
import pandas._libs.lib as lib
4343
import pandas.io.libparsers as libparsers

pandas/io/sas/sas_xport.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from pandas import compat
1515
import struct
1616
import numpy as np
17-
from pandas.util.decorators import Appender
17+
from pandas.util._decorators import Appender
1818
import warnings
1919

2020
_correct_line1 = ("HEADER RECORD*******LIBRARY HEADER RECORD!!!!!!!"

0 commit comments

Comments
 (0)