Skip to content

Figure.psconvert: Remove the deprecated parameter 'icc_gray' (deprecated since v0.6.0) #2267

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Dec 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 1 addition & 14 deletions pygmt/figure.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"""
import base64
import os
import warnings
from pathlib import Path
from tempfile import TemporaryDirectory

Expand Down Expand Up @@ -141,7 +140,7 @@ def region(self):
V="verbose",
)
@kwargs_to_strings()
def psconvert(self, icc_gray=False, **kwargs):
def psconvert(self, **kwargs):
r"""
Convert [E]PS file(s) to other formats.

Expand Down Expand Up @@ -230,18 +229,6 @@ def psconvert(self, icc_gray=False, **kwargs):
# Default cropping the figure to True
if kwargs.get("A") is None:
kwargs["A"] = ""

if icc_gray:
msg = (
"The 'icc_gray' parameter has been deprecated since v0.6.0"
" and will be removed in v0.8.0."
)
warnings.warn(msg, category=FutureWarning, stacklevel=2)
if kwargs.get("N") is None:
kwargs["N"] = "+i"
else:
kwargs["N"] += "+i"

# Manually handle prefix -F argument so spaces aren't converted to \040
# by build_arg_string function. For more information, see
# https://github.com/GenericMappingTools/pygmt/pull/1487
Expand Down
11 changes: 0 additions & 11 deletions pygmt/tests/test_figure.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,17 +266,6 @@ def test_figure_set_display_invalid():
set_display(method="invalid")


def test_figure_icc_gray():
"""
Check if icc_gray parameter works correctly if used.
"""
fig = Figure()
fig.basemap(region=[0, 1, 0, 1], projection="X1c/1c", frame=True)
with pytest.warns(expected_warning=FutureWarning) as record:
fig.psconvert(icc_gray=True, prefix="Test")
assert len(record) == 1 # check that only one warning was raised


def test_figure_deprecated_xshift_yshift():
"""
Check if deprecation of parameters X/Y/xshift/yshift work correctly if
Expand Down