Skip to content

Figure.histogram and pygmt.info: Remove parameter 'table', use 'data' instead #1975

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

Merged
merged 3 commits into from
Jun 24, 2022
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
9 changes: 1 addition & 8 deletions pygmt/src/histogram.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,10 @@
Histogram - Create a histogram
"""
from pygmt.clib import Session
from pygmt.helpers import (
build_arg_string,
deprecate_parameter,
fmt_docstring,
kwargs_to_strings,
use_alias,
)
from pygmt.helpers import build_arg_string, fmt_docstring, kwargs_to_strings, use_alias


@fmt_docstring
@deprecate_parameter("table", "data", "v0.5.0", remove_version="v0.7.0")
@use_alias(
A="horizontal",
B="frame",
Expand Down
2 changes: 0 additions & 2 deletions pygmt/src/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,13 @@
from pygmt.helpers import (
GMTTempFile,
build_arg_string,
deprecate_parameter,
fmt_docstring,
kwargs_to_strings,
use_alias,
)


@fmt_docstring
@deprecate_parameter("table", "data", "v0.5.0", remove_version="v0.7.0")
@use_alias(
C="per_column",
I="spacing",
Expand Down
17 changes: 0 additions & 17 deletions pygmt/tests/test_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,23 +31,6 @@ def test_info():
assert output == expected_output


def test_info_deprecate_table_to_data():
"""
Make sure that the old parameter "table" is supported and it reports a
warning.
"""
with pytest.warns(expected_warning=FutureWarning) as record:
output = info(table=POINTS_DATA) # pylint: disable=no-value-for-parameter
expected_output = (
f"{POINTS_DATA}: N = 20 "
"<11.5309/61.7074> "
"<-2.9289/7.8648> "
"<0.1412/0.9338>\n"
)
assert output == expected_output
assert len(record) == 1 # check that only one warning was raised


@pytest.mark.parametrize(
"table",
[
Expand Down