Skip to content

Commit 23e908c

Browse files
weiji14Meghan Jones
and
Meghan Jones
committed
Rename alias to spec (S) and update baseline images for GMT 6.2.0rc1
Co-Authored-By: Meghan Jones <[email protected]>
1 parent c9c7b66 commit 23e908c

File tree

5 files changed

+21
-21
lines changed

5 files changed

+21
-21
lines changed

examples/gallery/symbols/velo_arrow_ellipse.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
pen="0.6p,red",
3434
uncertainty_color="lightblue1",
3535
line=True,
36-
scaling="e0.2/0.39/18",
36+
spec="e0.2/0.39/18",
3737
frame=["WSne", "2g2f"],
3838
projection="x0.8c",
3939
vector="0.3c+p1p+e+gred",

pygmt/src/velo.py

+11-11
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
L="line",
2323
N="no_clip",
2424
R="region",
25-
S="scaling",
25+
S="spec",
2626
U="timestamp",
2727
V="verbose",
2828
W="pen",
@@ -45,7 +45,7 @@ def velo(self, data=None, **kwargs):
4545
crosses. Symbol fills or their outlines may be colored based on constant
4646
parameters or via color lookup tables.
4747
48-
Must provide ``data`` and ``scaling``.
48+
Must provide ``data`` and ``spec``.
4949
5050
Full option list at :gmt-docs:`supplements/geodesy/velo.html`
5151
@@ -58,7 +58,7 @@ def velo(self, data=None, **kwargs):
5858
:class:`pandas.DataFrame` with the tabular data. Note that text columns
5959
are only supported with file or pandas DataFrame inputs.
6060
61-
scaling: str
61+
spec: str
6262
Selects the meaning of the columns in the data file and the figure
6363
to be plotted. In all cases, the scales are in data units per length
6464
unit and sizes are in length units (default length unit is controlled
@@ -160,13 +160,13 @@ def velo(self, data=None, **kwargs):
160160
{B}
161161
{CPT}
162162
rescale : str
163-
can be used to rescale the uncertainties of velocities
164-
(``scaling='e'`` and ``scaling='r'``) and rotations
165-
(``scaling='w'``). Can be combined with the ``confidence`` variable.
163+
can be used to rescale the uncertainties of velocities (``spec='e'``
164+
and ``spec='r'``) and rotations (``spec='w'``). Can be combined with
165+
the ``confidence`` variable.
166166
uncertainty_color : str
167167
Sets the color or shade used for filling uncertainty wedges
168-
(``scaling='w'``) or velocity error ellipses (``scaling='e'`` or
169-
``scaling='r'``). If ``uncertainty_color`` is not specified, the
168+
(``spec='w'``) or velocity error ellipses (``spec='e'`` or
169+
``spec='r'``). If ``uncertainty_color`` is not specified, the
170170
uncertainty regions will be transparent. **Note**: Using ``cmap`` and
171171
``zvalue='+e'`` will update the uncertainty fill color based on the
172172
selected measure in ``zvalue`` [magnitude error]. More details at
@@ -182,7 +182,7 @@ def velo(self, data=None, **kwargs):
182182
Scale symbol sizes and pen widths on a per-record basis using the
183183
*scale* read from the data set, given as the first column after the
184184
(optional) *z* and *size* columns [Default is no scaling]. The symbol
185-
size is either provided by ``scaling`` or via the input *size* column.
185+
size is either provided by ``spec`` or via the input *size* column.
186186
Alternatively, append a constant *scale* that should be used instead of
187187
reading a scale column.
188188
shading : float or bool
@@ -191,7 +191,7 @@ def velo(self, data=None, **kwargs):
191191
modulate the symbol fill color by simulating illumination [Default is
192192
none]. If *intens* is not provided we will instead read the intensity
193193
from an extra data column after the required input columns determined
194-
by ``scaling``.
194+
by ``spec``.
195195
line: str
196196
[*pen*\ [**+c**\ [**f**\|\ **l**]]].
197197
Draw lines. Ellipses and rotational wedges will have their outlines
@@ -231,7 +231,7 @@ def velo(self, data=None, **kwargs):
231231
kwargs = self._preprocess(**kwargs) # pylint: disable=protected-access
232232

233233
if "S" not in kwargs or ("S" in kwargs and not isinstance(kwargs["S"], str)):
234-
raise GMTInvalidInput("Scaling is a required argument and has to be a string.")
234+
raise GMTInvalidInput("Spec is a required argument and has to be a string.")
235235

236236
if isinstance(data, np.ndarray) and not pd.api.types.is_numeric_dtype(data):
237237
raise GMTInvalidInput(
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
outs:
2-
- md5: 0d50fb17d52af222b890d44fbd9050c4
3-
size: 48104
2+
- md5: 64e45d586112fc131090cfac2c104b63
3+
size: 45483
44
path: test_velo_numpy_array_numeric_only.png
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
outs:
2-
- md5: fc51d80c438a1961f700c68e207ecc3b
3-
size: 44161
2+
- md5: 60dff1a72e6d984f095fb4973cecaec7
3+
size: 42430
44
path: test_velo_pandas_dataframe.png

pygmt/tests/test_velo.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def test_velo_numpy_array_numeric_only(dataframe):
3434
fig = Figure()
3535
fig.velo(
3636
data=dataframe.iloc[:, :-1].to_numpy(),
37-
scaling="e0.2/0.39/18",
37+
spec="e0.2/0.39/18",
3838
vector="0.3c+p1p+e+gred",
3939
frame="1g1",
4040
)
@@ -49,14 +49,14 @@ def test_velo_numpy_array_text_column(dataframe):
4949
with pytest.raises(GMTInvalidInput):
5050
fig.velo(
5151
data=dataframe.to_numpy(),
52-
scaling="e0.2/0.39/18",
52+
spec="e0.2/0.39/18",
5353
vector="0.3c+p1p+e+gred",
5454
)
5555

5656

57-
def test_velo_without_scaling(dataframe):
57+
def test_velo_without_spec(dataframe):
5858
"""
59-
Check that velo fails when the scaling parameter is not given.
59+
Check that velo fails when the spec parameter is not given.
6060
"""
6161
fig = Figure()
6262
with pytest.raises(GMTInvalidInput):
@@ -71,7 +71,7 @@ def test_velo_pandas_dataframe(dataframe):
7171
fig = Figure()
7272
fig.velo(
7373
data=dataframe,
74-
scaling="e0.2/0.39/18",
74+
spec="e0.2/0.39/18",
7575
vector="0.3c+p1p+e+gred",
7676
frame=["WSne", "2g2f"],
7777
region=[-10, 8, -10, 6],

0 commit comments

Comments
 (0)