Skip to content
Merged
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
25 changes: 17 additions & 8 deletions pygmt/src/coast.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,18 @@
A="area_thresh",
C="lakes",
E="dcw",
G="land",
I="rivers",
L="map_scale",
N="borders",
S="water",
W="shorelines",
)
def coast(
def coast( # noqa: PLR0913
self,
resolution: Literal[
"auto", "full", "high", "intermediate", "low", "crude", None
] = None,
land: str | None = None,
water: str | None = None,
box: Box | bool = False,
projection: str | None = None,
frame: str | Sequence[str] | bool = False,
Expand Down Expand Up @@ -70,8 +70,10 @@ def coast(
- B = frame
- D = resolution
- F = box
- G = land
- J = projection
- R = region
- S = water
- V = verbose
- c = panel
- p = perspective
Expand All @@ -97,8 +99,10 @@ def coast(
``"low"``, and ``"crude"``, which drops by 80% between levels. Default is
``"auto"`` to automatically select the most suitable resolution given the chosen
map scale.
land : str
land
Select filling of "dry" areas.
water
Select filling of "wet" areas.
rivers : int, str, or list
*river*\ [/*pen*].
Draw rivers. Specify the type of rivers and [optionally] append
Expand Down Expand Up @@ -149,8 +153,6 @@ def coast(
- ``3``: marine boundaries
- ``"a"``: all boundaries (``1`` - ``3``)

water : str
Select filling "wet" areas.
shorelines : bool, int, str, or list
[*level*\ /]\ *pen*.
Draw shorelines [Default is no shorelines]. Append pen attributes
Expand Down Expand Up @@ -201,10 +203,15 @@ def coast(
>>> fig.show()
"""
self._activate_figure()
if not args_in_kwargs(args=["C", "G", "S", "I", "N", "E", "Q", "W"], kwargs=kwargs):

if (
kwargs.get("G", land) is None
and kwargs.get("S", water) is None
and not args_in_kwargs(args=["C", "I", "N", "E", "Q", "W"], kwargs=kwargs)
):
msg = (
"At least one of the following parameters must be specified: "
"lakes, land, water, rivers, borders, dcw, Q, or shorelines."
"land, water, lakes, rivers, borders, dcw, Q, or shorelines."
)
raise GMTInvalidInput(msg)

Expand All @@ -222,6 +229,8 @@ def coast(
},
),
F=Alias(box, name="box"),
G=Alias(land, name="land"),
S=Alias(water, name="water"),
).add_common(
B=frame,
J=projection,
Expand Down