Skip to content

Commit 5ec1180

Browse files
committed
Check that inner_pen is set when inner_gap is set
1 parent c4a19a5 commit 5ec1180

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pygmt/params/box.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from collections.abc import Sequence
77

88
from pygmt.alias import Alias
9-
from pygmt.exceptions import GMTValueError
9+
from pygmt.exceptions import GMTInvalidInput, GMTValueError
1010
from pygmt.params.base import BaseParam
1111

1212

@@ -98,6 +98,9 @@ def _innerborder(self) -> list[str | float] | None:
9898
"""
9999
Inner border of the box, formatted as a list of 1-2 values, or None.
100100
"""
101+
if self.inner_gap is not None and self.inner_pen is None:
102+
msg = "Parameter 'inner_pen' is required when 'inner_gap' is set."
103+
raise GMTInvalidInput(msg)
101104
return [v for v in (self.inner_gap, self.inner_pen) if v is not None] or None
102105

103106
@property

0 commit comments

Comments
 (0)