Skip to content

Commit ecb580e

Browse files
committed
Merge branch 'main' into arg_with_space
2 parents 801ba01 + 9b1d516 commit ecb580e

14 files changed

+22
-164
lines changed

pygmt/src/blockm.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def _blockm(block_method, data, x, y, z, outfile, **kwargs):
8585
r="registration",
8686
w="wrap",
8787
)
88-
@kwargs_to_strings(R="sequence", i="sequence_comma", o="sequence_comma")
88+
@kwargs_to_strings(I="sequence", R="sequence", i="sequence_comma", o="sequence_comma")
8989
def blockmean(data=None, x=None, y=None, z=None, outfile=None, **kwargs):
9090
r"""
9191
Block average (x,y,z) data tables by mean estimation.
@@ -182,7 +182,7 @@ def blockmean(data=None, x=None, y=None, z=None, outfile=None, **kwargs):
182182
r="registration",
183183
w="wrap",
184184
)
185-
@kwargs_to_strings(R="sequence", i="sequence_comma", o="sequence_comma")
185+
@kwargs_to_strings(I="sequence", R="sequence", i="sequence_comma", o="sequence_comma")
186186
def blockmedian(data=None, x=None, y=None, z=None, outfile=None, **kwargs):
187187
r"""
188188
Block average (x,y,z) data tables by median estimation.
@@ -270,7 +270,7 @@ def blockmedian(data=None, x=None, y=None, z=None, outfile=None, **kwargs):
270270
r="registration",
271271
w="wrap",
272272
)
273-
@kwargs_to_strings(R="sequence", i="sequence_comma", o="sequence_comma")
273+
@kwargs_to_strings(I="sequence", R="sequence", i="sequence_comma", o="sequence_comma")
274274
def blockmode(data=None, x=None, y=None, z=None, outfile=None, **kwargs):
275275
r"""
276276
Block average (x,y,z) data tables by mode estimation.

pygmt/src/contour.py

-2
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,13 @@
66
from pygmt.helpers import (
77
build_arg_string,
88
check_data_input_order,
9-
deprecate_parameter,
109
fmt_docstring,
1110
kwargs_to_strings,
1211
use_alias,
1312
)
1413

1514

1615
@fmt_docstring
17-
@deprecate_parameter("columns", "incols", "v0.4.0", remove_version="v0.6.0")
1816
@check_data_input_order("v0.5.0", remove_version="v0.7.0")
1917
@use_alias(
2018
A="annotation",

pygmt/src/grdfilter.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
f="coltypes",
2727
r="registration",
2828
)
29-
@kwargs_to_strings(R="sequence")
29+
@kwargs_to_strings(I="sequence", R="sequence")
3030
def grdfilter(grid, **kwargs):
3131
r"""
3232
Filter a grid in the space (or time) domain.

pygmt/src/grdlandmask.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
V="verbose",
2828
r="registration",
2929
)
30-
@kwargs_to_strings(R="sequence", N="sequence", E="sequence")
30+
@kwargs_to_strings(I="sequence", R="sequence", N="sequence", E="sequence")
3131
def grdlandmask(**kwargs):
3232
r"""
3333
Create a grid file with set values for land and water.

pygmt/src/grdproject.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
n="interpolation",
3131
r="registration",
3232
)
33-
@kwargs_to_strings(C="sequence", R="sequence")
33+
@kwargs_to_strings(C="sequence", D="sequence", R="sequence")
3434
def grdproject(grid, **kwargs):
3535
r"""
3636
Change projection of gridded data between geographical and rectangular.

