Skip to content

Commit f7f324b

Browse files
committed
CLN: make submodules of pandas.util private
xref #13634 CLN: move pandas.util.* validators, depr_module, decorators, print_versions to _ leading
1 parent 4a748cc commit f7f324b

Some content is hidden

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

75 files changed

+423
-380
lines changed

asv_bench/benchmarks/attrs_caching.py

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

doc/source/whatsnew/v0.20.0.txt

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1238,10 +1238,10 @@ If indicated, a deprecation warning will be issued if you reference theses modul
12381238
"pandas.types", "pandas.core.dtypes", ""
12391239
"pandas.io.sas.saslib", "pandas.io.sas.libsas", ""
12401240
"pandas._join", "pandas._libs.join", ""
1241-
"pandas._hash", "pandas.util.libhashing", ""
1241+
"pandas._hash", "pandas._libs.hashing", ""
12421242
"pandas._period", "pandas._libs.period", ""
12431243
"pandas._sparse", "pandas.core.sparse.libsparse", ""
1244-
"pandas._testing", "pandas.util.libtesting", ""
1244+
"pandas._testing", "pandas.util._testing", ""
12451245
"pandas._window", "pandas.core.libwindow", ""
12461246

12471247

@@ -1254,6 +1254,8 @@ these are now the public subpackages.
12541254

12551255
- The function :func:`~pandas.api.types.union_categoricals` is now importable from ``pandas.api.types``, formerly from ``pandas.types.concat`` (:issue:`15998`)
12561256
- The type import ``pandas.tslib.NaTType`` is deprecated and can be replaced by using ``type(pandas.NaT)`` (:issue:`16146`)
1257+
- The public functions in ``pandas.util.hashing`` deprecated from that locations, but are now importable from ``pandas.util`` (:issue:`16223`)
1258+
- The modules in ``pandas.util``: ``decorators``, ``print_versions``, ``doctools``, `validators``, ``depr_module`` are now private (:issue:`16223`)
12571259

12581260
.. _whatsnew_0200.privacy.errors:
12591261

@@ -1278,7 +1280,7 @@ The following are now part of this API:
12781280
'UnsupportedFunctionCall']
12791281

12801282

1281-
.. _whatsnew_0200.privay.testing:
1283+
.. _whatsnew_0200.privacy.testing:
12821284

12831285
``pandas.testing``
12841286
^^^^^^^^^^^^^^^^^^
@@ -1292,14 +1294,13 @@ The following testing functions are now part of this API:
12921294
- :func:`testing.assert_index_equal`
12931295

12941296

1295-
.. _whatsnew_0200.privay.plotting:
1297+
.. _whatsnew_0200.privacy.plotting:
12961298

12971299
``pandas.plotting``
12981300
^^^^^^^^^^^^^^^^^^^
12991301

13001302
A new public ``pandas.plotting`` module has been added that holds plotting functionality that was previously in either ``pandas.tools.plotting`` or in the top-level namespace. See the :ref:`deprecations sections <whatsnew_0200.privacy.deprecate_plotting>` for more details.
13011303

1302-
13031304
.. _whatsnew_0200.privacy.development:
13041305

13051306
Other Development Changes

pandas/__init__.py

Lines changed: 3 additions & 3 deletions
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',
File renamed without changes.

pandas/compat/numpy/function.py

Lines changed: 2 additions & 2 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 3 additions & 3 deletions
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

Lines changed: 4 additions & 4 deletions
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

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

4444

pandas/core/computation/eval.py

Lines changed: 1 addition & 1 deletion
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):

0 commit comments

Comments
 (0)