File tree 2 files changed +0
-69
lines changed
2 files changed +0
-69
lines changed Original file line number Diff line number Diff line change 1
1
"""
2
2
wiggle - Plot z=f(x,y) anomalies along tracks.
3
3
"""
4
- import warnings
5
4
6
5
from pygmt .clib import Session
7
- from pygmt .exceptions import GMTInvalidInput
8
6
from pygmt .helpers import build_arg_string , fmt_docstring , kwargs_to_strings , use_alias
9
7
10
8
11
9
@fmt_docstring
12
10
@use_alias (
13
11
B = "frame" ,
14
12
D = "position" ,
15
- G = "color" ,
16
13
J = "projection" ,
17
14
R = "region" ,
18
15
T = "track" ,
@@ -102,17 +99,6 @@ def wiggle(
102
99
"""
103
100
kwargs = self ._preprocess (** kwargs )
104
101
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
-
116
102
if fillpositive or fillnegative :
117
103
kwargs ["G" ] = []
118
104
if fillpositive :
Original file line number Diff line number Diff line change 4
4
import numpy as np
5
5
import pytest
6
6
from pygmt import Figure
7
- from pygmt .exceptions import GMTInvalidInput
8
7
9
8
10
9
@pytest .mark .mpl_image_compare
@@ -61,57 +60,3 @@ def test_wiggle_data_incols():
61
60
position = "jRM+w2+lnT" ,
62
61
)
63
62
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
You can’t perform that action at this time.
0 commit comments