pygmt/src/nearneighbor.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
r="registration",
3434
w="wrap",
3535
)
36-
@kwargs_to_strings(R="sequence", i="sequence_comma")
36+
@kwargs_to_strings(I="sequence", R="sequence", i="sequence_comma")
3737
def nearneighbor(data=None, x=None, y=None, z=None, **kwargs):
3838
r"""
3939
Grid table data using a "Nearest neighbor" algorithm

pygmt/src/plot.py

-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
build_arg_string,
88
check_data_input_order,
99
data_kind,
10-
deprecate_parameter,
1110
fmt_docstring,
1211
is_nonstr_iter,
1312
kwargs_to_strings,
@@ -17,8 +16,6 @@
1716

1817

1918
@fmt_docstring
20-
@deprecate_parameter("sizes", "size", "v0.4.0", remove_version="v0.6.0")
21-
@deprecate_parameter("columns", "incols", "v0.4.0", remove_version="v0.6.0")
2219
@check_data_input_order("v0.5.0", remove_version="v0.7.0")
2320
@use_alias(
2421
A="straight_line",

pygmt/src/plot3d.py

-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
build_arg_string,
88
check_data_input_order,
99
data_kind,
10-
deprecate_parameter,
1110
fmt_docstring,
1211
is_nonstr_iter,
1312
kwargs_to_strings,
@@ -17,8 +16,6 @@
1716

1817

1918
@fmt_docstring
20-
@deprecate_parameter("columns", "incols", "v0.4.0", remove_version="v0.6.0")
21-
@deprecate_parameter("sizes", "size", "v0.4.0", remove_version="v0.6.0")
2219
@check_data_input_order("v0.5.0", remove_version="v0.7.0")
2320
@use_alias(
2421
A="straight_line",

pygmt/src/rose.py

-2
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,13 @@
66
from pygmt.helpers import (
77
build_arg_string,
88
check_data_input_order,
9-
deprecate_parameter,
109
fmt_docstring,
1110
kwargs_to_strings,
1211
use_alias,
1312
)
1413

1514

1615
@fmt_docstring
17-
@deprecate_parameter("columns", "incols", "v0.4.0", remove_version="v0.6.0")
1816
@check_data_input_order("v0.5.0", remove_version="v0.7.0")
1917
@use_alias(
2018
A="sector",

pygmt/src/surface.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
r="registration",
3434
w="wrap",
3535
)
36-
@kwargs_to_strings(R="sequence")
36+
@kwargs_to_strings(I="sequence", R="sequence")
3737
def surface(data=None, x=None, y=None, z=None, **kwargs):
3838
r"""
3939
Grids table data using adjustable tension continuous curvature splines.

pygmt/tests/test_contour.py

+14-13
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

pygmt/tests/test_plot.py

-47
Original file line numberDiff line numberDiff line change
@@ -452,53 +452,6 @@ def test_plot_datetime():
452452
return fig
453453

454454

