Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAINT: Drop line_width and height from options #16993

Merged
merged 1 commit into from
Jul 17, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions doc/source/options.rst
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,6 @@ display.float_format None The callable should accept a fl
This is used in some places like
SeriesFormatter.
See core.format.EngFormatter for an example.
display.height 60 Deprecated. Use `display.max_rows` instead.
display.large_repr truncate For DataFrames exceeding max_rows/max_cols,
the repr (and HTML repr) can show
a truncated table (the default from 0.13),
Expand All @@ -323,7 +322,6 @@ display.latex.multicolumn_format 'l' Alignment of multicolumn labels
display.latex.multirow False Combines rows when using a MultiIndex.
Centered instead of top-aligned,
separated by clines.
display.line_width 80 Deprecated. Use `display.width` instead.
display.max_columns 20 max_rows and max_columns are used
in __repr__() methods to decide if
to_string() or info() is used to
Expand Down
2 changes: 2 additions & 0 deletions doc/source/whatsnew/v0.21.0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ Removal of prior version deprecations/changes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

- :func:`read_excel()` has dropped the ``has_index_names`` parameter (:issue:`10967`)
- The ``pd.options.display.height`` configuration has been dropped (:issue:`3663`)
- The ``pd.options.display.line_width`` configuration has been dropped (:issue:`2881`)
- The ``pd.options.display.mpl_style`` configuration has been dropped (:issue:`12190`)
- ``Index`` has dropped the ``.sym_diff()`` method in favor of ``.symmetric_difference()`` (:issue:`12591`)
- ``Categorical`` has dropped the ``.order()`` and ``.sort()`` methods in favor of ``.sort_values()`` (:issue:`12882`)
Expand Down
16 changes: 0 additions & 16 deletions pandas/core/config_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,14 +213,6 @@ def use_numexpr_cb(key):
(currently both are identical)
"""

pc_line_width_deprecation_warning = """\
line_width has been deprecated, use display.width instead (currently both are
identical)
"""

pc_height_deprecation_warning = """\
height has been deprecated.
"""

pc_width_doc = """
: int
Expand Down Expand Up @@ -383,14 +375,6 @@ def table_schema_cb(key):
cf.register_option('html.border', 1, pc_html_border_doc,
validator=is_int)


cf.deprecate_option('display.line_width',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove the actual deprecation code messages as well

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting, the style check didn't catch those...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah that is dead code, agreed that it is odd that flake8 is not finding it.

msg=pc_line_width_deprecation_warning,
rkey='display.width')

cf.deprecate_option('display.height', msg=pc_height_deprecation_warning,
rkey='display.max_rows')

with cf.config_prefix('html'):
cf.register_option('border', 1, pc_html_border_doc,
validator=is_int)
Expand Down
4 changes: 2 additions & 2 deletions pandas/io/formats/console.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def get_console_size():

display_width = get_option('display.width')
# deprecated.
display_height = get_option('display.height', silent=True)
display_height = get_option('display.max_rows')

# Consider
# interactive shell terminal, can detect term size
Expand All @@ -71,7 +71,7 @@ def get_console_size():
# match default for width,height in config_init
from pandas.core.config import get_default_val
terminal_width = get_default_val('display.width')
terminal_height = get_default_val('display.height')
terminal_height = get_default_val('display.max_rows')
else:
# pure terminal
terminal_width, terminal_height = get_terminal_size()
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/io/formats/test_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ def test_repr_non_interactive(self):
df = DataFrame('hello', lrange(1000), lrange(5))

with option_context('mode.sim_interactive', False, 'display.width', 0,
'display.height', 0, 'display.max_rows', 5000):
'display.max_rows', 5000):
assert not has_truncated_repr(df)
assert not has_expanded_repr(df)

Expand Down