Skip to content

Commit a868fc6

Browse files
authored
Figure.wiggle: Remove deprecated parameter 'color', use fillpositive/fillnegative instead (deprecated since v0.8.0) (#3035)
1 parent 8c4bd71 commit a868fc6

File tree

2 files changed

+0
-69
lines changed

2 files changed

+0
-69
lines changed

pygmt/src/wiggle.py

-14
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,15 @@
11
"""
22
wiggle - Plot z=f(x,y) anomalies along tracks.
33
"""
4-
import warnings
54

65
from pygmt.clib import Session
7-
from pygmt.exceptions import GMTInvalidInput
86
from pygmt.helpers import build_arg_string, fmt_docstring, kwargs_to_strings, use_alias
97

108

119
@fmt_docstring
1210
@use_alias(
1311
B="frame",
1412
D="position",
15-
G="color",
1613
J="projection",
1714
R="region",
1815
T="track",
@@ -102,17 +99,6 @@ def wiggle(
10299
"""
103100
kwargs = self._preprocess(**kwargs)
104101

105-
if (fillpositive or fillnegative) and kwargs.get("G") is not None:
106-
raise GMTInvalidInput("Use either fillpositive/fillnegative or color.")
107-
108-
if kwargs.get("G") is not None:
109-
msg = (
110-
"The 'color' parameter has been deprecated since v0.8.0"
111-
" and will be removed in v0.12.0. Use fillpositive/fillnegative"
112-
" instead."
113-
)
114-
warnings.warn(msg, category=FutureWarning, stacklevel=2)
115-
116102
if fillpositive or fillnegative:
117103
kwargs["G"] = []
118104
if fillpositive:

pygmt/tests/test_wiggle.py

-55
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import numpy as np
55
import pytest
66
from pygmt import Figure
7-
from pygmt.exceptions import GMTInvalidInput
87

98

109
@pytest.mark.mpl_image_compare
@@ -61,57 +60,3 @@ def test_wiggle_data_incols():
6160
position="jRM+w2+lnT",
6261
)
6362
return fig
64-
65-
66-
def test_wiggle_fill_multiple():
67-
"""
68-
Check that wiggle fails when the parameters color and fillpositive/fillnegative are
69-
used together.
70-
"""
71-
x = np.arange(-2, 2, 0.02)
72-
y = np.zeros(x.size)
73-
z = np.cos(2 * np.pi * x)
74-
75-
fig = Figure()
76-
with pytest.raises(GMTInvalidInput):
77-
fig.wiggle(
78-
x=x,
79-
y=y,
80-
z=z,
81-
region=[-4, 4, -1, 1],
82-
projection="X8c",
83-
incols=[1, 0, 2],
84-
scale="0.5c",
85-
color="blue",
86-
fillpositive="red",
87-
fillnegative="gray",
88-
pen="1.0p",
89-
track="0.5p",
90-
position="jRM+w2+lnT",
91-
)
92-
93-
94-
def test_wiggle_use_color():
95-
"""
96-
Check that wiggle raises a warning when the deprecated parameter color is used.
97-
"""
98-
x = np.arange(-2, 2, 0.02)
99-
y = np.zeros(x.size)
100-
z = np.cos(2 * np.pi * x)
101-
102-
fig = Figure()
103-
with pytest.warns(expected_warning=FutureWarning) as record:
104-
fig.wiggle(
105-
x=x,
106-
y=y,
107-
z=z,
108-
region=[-4, 4, -1, 1],
109-
projection="X8c",
110-
incols=[1, 0, 2],
111-
scale="0.5c",
112-
color="blue",
113-
pen="1.0p",
114-
track="0.5p",
115-
position="jRM+w2+lnT",
116-
)
117-
assert len(record) == 1

0 commit comments

Comments
 (0)