455-
@pytest.mark.mpl_image_compare(filename="test_plot_sizes.png")
456-
def test_plot_deprecate_sizes_to_size(data, region):
457-
"""
458-
Make sure that the old parameter "sizes" is supported and it reports a
459-
warning.
460-
461-
Modified from the test_plot_sizes() test.
462-
"""
463-
fig = Figure()
464-
with pytest.warns(expected_warning=FutureWarning) as record:
465-
fig.plot(
466-
x=data[:, 0],
467-
y=data[:, 1],
468-
sizes=0.5 * data[:, 2],
469-
region=region,
470-
projection="X10c",
471-
style="cc",
472-
color="blue",
473-
frame="af",
474-
)
475-
assert len(record) == 1 # check that only one warning was raised
476-
return fig
477-
478-
479-
@pytest.mark.mpl_image_compare(filename="test_plot_from_file.png")
480-
def test_plot_deprecate_columns_to_incols(region):
481-
"""
482-
Make sure that the old parameter "columns" is supported and it reports a
483-
warning.
484-
485-
Modified from the test_plot_from_file() test.
486-
"""
487-
fig = Figure()
488-
with pytest.warns(expected_warning=FutureWarning) as record:
489-
fig.plot(
490-
data=POINTS_DATA,
491-
region=region,
492-
projection="X10c",
493-
style="d1c",
494-
color="yellow",
495-
frame=True,
496-
columns=[0, 1],
497-
)
498-
assert len(record) == 1 # check that only one warning was raised
499-
return fig
500-
501-
502455
@pytest.mark.mpl_image_compare
503456
def test_plot_ogrgmt_file_multipoint_default_style():
504457
"""

pygmt/tests/test_plot3d.py

-52
Original file line numberDiff line numberDiff line change
@@ -423,58 +423,6 @@ def test_plot3d_scalar_xyz():
423423
return fig
424424

425425

426-
@pytest.mark.mpl_image_compare(filename="test_plot3d_sizes.png")
427-
def test_plot3d_deprecate_sizes_to_size(data, region):
428-
"""
429-
Make sure that the old parameter "sizes" is supported and it reports an
430-
warning.
431-
432-
Modified from the test_plot3d_sizes() test.
433-
"""
434-
fig = Figure()
435-
with pytest.warns(expected_warning=FutureWarning) as record:
436-
fig.plot3d(
437-
x=data[:, 0],
438-
y=data[:, 1],
439-
z=data[:, 2],
440-
zscale=5,
441-
perspective=[225, 30],
442-
sizes=0.5 * data[:, 2],
443-
region=region,
444-
projection="X10c",
445-
style="ui",
446-
color="blue",
447-
frame=["af", "zaf"],
448-
)
449-
assert len(record) == 1 # check that only one warning was raised
450-
return fig
451-
452-
453-
@pytest.mark.mpl_image_compare(filename="test_plot3d_matrix.png")
454-
def test_plot3d_deprecate_columns_to_incols(data, region):
455-
"""
456-
Make sure that the old parameter "columns" is supported and it reports an
457-
warning.
458-
459-
Modified from the test_plot3d_matrix() test.
460-
"""
461-
fig = Figure()
462-
with pytest.warns(expected_warning=FutureWarning) as record:
463-
fig.plot3d(
464-
data,
465-
zscale=5,
466-
perspective=[225, 30],
467-
region=region,
468-
projection="M20c",
469-
style="c1c",
470-
color="#aaaaaa",
471-
frame=["a", "za"],
472-
columns="0,1,2",
473-
)
474-
assert len(record) == 1 # check that only one warning was raised
475-
return fig
476-
477-
478426
@pytest.mark.mpl_image_compare
479427
def test_plot3d_ogrgmt_file_multipoint_default_style():
480428
"""

pygmt/tests/test_rose.py

-34
Original file line numberDiff line numberDiff line change
@@ -184,37 +184,3 @@ def test_rose_bools(data_fractures_compilation):
184184
shift=False,
185185
)
186186
return fig
187-
188-
189-
@pytest.mark.mpl_image_compare(filename="test_rose_bools.png")
190-
def test_rose_deprecate_columns_to_incols(data_fractures_compilation):
191-
"""
192-
Make sure that the old parameter "columns" is supported and it reports a
193-
warning.
194-
195-
Modified from the test_rose_bools() test.
196-
"""
197-
198-
# swap data column order of the sample fractures compilation dataset,
199-
# as the use of the 'columns' parameter will reverse this action
200-
data = data_fractures_compilation[["azimuth", "length"]]
201-
202-
fig = Figure()
203-
with pytest.warns(expected_warning=FutureWarning) as record:
204-
fig.rose(
205-
data,
206-
region=[0, 1, 0, 360],
207-
sector=10,
208-
columns=[1, 0],
209-
diameter="10c",
210-
frame=["x0.2g0.2", "y30g30", "+glightgray"],
211-
color="red3",
212-
pen="1p",
213-
orientation=False,
214-
norm=True,
215-
vectors=True,
216-
no_scale=True,
217-
shift=False,
218-
)
219-
assert len(record) == 1 # check that only one warning was raised
220-
return fig

0 commit comments

Comments
 (0)