Skip to content

Commit f6f5ce5

Browse files
GuessWhoSamFoojorisvandenbossche
authored andcommitted
DOC: Update Sphinx Deprecated Directive (#16512)
1 parent 1265c27 commit f6f5ce5

File tree

16 files changed

+122
-77
lines changed

16 files changed

+122
-77
lines changed

doc/source/io.rst

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,10 @@ usecols : array-like or callable, default ``None``
137137
138138
Using this parameter results in much faster parsing time and lower memory usage.
139139
as_recarray : boolean, default ``False``
140-
DEPRECATED: this argument will be removed in a future version. Please call
141-
``pd.read_csv(...).to_records()`` instead.
140+
141+
.. deprecated:: 0.18.2
142+
143+
Please call ``pd.read_csv(...).to_records()`` instead.
142144

143145
Return a NumPy recarray instead of a DataFrame after parsing the data. If
144146
set to ``True``, this option takes precedence over the ``squeeze`` parameter.
@@ -191,7 +193,11 @@ skiprows : list-like or integer, default ``None``
191193
skipfooter : int, default ``0``
192194
Number of lines at bottom of file to skip (unsupported with engine='c').
193195
skip_footer : int, default ``0``
194-
DEPRECATED: use the ``skipfooter`` parameter instead, as they are identical
196+
197+
.. deprecated:: 0.19.0
198+
199+
Use the ``skipfooter`` parameter instead, as they are identical
200+
195201
nrows : int, default ``None``
196202
Number of rows of file to read. Useful for reading pieces of large files.
197203
low_memory : boolean, default ``True``
@@ -202,16 +208,25 @@ low_memory : boolean, default ``True``
202208
use the ``chunksize`` or ``iterator`` parameter to return the data in chunks.
203209
(Only valid with C parser)
204210
buffer_lines : int, default None
205-
DEPRECATED: this argument will be removed in a future version because its
206-
value is not respected by the parser
211+
212+
.. deprecated:: 0.19.0
213+
214+
Argument removed because its value is not respected by the parser
215+
207216
compact_ints : boolean, default False
208-
DEPRECATED: this argument will be removed in a future version
217+
218+
.. deprecated:: 0.19.0
219+
220+
Argument moved to ``pd.to_numeric``
209221

210222
If ``compact_ints`` is ``True``, then for any column that is of integer dtype, the
211223
parser will attempt to cast it as the smallest integer ``dtype`` possible, either
212224
signed or unsigned depending on the specification from the ``use_unsigned`` parameter.
213225
use_unsigned : boolean, default False
214-
DEPRECATED: this argument will be removed in a future version
226+
227+
.. deprecated:: 0.18.2
228+
229+
Argument moved to ``pd.to_numeric``
215230

216231
If integer columns are being compacted (i.e. ``compact_ints=True``), specify whether
217232
the column should be compacted to the smallest signed or unsigned integer dtype.

doc/sphinxext/numpydoc/README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,6 @@ The following options can be set in conf.py:
4646
methods and attributes. If a table of contents is made, Sphinx expects
4747
each entry to have a separate page.
4848

49-
- numpydoc_edit_link: bool (DEPRECATED -- edit your HTML template instead)
49+
- numpydoc_edit_link: bool (DEPRECATED -- edit your HTML template instead)
5050

5151
Whether to insert an edit link after docstrings.

pandas/core/categorical.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -398,8 +398,8 @@ def itemsize(self):
398398

399399
def reshape(self, new_shape, *args, **kwargs):
400400
"""
401-
DEPRECATED: calling this method will raise an error in a
402-
future release.
401+
.. deprecated:: 0.19.0
402+
Calling this method will raise an error in a future release.
403403
404404
An ndarray-compatible method that returns `self` because
405405
`Categorical` instances cannot actually be reshaped.
@@ -430,7 +430,8 @@ def base(self):
430430
@classmethod
431431
def from_array(cls, data, **kwargs):
432432
"""
433-
DEPRECATED: Use ``Categorical`` instead.
433+
.. deprecated:: 0.19.0
434+
Use ``Categorical`` instead.
434435
435436
Make a Categorical type from a single array-like object.
436437

pandas/core/common.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,8 @@ def in_qtconsole():
555555
"""
556556
check if we're inside an IPython qtconsole
557557
558-
DEPRECATED: This is no longer needed, or working, in IPython 3 and above.
558+
.. deprecated:: 0.14.1
559+
This is no longer needed, or working, in IPython 3 and above.
559560
"""
560561
try:
561562
ip = get_ipython() # noqa
@@ -573,8 +574,8 @@ def in_ipnb():
573574
"""
574575
check if we're inside an IPython Notebook
575576
576-
DEPRECATED: This is no longer used in pandas, and won't work in IPython 3
577-
and above.
577+
.. deprecated:: 0.14.1
578+
This is no longer needed, or working, in IPython 3 and above.
578579
"""
579580
try:
580581
ip = get_ipython() # noqa

pandas/core/generic.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1338,9 +1338,9 @@ def to_sql(self, name, con, flavor=None, schema=None, if_exists='fail',
13381338
Using SQLAlchemy makes it possible to use any DB supported by that
13391339
library. If a DBAPI2 object, only sqlite3 is supported.
13401340
flavor : 'sqlite', default None
1341-
DEPRECATED: this parameter will be removed in a future version,
1342-
as 'sqlite' is the only supported option if SQLAlchemy is not
1343-
installed.
1341+
.. deprecated:: 0.19.0
1342+
'sqlite' is the only supported option if SQLAlchemy is not
1343+
used.
13441344
schema : string, default None
13451345
Specify the schema (if database flavor supports this). If None, use
13461346
default schema.
@@ -3498,7 +3498,9 @@ def astype(self, dtype, copy=True, errors='raise', **kwargs):
34983498
34993499
.. versionadded:: 0.20.0
35003500
3501-
raise_on_error : DEPRECATED use ``errors`` instead
3501+
raise_on_error : raise on invalid input
3502+
.. deprecated:: 0.20.0
3503+
Use ``errors`` instead
35023504
kwargs : keyword arguments to pass on to the constructor
35033505
35043506
Returns
@@ -3602,7 +3604,6 @@ def convert_objects(self, convert_dates=True, convert_numeric=False,
36023604
convert_timedeltas=True, copy=True):
36033605
"""
36043606
Deprecated.
3605-
36063607
Attempt to infer better dtype for object columns
36073608
36083609
Parameters
@@ -5809,8 +5810,9 @@ def tz_localize(self, tz, axis=0, level=None, copy=True,
58095810
- 'NaT' will return NaT where there are ambiguous times
58105811
- 'raise' will raise an AmbiguousTimeError if there are ambiguous
58115812
times
5812-
infer_dst : boolean, default False (DEPRECATED)
5813-
Attempt to infer fall dst-transition hours based on order
5813+
infer_dst : boolean, default False
5814+
.. deprecated:: 0.15.0
5815+
Attempt to infer fall dst-transition hours based on order
58145816
58155817
Returns
58165818
-------

pandas/core/indexes/datetimes.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,9 @@ class DatetimeIndex(DatelikeOps, TimelikeOps, DatetimeIndexOpsMixin,
197197
times)
198198
- 'NaT' will return NaT where there are ambiguous times
199199
- 'raise' will raise an AmbiguousTimeError if there are ambiguous times
200-
infer_dst : boolean, default False (DEPRECATED)
201-
Attempt to infer fall dst-transition hours based on order
200+
infer_dst : boolean, default False
201+
.. deprecated:: 0.15.0
202+
Attempt to infer fall dst-transition hours based on order
202203
name : object
203204
Name to be stored in the index
204205
@@ -1818,8 +1819,9 @@ def tz_localize(self, tz, ambiguous='raise', errors='raise'):
18181819
18191820
.. versionadded:: 0.19.0
18201821
1821-
infer_dst : boolean, default False (DEPRECATED)
1822-
Attempt to infer fall dst-transition hours based on order
1822+
infer_dst : boolean, default False
1823+
.. deprecated:: 0.15.0
1824+
Attempt to infer fall dst-transition hours based on order
18231825
18241826
Returns
18251827
-------

pandas/core/indexes/period.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,8 @@ def asfreq(self, freq=None, how='E'):
558558

559559
def to_datetime(self, dayfirst=False):
560560
"""
561-
DEPRECATED: use :meth:`to_timestamp` instead.
561+
.. deprecated:: 0.19.0
562+
Use :meth:`to_timestamp` instead.
562563
563564
Cast to DatetimeIndex.
564565
"""

pandas/core/panel4d.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919
having 4 named dimensions. It is intended as a test bed for more
2020
N-Dimensional named containers.
2121
22-
DEPRECATED. Panel4D is deprecated and will be removed in a future version.
23-
The recommended way to represent these types of n-dimensional data are with
24-
the `xarray package <http://xarray.pydata.org/en/stable/>`__.
25-
Pandas provides a `.to_xarray()` method to automate this conversion.
22+
.. deprecated:: 0.19.0
23+
The recommended way to represent these types of n-dimensional data
24+
are with the `xarray package <http://xarray.pydata.org/en/stable/>`__.
25+
Pandas provides a `.to_xarray()` method to automate this conversion.
2626
2727
Parameters
2828
----------

pandas/core/panelnd.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ def create_nd_panel_factory(klass_name, orders, slices, slicer, aliases=None,
99
stat_axis=2, info_axis=0, ns=None):
1010
""" manufacture a n-d class:
1111
12-
DEPRECATED. Panelnd is deprecated and will be removed in a future version.
13-
The recommended way to represent these types of n-dimensional data are with
14-
the `xarray package <http://xarray.pydata.org/en/stable/>`__.
15-
Pandas provides a `.to_xarray()` method to automate this conversion.
12+
.. deprecated:: 0.19.0
13+
The recommended way to represent these types of n-dimensional data
14+
are with the `xarray package <http://xarray.pydata.org/en/stable/>`__.
15+
Pandas provides a `.to_xarray()` method to automate this conversion.
1616
1717
Parameters
1818
----------

pandas/core/series.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -850,8 +850,9 @@ def repeat(self, repeats, *args, **kwargs):
850850

851851
def reshape(self, *args, **kwargs):
852852
"""
853-
DEPRECATED: calling this method will raise an error in a
854-
future release. Please call ``.values.reshape(...)`` instead.
853+
.. deprecated:: 0.19.0
854+
Calling this method will raise an error. Please call
855+
``.values.reshape(...)`` instead.
855856
856857
return an ndarray with the values shape
857858
if the specified shape matches exactly the current shape, then

0 commit comments

Comments
 (0)