From 530289b239cade25fe3a6e5a04cff9abbf3f6adb Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Mon, 15 Dec 2025 16:17:26 +0800 Subject: [PATCH 1/3] List common aliases at the end of docstrings --- doc/conf.py | 1 + pygmt/src/coast.py | 17 ++++++++++------- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index c9558797ceb..a20816d4373 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -124,6 +124,7 @@ # Render the return argument and attribute lists in the same way as the parameter lists. napoleon_use_rtype = False napoleon_use_ivar = True +napoleon_custom_sections = [("Common Parameters", "params_style")] # Options for sphinx-copybutton. # Reference: https://sphinx-copybutton.readthedocs.io diff --git a/pygmt/src/coast.py b/pygmt/src/coast.py index 2c94a5403d4..c40d692b98f 100644 --- a/pygmt/src/coast.py +++ b/pygmt/src/coast.py @@ -27,14 +27,14 @@ def coast( # noqa: PLR0913 borders: int | str | Sequence[int | str] | None = None, shorelines: bool | str | Sequence[int | str] = False, box: Box | bool = False, - projection: str | None = None, frame: str | Sequence[str] | bool = False, + projection: str | None = None, region: Sequence[float | str] | str | None = None, verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"] | bool = False, panel: int | Sequence[int] | bool = False, - transparency: float | None = None, perspective: float | Sequence[float] | str | bool = False, + transparency: float | None = None, **kwargs, ): r""" @@ -72,11 +72,7 @@ def coast( # noqa: PLR0913 Parameters ---------- - $projection - $region - *Required if this is the first plot command.* $area_thresh - $frame lakes : str or list *fill*\ [**+l**\|\ **+r**]. Set the shade, color, or pattern for lakes and river-lakes. The @@ -196,10 +192,17 @@ def coast( # noqa: PLR0913 to any of the continent codes (e.g. ``"=EU"`` for Europe). Append **+p**\ *pen* to draw polygon outlines [Default is no outline] and **+g**\ *fill* to fill them [Default is no fill]. + + Common Parameters + ----------------- + $frame + $projection + $region + *Required if this is the first plot command.* + $verbose $panel $perspective $transparency - $verbose Example ------- From a71c45b0c51c7064b445d0d92014d96f08b9c29b Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Tue, 16 Dec 2025 18:15:58 +0800 Subject: [PATCH 2/3] Remove the section heading of 'Common Parameters' --- doc/conf.py | 1 - pygmt/src/coast.py | 3 --- 2 files changed, 4 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index a20816d4373..c9558797ceb 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -124,7 +124,6 @@ # Render the return argument and attribute lists in the same way as the parameter lists. napoleon_use_rtype = False napoleon_use_ivar = True -napoleon_custom_sections = [("Common Parameters", "params_style")] # Options for sphinx-copybutton. # Reference: https://sphinx-copybutton.readthedocs.io diff --git a/pygmt/src/coast.py b/pygmt/src/coast.py index c40d692b98f..c895d9d8236 100644 --- a/pygmt/src/coast.py +++ b/pygmt/src/coast.py @@ -192,9 +192,6 @@ def coast( # noqa: PLR0913 to any of the continent codes (e.g. ``"=EU"`` for Europe). Append **+p**\ *pen* to draw polygon outlines [Default is no outline] and **+g**\ *fill* to fill them [Default is no fill]. - - Common Parameters - ----------------- $frame $projection $region From ca29e23166501d9f1d33af585288dd1346c3ee0d Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Wed, 17 Dec 2025 11:40:29 +0800 Subject: [PATCH 3/3] Fix order --- pygmt/src/coast.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pygmt/src/coast.py b/pygmt/src/coast.py index c895d9d8236..028307a1a6d 100644 --- a/pygmt/src/coast.py +++ b/pygmt/src/coast.py @@ -27,9 +27,9 @@ def coast( # noqa: PLR0913 borders: int | str | Sequence[int | str] | None = None, shorelines: bool | str | Sequence[int | str] = False, box: Box | bool = False, - frame: str | Sequence[str] | bool = False, projection: str | None = None, region: Sequence[float | str] | str | None = None, + frame: str | Sequence[str] | bool = False, verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"] | bool = False, panel: int | Sequence[int] | bool = False, @@ -192,10 +192,10 @@ def coast( # noqa: PLR0913 to any of the continent codes (e.g. ``"=EU"`` for Europe). Append **+p**\ *pen* to draw polygon outlines [Default is no outline] and **+g**\ *fill* to fill them [Default is no fill]. - $frame $projection $region *Required if this is the first plot command.* + $frame $verbose $panel $perspective