Skip to content

Commit 37ab418

Browse files
seismanweiji14
andauthored
Figure.wiggle: Remove parameter 'columns', use 'incols' instead. (#1977)
Co-authored-by: Wei Ji <[email protected]>
1 parent 6b94baf commit 37ab418

File tree

2 files changed

+14
-21
lines changed

2 files changed

+14
-21
lines changed

pygmt/src/wiggle.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,13 @@
55
from pygmt.helpers import (
66
build_arg_string,
77
check_data_input_order,
8-
deprecate_parameter,
98
fmt_docstring,
109
kwargs_to_strings,
1110
use_alias,
1211
)
1312

1413

1514
@fmt_docstring
16-
@deprecate_parameter("columns", "incols", "v0.5.0", remove_version="v0.7.0")
1715
@check_data_input_order("v0.5.0", remove_version="v0.7.0")
1816
@use_alias(
1917
B="frame",

pygmt/tests/test_wiggle.py

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -32,33 +32,28 @@ def test_wiggle():
3232

3333

3434
@pytest.mark.mpl_image_compare(filename="test_wiggle.png")
35-
def test_wiggle_deprecate_columns_to_incols():
35+
def test_wiggle_data_incols():
3636
"""
37-
Make sure that the old parameter "columns" is supported and it reports a
38-
warning.
39-
40-
Modified from the test_wiggle() test.
37+
Make sure that incols parameter works with input data array.
4138
"""
4239

4340
# put data into numpy array and swap x and y columns
44-
# as the use of the 'columns' parameter will reverse this action
41+
# as the use of the 'incols' parameter will reverse this action
4542
x = np.arange(-2, 2, 0.02)
4643
y = np.zeros(x.size)
4744
z = np.cos(2 * np.pi * x)
4845
data = np.array([y, x, z]).T
4946

5047
fig = Figure()
51-
with pytest.warns(expected_warning=FutureWarning) as record:
52-
fig.wiggle(
53-
data,
54-
region=[-4, 4, -1, 1],
55-
projection="X8c",
56-
columns=[1, 0, 2],
57-
scale="0.5c",
58-
color=["red+p", "gray+n"],
59-
pen="1.0p",
60-
track="0.5p",
61-
position="jRM+w2+lnT",
62-
)
63-
assert len(record) == 1 # check that only one warning was raised
48+
fig.wiggle(
49+
data,
50+
region=[-4, 4, -1, 1],
51+
projection="X8c",
52+
incols=[1, 0, 2],
53+
scale="0.5c",
54+
color=["red+p", "gray+n"],
55+
pen="1.0p",
56+
track="0.5p",
57+
position="jRM+w2+lnT",
58+
)
6459
return fig

0 commit comments

Comments
 (0)