Skip to content

Commit d52d35f

Browse files
committed
replace
1 parent e96624b commit d52d35f

File tree

505 files changed

+837
-528
lines changed

Some content is hidden

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

505 files changed

+837
-528
lines changed

asv_bench/benchmarks/categoricals.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22

33
import numpy as np
44

5+
import pandas.util._testing as tm
6+
57
import pandas as pd
6-
import pandas.util.testing as tm
78

89
try:
910
from pandas.api.types import union_categoricals

asv_bench/benchmarks/ctors.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import numpy as np
22

3+
import pandas.util._testing as tm
4+
35
from pandas import DatetimeIndex, Index, MultiIndex, Series, Timestamp
4-
import pandas.util.testing as tm
56

67

78
def no_change(arr):

asv_bench/benchmarks/frame_ctor.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import numpy as np
22

3+
import pandas.util._testing as tm
4+
35
from pandas import DataFrame, MultiIndex, Series, Timestamp, date_range
4-
import pandas.util.testing as tm
56

67
try:
78
from pandas.tseries.offsets import Nano, Hour

asv_bench/benchmarks/frame_methods.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33

44
import numpy as np
55

6+
import pandas.util._testing as tm
7+
68
from pandas import DataFrame, MultiIndex, NaT, Series, date_range, isnull, period_range
7-
import pandas.util.testing as tm
89

910

1011
class GetNumericData:

asv_bench/benchmarks/gil.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import numpy as np
22

3+
import pandas.util._testing as tm
4+
35
from pandas import DataFrame, Series, date_range, factorize, read_csv
46
from pandas.core.algorithms import take_1d
5-
import pandas.util.testing as tm
67

