Skip to content

Commit 13dca89

Browse files
committed
Figure.contour: Remove parameter "columns", use "incols" instead
Also modified the original deprecation test into a regression test for #1313
1 parent d85bfdf commit 13dca89

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

pygmt/src/contour.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515

1616
@fmt_docstring
17-
@deprecate_parameter("columns", "incols", "v0.4.0", remove_version="v0.6.0")
1817
@check_data_input_order("v0.5.0", remove_version="v0.7.0")
1918
@use_alias(
2019
A="annotation",

pygmt/tests/test_contour.py

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,13 @@ def test_contour_from_file(region):
7676

7777

7878
@pytest.mark.mpl_image_compare(filename="test_contour_vec.png")
79-
def test_contour_deprecate_columns_to_incols(region):
79+
def test_contour_incols_transposed_data(region):
8080
"""
81-
Make sure that the old parameter "columns" is supported and it reports an
82-
warning.
81+
Make sure that transposing the data matrix still produces a correct result
82+
with incols reordering the columns.
83+
84+
This is a regression test for
85+
https://github.com/GenericMappingTools/pygmt/issues/1313
8386
8487
Modified from the test_contour_vec() test.
8588
"""
@@ -96,14 +99,12 @@ def test_contour_deprecate_columns_to_incols(region):
9699
# switch x and y from here onwards to simulate different column order
97100
data = np.array([y, x, z]).T
98101

99-
with pytest.warns(expected_warning=FutureWarning) as record:
100-
fig.contour(
101-
data,
102-
projection="X10c",
103-
region=region,
104-
frame="a",
105-
pen=True,
106-
columns=[1, 0, 2],
107-
)
108-
assert len(record) == 1 # check that only one warning was raised
102+
fig.contour(
103+
data,
104+
projection="X10c",
105+
region=region,
106+
frame="a",
107+
pen=True,
108+
incols=[1, 0, 2],
109+
)
109110
return fig

0 commit comments

Comments
 (0)