Skip to content

Commit c5753c9

Browse files
authored
[BREAKING] Figure.grdimage: Raise NotImplementedError instead of GMTInvalidInput for -A option (#4062)
1 parent 51e294e commit c5753c9

File tree

2 files changed

+5
-11
lines changed

2 files changed

+5
-11
lines changed

pygmt/src/grdimage.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,7 @@
66
from pygmt._typing import PathLike
77
from pygmt.alias import Alias, AliasSystem
88
from pygmt.clib import Session
9-
from pygmt.exceptions import GMTInvalidInput
10-
from pygmt.helpers import (
11-
build_arg_list,
12-
fmt_docstring,
13-
kwargs_to_strings,
14-
use_alias,
15-
)
9+
from pygmt.helpers import build_arg_list, fmt_docstring, kwargs_to_strings, use_alias
1610

1711
__doctest_skip__ = ["grdimage"]
1812

@@ -171,7 +165,7 @@ def grdimage(
171165
"Parameter 'img_out'/'A' is not implemented. "
172166
"Please consider submitting a feature request to us."
173167
)
174-
raise GMTInvalidInput(msg)
168+
raise NotImplementedError(msg)
175169

176170
aliasdict = AliasSystem(
177171
J=Alias(projection, name="projection"),

pygmt/tests/test_grdimage.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from pygmt.clib import __gmt_version__
1111
from pygmt.datasets import load_earth_relief
1212
from pygmt.enums import GridRegistration, GridType
13-
from pygmt.exceptions import GMTInvalidInput, GMTTypeError
13+
from pygmt.exceptions import GMTTypeError
1414
from pygmt.helpers.testing import check_figures_equal
1515

1616

@@ -252,9 +252,9 @@ def test_grdimage_imgout_fails(grid):
252252
Test that an exception is raised if img_out/A is given.
253253
"""
254254
fig = Figure()
255-
with pytest.raises(GMTInvalidInput):
255+
with pytest.raises(NotImplementedError):
256256
fig.grdimage(grid, img_out="out.png")
257-
with pytest.raises(GMTInvalidInput):
257+
with pytest.raises(NotImplementedError):
258258
fig.grdimage(grid, A="out.png")
259259

260260

0 commit comments

Comments
 (0)