78
try:
89
from pandas import (
@@ -24,7 +25,7 @@
2425
except ImportError:
2526
from pandas import algos
2627
try:
27-
from pandas.util.testing import test_parallel
28+
from pandas.util._testing import test_parallel
2829

2930
have_real_test_parallel = True
3031
except ImportError:

asv_bench/benchmarks/groupby.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
import numpy as np
66

7+
import pandas.util._testing as tm
8+
79
from pandas import (
810
Categorical,
911
DataFrame,
@@ -13,7 +15,6 @@
1315
date_range,
1416
period_range,
1517
)
16-
import pandas.util.testing as tm
1718

1819
method_blacklist = {
1920
"object": {

asv_bench/benchmarks/index_object.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
import numpy as np
44

5+
import pandas.util._testing as tm
6+
57
from pandas import (
68
DatetimeIndex,
79
Float64Index,
@@ -12,7 +14,6 @@
1214
Series,
1315
date_range,
1416
)
15-
import pandas.util.testing as tm
1617

1718

1819
class SetOperations:

asv_bench/benchmarks/indexing.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
import numpy as np
44

5+
import pandas.util._testing as tm
6+
57
from pandas import (
68
CategoricalIndex,
79
DataFrame,
@@ -17,7 +19,6 @@
1719
option_context,
1820
period_range,
1921
)
20-
import pandas.util.testing as tm
2122

2223

2324
class NumericSeriesIndexing:

asv_bench/benchmarks/inference.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import numpy as np
22

3+
import pandas.util._testing as tm
4+
35
from pandas import DataFrame, Series, to_numeric
4-
import pandas.util.testing as tm
56

67
from .pandas_vb_common import lib, numeric_dtypes
78

asv_bench/benchmarks/io/csv.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44

55
import numpy as np
66

7+
import pandas.util._testing as tm
8+
79
from pandas import Categorical, DataFrame, date_range, read_csv, to_datetime
8-
import pandas.util.testing as tm
910

1011
from ..pandas_vb_common import BaseIO
1112

asv_bench/benchmarks/io/excel.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
from io import BytesIO
22

33
import numpy as np
4+
5+
import pandas.util._testing as tm
6+
47
from odf.opendocument import OpenDocumentSpreadsheet
58
from odf.table import Table, TableCell, TableRow
69
from odf.text import P
7-
810
from pandas import DataFrame, ExcelWriter, date_range, read_excel
9-
import pandas.util.testing as tm
1011

1112

1213
def _generate_dataframe():

asv_bench/benchmarks/io/hdf.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import numpy as np
22

3+
import pandas.util._testing as tm
4+
35
from pandas import DataFrame, HDFStore, date_range, read_hdf
4-
import pandas.util.testing as tm
56

67
from ..pandas_vb_common import BaseIO
78

asv_bench/benchmarks/io/json.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import numpy as np
22

3+
import pandas.util._testing as tm
4+
35
from pandas import DataFrame, concat, date_range, read_json, timedelta_range
4-
import pandas.util.testing as tm
56

67
from ..pandas_vb_common import BaseIO
78

asv_bench/benchmarks/io/pickle.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import numpy as np
22

3+
import pandas.util._testing as tm
4+
35
from pandas import DataFrame, date_range, read_pickle
4-
import pandas.util.testing as tm
56

67
from ..pandas_vb_common import BaseIO
78

asv_bench/benchmarks/io/sql.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
import numpy as np
44
from sqlalchemy import create_engine
55

6+
import pandas.util._testing as tm
7+
68
from pandas import DataFrame, date_range, read_sql_query, read_sql_table
7-
import pandas.util.testing as tm
89

910

1011
class SQL:

asv_bench/benchmarks/io/stata.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import numpy as np
22

3+
import pandas.util._testing as tm
4+
35
from pandas import DataFrame, date_range, read_stata
4-
import pandas.util.testing as tm
56

67
from ..pandas_vb_common import BaseIO
78

asv_bench/benchmarks/join_merge.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22

33
import numpy as np
44

5+
import pandas.util._testing as tm
6+
57
from pandas import DataFrame, MultiIndex, Series, concat, date_range, merge, merge_asof
6-
import pandas.util.testing as tm
78

89
try:
910
from pandas import merge_ordered

asv_bench/benchmarks/multiindex_object.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22

33
import numpy as np
44

5+
import pandas.util._testing as tm
6+
57
from pandas import DataFrame, MultiIndex, RangeIndex, date_range
6-
import pandas.util.testing as tm
78

89

910
class GetLoc:

asv_bench/benchmarks/reindex.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import numpy as np
22

3+
import pandas.util._testing as tm
4+
35
from pandas import DataFrame, Index, MultiIndex, Series, date_range, period_range
4-
import pandas.util.testing as tm
56

67
from .pandas_vb_common import lib
78

asv_bench/benchmarks/series_methods.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22

33
import numpy as np
44

5+
import pandas.util._testing as tm
6+
57
from pandas import NaT, Series, date_range
6-
import pandas.util.testing as tm
78

89

910
class SeriesConstructor:

asv_bench/benchmarks/strings.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22

33
import numpy as np
44

5+
import pandas.util._testing as tm
6+
57
from pandas import DataFrame, Series
6-
import pandas.util.testing as tm
78

89

910
class Methods:

ci/code_checks.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,8 @@ if [[ -z "$CHECK" || "$CHECK" == "patterns" ]]; then
139139
RET=$(($RET + $?)) ; echo $MSG "DONE"
140140

141141
# Checks for test suite
142-
# Check for imports from pandas.util.testing instead of `import pandas.util.testing as tm`
143-
invgrep -R --include="*.py*" -E "from pandas.util.testing import" pandas/tests
142+
# Check for imports from pandas.util._testing instead of `import pandas.util._testing as tm`
143+
invgrep -R --include="*.py*" -E "from pandas.util._testing import" pandas/tests
144144
RET=$(($RET + $?)) ; echo $MSG "DONE"
145145
invgrep -R --include="*.py*" -E "from pandas.util import testing as tm" pandas/tests
146146
RET=$(($RET + $?)) ; echo $MSG "DONE"

doc/source/development/contributing.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -957,7 +957,7 @@ inspiration. If your test requires working with files or
957957
network connectivity, there is more information on the `testing page
958958
<https://github.com/pandas-dev/pandas/wiki/Testing>`_ of the wiki.
959959

960-
The ``pandas.util.testing`` module has many special ``assert`` functions that
960+
The ``pandas.util._testing`` module has many special ``assert`` functions that
961961
make it easier to make statements about whether Series or DataFrame objects are
962962
equivalent. The easiest way to verify that your code is correct is to
963963
explicitly construct the result you expect, then compare the actual result to
@@ -1143,7 +1143,7 @@ If your change involves checking that a warning is actually emitted, use
11431143

11441144
.. code-block:: python
11451145
1146-
import pandas.util.testing as tm
1146+
import pandas.util._testing as tm
11471147
11481148
11491149
df = pd.DataFrame()

doc/source/user_guide/io.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1519,7 +1519,7 @@ rows will skip the intervening rows.
15191519

15201520
.. ipython:: python
15211521
1522-
from pandas.util.testing import makeCustomDataframe as mkdf
1522+
from pandas.util._testing import makeCustomDataframe as mkdf
15231523
df = mkdf(5, 3, r_idx_nlevels=2, c_idx_nlevels=4)
15241524
df.to_csv('mi.csv')
15251525
print(open('mi.csv').read())

doc/source/user_guide/reshaping.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Reshaping by pivoting DataFrame objects
1414
.. ipython:: python
1515
:suppress:
1616
17-
import pandas.util.testing as tm
17+
import pandas.util._testing as tm
1818
tm.N = 3
1919
2020
def unpivot(frame):
@@ -38,7 +38,7 @@ For the curious here is how the above ``DataFrame`` was created:
3838

3939
.. code-block:: python
4040
41-
import pandas.util.testing as tm
41+
import pandas.util._testing as tm
4242
4343
tm.N = 3
4444

doc/source/user_guide/scale.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Assuming you want or need the expressiveness and power of pandas, let's carry on
2626
.. ipython:: python
2727
:suppress:
2828
29-
from pandas.util.testing import _make_timeseries
29+
from pandas.util._testing import _make_timeseries
3030
3131
# Make a random in-memory dataset
3232
ts = _make_timeseries(freq="30S", seed=0)

doc/source/whatsnew/v0.12.0.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ I/O enhancements
236236

237237
.. ipython:: python
238238
239-
from pandas.util.testing import makeCustomDataframe as mkdf
239+
from pandas.util._testing import makeCustomDataframe as mkdf
240240
df = mkdf(5, 3, r_idx_nlevels=2, c_idx_nlevels=4)
241241
df.to_csv('mi.csv')
242242
print(open('mi.csv').read())

doc/source/whatsnew/v0.13.1.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ Enhancements
224224

225225
.. code-block:: ipython
226226
227-
In [28]: import pandas.util.testing as tm
227+
In [28]: import pandas.util._testing as tm
228228
229229
In [29]: panel = tm.makePanel(5)
230230

doc/source/whatsnew/v0.18.0.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1279,7 +1279,7 @@ Bug Fixes
12791279

12801280
- Removed ``millisecond`` property of ``DatetimeIndex``. This would always raise a ``ValueError`` (:issue:`12019`).
12811281
- Bug in ``Series`` constructor with read-only data (:issue:`11502`)
1282-
- Removed ``pandas.util.testing.choice()``. Should use ``np.random.choice()``, instead. (:issue:`12386`)
1282+
- Removed ``pandas.util._testing.choice()``. Should use ``np.random.choice()``, instead. (:issue:`12386`)
12831283
- Bug in ``.loc`` setitem indexer preventing the use of a TZ-aware DatetimeIndex (:issue:`12050`)
12841284
- Bug in ``.style`` indexes and MultiIndexes not appearing (:issue:`11655`)
12851285
- Bug in ``to_msgpack`` and ``from_msgpack`` which did not correctly serialize or deserialize ``NaT`` (:issue:`12307`).

doc/source/whatsnew/v0.20.0.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1360,7 +1360,7 @@ provides a :meth:`~Panel.to_xarray` method to automate this conversion (:issue:`
13601360

13611361
.. code-block:: ipython
13621362
1363-
In [133]: import pandas.util.testing as tm
1363+
In [133]: import pandas.util._testing as tm
13641364
13651365
In [134]: p = tm.makePanel()
13661366

doc/source/whatsnew/v0.21.0.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -927,7 +927,7 @@ Other API changes
927927
- :class:`pandas.HDFStore`'s string representation is now faster and less detailed. For the previous behavior, use ``pandas.HDFStore.info()``. (:issue:`16503`).
928928
- Compression defaults in HDF stores now follow pytables standards. Default is no compression and if ``complib`` is missing and ``complevel`` > 0 ``zlib`` is used (:issue:`15943`)
929929
- ``Index.get_indexer_non_unique()`` now returns a ndarray indexer rather than an ``Index``; this is consistent with ``Index.get_indexer()`` (:issue:`16819`)
930-
- Removed the ``@slow`` decorator from ``pandas.util.testing``, which caused issues for some downstream packages' test suites. Use ``@pytest.mark.slow`` instead, which achieves the same thing (:issue:`16850`)
930+
- Removed the ``@slow`` decorator from ``pandas.util._testing``, which caused issues for some downstream packages' test suites. Use ``@pytest.mark.slow`` instead, which achieves the same thing (:issue:`16850`)
931931
- Moved definition of ``MergeError`` to the ``pandas.errors`` module.
932932
- The signature of :func:`Series.set_axis` and :func:`DataFrame.set_axis` has been changed from ``set_axis(axis, labels)`` to ``set_axis(labels, axis=0)``, for consistency with the rest of the API. The old signature is deprecated and will show a ``FutureWarning`` (:issue:`14636`)
933933
- :func:`Series.argmin` and :func:`Series.argmax` will now raise a ``TypeError`` when used with ``object`` dtypes, instead of a ``ValueError`` (:issue:`13595`)

doc/source/whatsnew/v0.23.0.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,7 @@ provides a :meth:`~Panel.to_xarray` method to automate this conversion (:issue:`
648648

649649
.. code-block:: ipython
650650
651-
In [75]: import pandas.util.testing as tm
651+
In [75]: import pandas.util._testing as tm
652652
653653
In [76]: p = tm.makePanel()
654654

doc/source/whatsnew/v1.0.0.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,7 @@ or ``matplotlib.Axes.plot``. See :ref:`plotting.formatters` for more.
681681
- Ability to read pickles containing :class:`Categorical` instances created with pre-0.16 version of pandas has been removed (:issue:`27538`)
682682
- Removed :func:`pandas.tseries.plotting.tsplot` (:issue:`18627`)
683683
- Removed the previously deprecated keywords "reduce" and "broadcast" from :meth:`DataFrame.apply` (:issue:`18577`)
684-
- Removed the previously deprecated ``assert_raises_regex`` function in ``pandas.util.testing`` (:issue:`29174`)
684+
- Removed the previously deprecated ``assert_raises_regex`` function in ``pandas.util._testing`` (:issue:`29174`)
685685
- Removed the previously deprecated ``FrozenNDArray`` class in ``pandas.core.indexes.frozen`` (:issue:`29335`)
686686
- Removed the previously deprecated keyword "nthreads" from :func:`read_feather`, use "use_threads" instead (:issue:`23053`)
687687
- Removed :meth:`Index.is_lexsorted_for_tuple` (:issue:`29305`)

0 commit comments

Comments
 (0)