Skip to content

Commit dc54b6b

Browse files
gfyoungjreback
authored andcommitted
MAINT: Drop line_width and height from options (#16993)
Deprecated since 0.11 and 0.12 respectively.
1 parent 0bd871f commit dc54b6b

File tree

5 files changed

+5
-21
lines changed

5 files changed

+5
-21
lines changed

doc/source/options.rst

-2
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,6 @@ display.float_format None The callable should accept a fl
304304
This is used in some places like
305305
SeriesFormatter.
306306
See core.format.EngFormatter for an example.
307-
display.height 60 Deprecated. Use `display.max_rows` instead.
308307
display.large_repr truncate For DataFrames exceeding max_rows/max_cols,
309308
the repr (and HTML repr) can show
310309
a truncated table (the default from 0.13),
@@ -323,7 +322,6 @@ display.latex.multicolumn_format 'l' Alignment of multicolumn labels
323322
display.latex.multirow False Combines rows when using a MultiIndex.
324323
Centered instead of top-aligned,
325324
separated by clines.
326-
display.line_width 80 Deprecated. Use `display.width` instead.
327325
display.max_columns 20 max_rows and max_columns are used
328326
in __repr__() methods to decide if
329327
to_string() or info() is used to

doc/source/whatsnew/v0.21.0.txt

+2
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,8 @@ Removal of prior version deprecations/changes
124124
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
125125

126126
- :func:`read_excel()` has dropped the ``has_index_names`` parameter (:issue:`10967`)
127+
- The ``pd.options.display.height`` configuration has been dropped (:issue:`3663`)
128+
- The ``pd.options.display.line_width`` configuration has been dropped (:issue:`2881`)
127129
- The ``pd.options.display.mpl_style`` configuration has been dropped (:issue:`12190`)
128130
- ``Index`` has dropped the ``.sym_diff()`` method in favor of ``.symmetric_difference()`` (:issue:`12591`)
129131
- ``Categorical`` has dropped the ``.order()`` and ``.sort()`` methods in favor of ``.sort_values()`` (:issue:`12882`)

pandas/core/config_init.py

-16
Original file line numberDiff line numberDiff line change
@@ -213,14 +213,6 @@ def use_numexpr_cb(key):
213213
(currently both are identical)
214214
"""
215215

216-
pc_line_width_deprecation_warning = """\
217-
line_width has been deprecated, use display.width instead (currently both are
218-
identical)
219-
"""
220-
221-
pc_height_deprecation_warning = """\
222-
height has been deprecated.
223-
"""
224216

225217
pc_width_doc = """
226218
: int
@@ -383,14 +375,6 @@ def table_schema_cb(key):
383375
cf.register_option('html.border', 1, pc_html_border_doc,
384376
validator=is_int)
385377

386-
387-
cf.deprecate_option('display.line_width',
388-
msg=pc_line_width_deprecation_warning,
389-
rkey='display.width')
390-
391-
cf.deprecate_option('display.height', msg=pc_height_deprecation_warning,
392-
rkey='display.max_rows')
393-
394378
with cf.config_prefix('html'):
395379
cf.register_option('border', 1, pc_html_border_doc,
396380
validator=is_int)

pandas/io/formats/console.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def get_console_size():
5353

5454
display_width = get_option('display.width')
5555
# deprecated.
56-
display_height = get_option('display.height', silent=True)
56+
display_height = get_option('display.max_rows')
5757

5858
# Consider
5959
# interactive shell terminal, can detect term size
@@ -71,7 +71,7 @@ def get_console_size():
7171
# match default for width,height in config_init
7272
from pandas.core.config import get_default_val
7373
terminal_width = get_default_val('display.width')
74-
terminal_height = get_default_val('display.height')
74+
terminal_height = get_default_val('display.max_rows')
7575
else:
7676
# pure terminal
7777
terminal_width, terminal_height = get_terminal_size()

pandas/tests/io/formats/test_format.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ def test_repr_non_interactive(self):
302302
df = DataFrame('hello', lrange(1000), lrange(5))
303303

304304
with option_context('mode.sim_interactive', False, 'display.width', 0,
305-
'display.height', 0, 'display.max_rows', 5000):
305+
'display.max_rows', 5000):
306306
assert not has_truncated_repr(df)
307307
assert not has_expanded_repr(df)
308308

0 commit comments

Comments
 (0)