Skip to content

Commit

Permalink
Figure.plot/plot3d: Remove parameter "sizes", use "size" instead (Gen…
Browse files Browse the repository at this point in the history
…ericMappingTools#1809)

Remove the parameter "sizes" in favour of "size" from `Figure.plot`
and `Figure.plot3d`. Deprecation warning was added in v0.4.0
(xref GenericMappingTools#1254, GenericMappingTools#1258), and is to be fully removed in v0.6.0.
  • Loading branch information
weiji14 authored and Josh Sixsmith committed Dec 21, 2022
1 parent 27a1e27 commit b0a7682
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 55 deletions.
2 changes: 0 additions & 2 deletions pygmt/src/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
build_arg_string,
check_data_input_order,
data_kind,
deprecate_parameter,
fmt_docstring,
is_nonstr_iter,
kwargs_to_strings,
Expand All @@ -17,7 +16,6 @@


@fmt_docstring
@deprecate_parameter("sizes", "size", "v0.4.0", remove_version="v0.6.0")
@check_data_input_order("v0.5.0", remove_version="v0.7.0")
@use_alias(
A="straight_line",
Expand Down
2 changes: 0 additions & 2 deletions pygmt/src/plot3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
build_arg_string,
check_data_input_order,
data_kind,
deprecate_parameter,
fmt_docstring,
is_nonstr_iter,
kwargs_to_strings,
Expand All @@ -17,7 +16,6 @@


@fmt_docstring
@deprecate_parameter("sizes", "size", "v0.4.0", remove_version="v0.6.0")
@check_data_input_order("v0.5.0", remove_version="v0.7.0")
@use_alias(
A="straight_line",
Expand Down
24 changes: 0 additions & 24 deletions pygmt/tests/test_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -452,30 +452,6 @@ def test_plot_datetime():
return fig


@pytest.mark.mpl_image_compare(filename="test_plot_sizes.png")
def test_plot_deprecate_sizes_to_size(data, region):
"""
Make sure that the old parameter "sizes" is supported and it reports a
warning.
Modified from the test_plot_sizes() test.
"""
fig = Figure()
with pytest.warns(expected_warning=FutureWarning) as record:
fig.plot(
x=data[:, 0],
y=data[:, 1],
sizes=0.5 * data[:, 2],
region=region,
projection="X10c",
style="cc",
color="blue",
frame="af",
)
assert len(record) == 1 # check that only one warning was raised
return fig


@pytest.mark.mpl_image_compare
def test_plot_ogrgmt_file_multipoint_default_style():
"""
Expand Down
27 changes: 0 additions & 27 deletions pygmt/tests/test_plot3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,33 +423,6 @@ def test_plot3d_scalar_xyz():
return fig


@pytest.mark.mpl_image_compare(filename="test_plot3d_sizes.png")
def test_plot3d_deprecate_sizes_to_size(data, region):
"""
Make sure that the old parameter "sizes" is supported and it reports an
warning.
Modified from the test_plot3d_sizes() test.
"""
fig = Figure()
with pytest.warns(expected_warning=FutureWarning) as record:
fig.plot3d(
x=data[:, 0],
y=data[:, 1],
z=data[:, 2],
zscale=5,
perspective=[225, 30],
sizes=0.5 * data[:, 2],
region=region,
projection="X10c",
style="ui",
color="blue",
frame=["af", "zaf"],
)
assert len(record) == 1 # check that only one warning was raised
return fig


@pytest.mark.mpl_image_compare
def test_plot3d_ogrgmt_file_multipoint_default_style():
"""
Expand Down

0 comments on commit b0a7682

Please sign in to comment.