From 0d8b7f0e67d554aea641777385065abb6f2b44e4 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 12 Feb 2026 14:15:42 +0000 Subject: [PATCH 01/11] Initial plan From 4d803f20f04f7ba196ed614988753beb5f20ef89 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 12 Feb 2026 14:22:05 +0000 Subject: [PATCH 02/11] Reorganize common parameters in coast.py, basemap.py, and plot.py Co-authored-by: seisman <3974108+seisman@users.noreply.github.com> --- pygmt/src/basemap.py | 8 ++++---- pygmt/src/coast.py | 10 +++++----- pygmt/src/plot.py | 8 ++++---- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/pygmt/src/basemap.py b/pygmt/src/basemap.py index 4bc72c1ad8b..50bc16d4b83 100644 --- a/pygmt/src/basemap.py +++ b/pygmt/src/basemap.py @@ -69,13 +69,9 @@ def basemap( # noqa: PLR0913 Parameters ---------- - $projection zscale zsize Set z-axis scaling or z-axis size. - $region - *Required if this is the first plot command.* - $frame map_scale Draw a map scale bar on the plot. @@ -109,6 +105,10 @@ def basemap( # noqa: PLR0913 :meth:`pygmt.Figure.directional_rose`, or :meth:`pygmt.Figure.magnetic_rose` instead. This parameter is maintained for backward compatibility and accepts raw GMT CLI strings for the ``-F`` option. + $projection + $region + *Required if this is the first plot command.* + $frame $verbose $panel $coltypes diff --git a/pygmt/src/coast.py b/pygmt/src/coast.py index e11806474df..200f1fb0524 100644 --- a/pygmt/src/coast.py +++ b/pygmt/src/coast.py @@ -74,11 +74,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 @@ -203,10 +199,14 @@ 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]. + $projection + $region + *Required if this is the first plot command.* + $frame + $verbose $panel $perspective $transparency - $verbose Example ------- diff --git a/pygmt/src/plot.py b/pygmt/src/plot.py index ab7d0599e63..cd1964ada2b 100644 --- a/pygmt/src/plot.py +++ b/pygmt/src/plot.py @@ -116,8 +116,6 @@ def plot( # noqa: PLR0912, PLR0913 should be a list of two 1-D arrays with the vector directions. These can be angle and length, azimuth and length, or x and y components, depending on the style options chosen. - $projection - $region straight_line By default, line segments are drawn as straight lines in the Cartesian and polar coordinate systems, and as great circle arcs (by resampling coarse input data @@ -141,7 +139,6 @@ def plot( # noqa: PLR0912, PLR0913 meaning of *x* and *y* is reversed, i.e., *x* means meridians and *y* means parallels. The bug is fixed by upstream `PR #8648 `__. - $frame $cmap offset : str *dx*/*dy*. @@ -210,7 +207,6 @@ def plot( # noqa: PLR0912, PLR0913 Plot symbols (including vectors, pie slices, fronts, decorated or quoted lines). $pen - $verbose zvalue : str *value*\|\ *file*. Instead of specifying a symbol or polygon fill and outline color @@ -220,6 +216,10 @@ def plot( # noqa: PLR0912, PLR0913 polygon in the input data. To apply it to the fill color, use ``fill="+z"``. To apply it to the pen color, append **+z** to ``pen``. + $projection + $region + $frame + $verbose $aspatial $binary $panel From 77e711ae831c255e0e3c060de2a75dad67685cdf Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 12 Feb 2026 14:23:53 +0000 Subject: [PATCH 03/11] Reorganize common parameters in plot3d, histogram, grdimage, and grdview Co-authored-by: seisman <3974108+seisman@users.noreply.github.com> --- pygmt/src/grdimage.py | 4 ++-- pygmt/src/grdview.py | 2 +- pygmt/src/histogram.py | 8 ++++---- pygmt/src/plot3d.py | 8 ++++---- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/pygmt/src/grdimage.py b/pygmt/src/grdimage.py index c8e7f262557..3348b63ff46 100644 --- a/pygmt/src/grdimage.py +++ b/pygmt/src/grdimage.py @@ -89,7 +89,6 @@ def grdimage( # noqa: PLR0913 Parameters ---------- $grid - $frame $cmap img_in : str [**r**]. @@ -132,7 +131,6 @@ def grdimage( # noqa: PLR0913 suitable modifiers [Default is no illumination]. **Note**: If the input data represent an *image* then an *intensfile* or constant *intensity* must be provided. - $projection monochrome Force conversion to monochrome image using the (television) YIQ transformation. Cannot be used with ``nan_transparent``. @@ -146,7 +144,9 @@ def grdimage( # noqa: PLR0913 3). If the input is a grid, use **+z** to select another grid value than NaN. If input is instead an image, append an alternate *color* to select another pixel value to be transparent [Default is ``"black"``]. + $projection $region + $frame $verbose $panel $coltypes diff --git a/pygmt/src/grdview.py b/pygmt/src/grdview.py index f9cf5a3a93a..f22d46ff834 100644 --- a/pygmt/src/grdview.py +++ b/pygmt/src/grdview.py @@ -225,7 +225,6 @@ def grdview( # noqa: PLR0913 **+m**\ *ambient* to specify azimuth, intensity, and ambient arguments for that function, or just give **+d** to select the default arguments [Default is ``"+a-45+nt1+m0"``]. - $projection zscale/zsize Set z-axis scaling or z-axis size. region : str or list @@ -233,6 +232,7 @@ def grdview( # noqa: PLR0913 Specify the :doc:`region ` of interest. When used with ``perspective``, optionally append */zmin/zmax* to indicate the range to use for the 3-D axes [Default is the region given by the input grid]. + $projection $frame $verbose $panel diff --git a/pygmt/src/histogram.py b/pygmt/src/histogram.py index 61660b1f538..52231ad9c12 100644 --- a/pygmt/src/histogram.py +++ b/pygmt/src/histogram.py @@ -79,14 +79,10 @@ def histogram( # noqa: PLR0913 data Pass in either a file name to an ASCII data table, a Python list, a 2-D $table_classes. - $projection - $region - $frame $cmap fill : str Set color or pattern for filling bars [Default is no fill]. $pen - $panel annotate : bool or str [**+b**][**+f**\ *font*][**+o**\ *off*][**+r**]. Annotate each bar with the count it represents. Append any of the @@ -149,8 +145,12 @@ def histogram( # noqa: PLR0913 To use weights provided as a second data column instead of pure counts, append **+w**. + $projection + $region + $frame $verbose $binary + $panel $nodata $find $header diff --git a/pygmt/src/plot3d.py b/pygmt/src/plot3d.py index ba100656ba5..70b55d427d0 100644 --- a/pygmt/src/plot3d.py +++ b/pygmt/src/plot3d.py @@ -119,10 +119,8 @@ def plot3d( # noqa: PLR0912, PLR0913 should be a list of two 1-D arrays with the vector directions. These can be angle and length, azimuth and length, or x and y components, depending on the style options chosen. - $projection zscale/zsize Set z-axis scaling or z-axis size. - $region straight_line By default, line segments are drawn as straight lines in the Cartesian and polar coordinate systems, and as great circle arcs (by resampling coarse input data @@ -148,7 +146,6 @@ def plot3d( # noqa: PLR0912, PLR0913 meaning of *x* and *y* is reversed, i.e., *x* means meridians and *y* means parallels. The bug is fixed by upstream `PR #8648 `__. - $frame $cmap offset : str *dx*/*dy*\ [/*dz*]. @@ -189,7 +186,6 @@ def plot3d( # noqa: PLR0912, PLR0913 the foreground are plotted after items in the background. style : str Plot symbols. Full documentation is at :gmt-docs:`plot3d.html#s`. - $verbose $pen zvalue : str *value*\|\ *file*. @@ -200,6 +196,10 @@ def plot3d( # noqa: PLR0912, PLR0913 polygon in the input data. To apply it to the fill color, use ``fill="+z"``. To apply it to the pen color, append **+z** to ``pen``. + $projection + $region + $frame + $verbose $aspatial $binary $panel From a943962da34ac1f511522d09cd311726ce5279f1 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 12 Feb 2026 14:32:45 +0000 Subject: [PATCH 04/11] Reorganize common parameters in remaining 13 files Co-authored-by: seisman <3974108+seisman@users.noreply.github.com> --- pygmt/src/grd2xyz.py | 12 ++++++------ pygmt/src/grdfilter.py | 2 +- pygmt/src/grdlandmask.py | 6 +++--- pygmt/src/grdsample.py | 4 ++-- pygmt/src/grdtrack.py | 8 ++++---- pygmt/src/info.py | 6 ++++-- pygmt/src/nearneighbor.py | 11 ++++++----- pygmt/src/select.py | 6 +++--- pygmt/src/sph2grd.py | 2 +- pygmt/src/surface.py | 1 + pygmt/src/velo.py | 8 ++++---- pygmt/src/x2sys_init.py | 5 ++--- pygmt/src/xyz2grd.py | 12 ++++++------ 13 files changed, 43 insertions(+), 40 deletions(-) diff --git a/pygmt/src/grd2xyz.py b/pygmt/src/grd2xyz.py index fe8b98d8060..84a87cefeb4 100644 --- a/pygmt/src/grd2xyz.py +++ b/pygmt/src/grd2xyz.py @@ -68,10 +68,6 @@ def grd2xyz( **f** to start at 1 (Fortran-style counting). Alternatively, append **i** to write just the two columns *index* and *z*, where *index* is the 1-D indexing that GMT uses when referring to grid nodes. - $region - Adding ``region`` will select a subsection of the grid. If this - subsection exceeds the boundaries of the grid, only the common region - will be output. weight : str [**a**\ [**+u**\ *unit*]\|\ *weight*]. Write out *x,y,z,w*\ , where *w* is the supplied *weight* (or 1 if not @@ -83,7 +79,6 @@ def grd2xyz( this by appending **+u**\ *unit*. For such grids, the area varies with latitude and also sees special cases for gridline-registered layouts at sides, corners, and poles. - $verbose convention : str [*flags*]. Write a 1-column ASCII [or binary] table. Output will be organized @@ -114,10 +109,15 @@ def grd2xyz( - **d**: 8-byte floating point double precision Default format is scanline orientation of ASCII numbers: **TLa**. + $region + Adding ``region`` will select a subsection of the grid. If this + subsection exceeds the boundaries of the grid, only the common region + will be output. + $verbose $binary - $nodata $coltypes $header + $nodata $outcols $skiprows diff --git a/pygmt/src/grdfilter.py b/pygmt/src/grdfilter.py index 2e31869c767..667df2d134b 100644 --- a/pygmt/src/grdfilter.py +++ b/pygmt/src/grdfilter.py @@ -110,8 +110,8 @@ def grdfilter( $region $verbose $coltypes - $registration $cores + $registration Returns ------- diff --git a/pygmt/src/grdlandmask.py b/pygmt/src/grdlandmask.py index 5df4370be7c..f8c7edbe8f9 100644 --- a/pygmt/src/grdlandmask.py +++ b/pygmt/src/grdlandmask.py @@ -64,8 +64,6 @@ def grdlandmask( ---------- $outgrid $spacing - $region - $area_thresh resolution Select the resolution of the coastline dataset to use. The available resolutions from highest to lowest are: ``"full"``, ``"high"``, ``"intermediate"``, @@ -98,9 +96,11 @@ def grdlandmask( Values can be any number, or one of ``None``, ``"NaN"``, and ``np.nan`` for setting nodes to NaN. + $region $verbose - $registration + $area_thresh $cores + $registration Returns ------- diff --git a/pygmt/src/grdsample.py b/pygmt/src/grdsample.py index d6f0ceb502a..be48756dd65 100644 --- a/pygmt/src/grdsample.py +++ b/pygmt/src/grdsample.py @@ -67,17 +67,17 @@ def grdsample( $grid $outgrid $spacing - $region toggle Toggle between grid and pixel registration; if the input is grid-registered, the output will be pixel-registered and vice-versa. This is a *destructive* grid change; see :gmt-docs:`reference/options.html#switch-registrations`. *Note**: ``toggle`` and ``registration`` are mutually exclusive. + $region $verbose $coltypes + $cores $interpolation $registration - $cores Returns ------- diff --git a/pygmt/src/grdtrack.py b/pygmt/src/grdtrack.py index 570a9b9aa25..afd8aaf4127 100644 --- a/pygmt/src/grdtrack.py +++ b/pygmt/src/grdtrack.py @@ -197,7 +197,6 @@ def grdtrack( nearest distance nodes along the cross-profiles. We write 13 output columns per track: *dist, lonc, latc, distc, azimuthc, zc, lonl, latl, distl, lonr, latr, distr, width*. - $region no_skip : bool Do *not* skip points that fall outside the domain of the grid(s) [Default only output points within the grid domain]. @@ -255,19 +254,20 @@ def grdtrack( spherical degrees. Use *radius* to change the unit and give *radius* = 0 if you do not want to limit the radius search. To instead replace the input point with the coordinates of the nearest node, append **+p**. - $verbose z_only : bool Only write out the sampled z-values [Default writes all columns]. + $verbose + $region $aspatial $binary - $nodata - $find $coltypes + $find $gap $header $incols $distcalc $interpolation + $nodata $outcols $skiprows $wrap diff --git a/pygmt/src/info.py b/pygmt/src/info.py index 2ab4d69a3c6..254613ef8fd 100644 --- a/pygmt/src/info.py +++ b/pygmt/src/info.py @@ -68,12 +68,14 @@ def info( **dz**\[\ **+c**\ *col*]. Report the min/max of the first (0'th) column to the nearest multiple of dz and output this in the form ``[zmin, zmax, dz]``. + registration + [**g**\|\ **p**]. + Select gridline or pixel node registration [Default is gridline]. $verbose $aspatial - $incols $coltypes - $registration + $incols Returns ------- diff --git a/pygmt/src/nearneighbor.py b/pygmt/src/nearneighbor.py index dec482aceec..5047da2b8db 100644 --- a/pygmt/src/nearneighbor.py +++ b/pygmt/src/nearneighbor.py @@ -97,8 +97,6 @@ def nearneighbor( $spacing - $region - search_radius : str Set the search radius that determines which data points are considered close to a node. @@ -120,16 +118,19 @@ def nearneighbor( Alternatively, use ``sectors="n"`` to call GDAL's nearest neighbor algorithm instead. + $registration + + $region + $verbose $aspatial $binary - $nodata - $find $coltypes + $find $gap $header $incols - $registration + $nodata $wrap Returns diff --git a/pygmt/src/select.py b/pygmt/src/select.py index dd60eca2c7e..a266fc62163 100644 --- a/pygmt/src/select.py +++ b/pygmt/src/select.py @@ -150,7 +150,6 @@ def select( (and ``area_thresh``, ``resolution``). - **z** select records NOT within the range specified by ``z_subregion``. - $projection mask_values : str or list Pass all records whose location is inside specified geographical features. Specify if records should be skipped (s) or kept (k) using 1 of 2 formats: @@ -168,8 +167,6 @@ def select( the coastlines differ in details, a node in a mask file using one resolution is not guaranteed to remain inside [or outside] when a different resolution is selected. If ``None``, the low resolution is used by default. - $region - $verbose z_subregion : str or list *min*\ [/*max*]\ [**+a**]\ [**+c**\ *col*]\ [**+i**]. Pass all records whose 3rd column (*z*; *col* = 2) lies within the @@ -189,6 +186,9 @@ def select( and **+i** reverses the tests to pass record with *z* value NOT in the given range. Finally, if **+c** is not used then it is automatically incremented for each new ``z_subregion`` argument, starting with 2. + $projection + $region + $verbose $binary $nodata $find diff --git a/pygmt/src/sph2grd.py b/pygmt/src/sph2grd.py index ba25a1ced7c..da287c8023b 100644 --- a/pygmt/src/sph2grd.py +++ b/pygmt/src/sph2grd.py @@ -54,13 +54,13 @@ def sph2grd( $table_classes. $outgrid $spacing + $cores $region $verbose $binary $header $incols $registration - $cores Returns ------- diff --git a/pygmt/src/surface.py b/pygmt/src/surface.py index 8a6accc0355..995b683bfc8 100644 --- a/pygmt/src/surface.py +++ b/pygmt/src/surface.py @@ -141,6 +141,7 @@ def surface( set boundary tension. If you do not prepend **i** or **b**, both will be set to the same value. [Default is 0 for both and gives minimum curvature solution.] + $verbose $aspatial $binary diff --git a/pygmt/src/velo.py b/pygmt/src/velo.py index dbdd37a8c26..04fdbb03fcd 100644 --- a/pygmt/src/velo.py +++ b/pygmt/src/velo.py @@ -174,14 +174,11 @@ def velo( # noqa : PLR0913 with extension taken positive. - **5**: azimuth of eps2 in degrees CW from North. - $projection - $region vector : bool or str Modify vector parameters. For vector heads, append vector head *size* [Default is 9p]. See :gmt-docs:`supplements/geodesy/velo.html#vector-attributes` for specifying additional attributes. - $frame $cmap rescale : str Can be used to rescale the uncertainties of velocities (``spec="e"`` @@ -228,7 +225,6 @@ def velo( # noqa : PLR0913 no_clip Do **not** skip symbols that fall outside the frame boundaries [Default is ``False``, i.e., plot symbols inside the frame boundaries only]. - $verbose pen : str [*pen*][**+c**\ [**f**\|\ **l**]]. Set pen attributes for velocity arrows, ellipse circumference and fault @@ -246,6 +242,10 @@ def velo( # noqa : PLR0913 required columns). To instead use the corresponding error estimates (i.e., vector or rotation uncertainty) to lookup the color and paint the error ellipse or wedge instead, append **+e**. + $projection + $region + $frame + $verbose $panel $nodata $find diff --git a/pygmt/src/x2sys_init.py b/pygmt/src/x2sys_init.py index a7ff867fa55..1abba77d350 100644 --- a/pygmt/src/x2sys_init.py +++ b/pygmt/src/x2sys_init.py @@ -106,9 +106,6 @@ def x2sys_init( [Default is ``units=["dk", "se"]`` (km and m/s) if ``discontinuity`` is set, and ``units=["dc", "sc"]`` otherwise (e.g., for Cartesian units)]. - $region - $verbose - gap : str or list **t**\|\ **d**\ *gap*. Give **t** or **d** and append the corresponding maximum time gap (in @@ -118,6 +115,8 @@ def x2sys_init( If these limits are exceeded then a data gap is assumed and no COE will be determined. + $region + $verbose $distcalc """ aliasdict = AliasSystem( diff --git a/pygmt/src/xyz2grd.py b/pygmt/src/xyz2grd.py index 7a477401a18..e21c9fc59cb 100644 --- a/pygmt/src/xyz2grd.py +++ b/pygmt/src/xyz2grd.py @@ -84,9 +84,6 @@ def xyz2grd( *x* and *y* as *z* is not consulted). Append **z** to sum multiple values that belong to the same node. $spacing - $projection - $region - $verbose convention : str [*flags*]. Read a 1-column ASCII [or binary] table. This assumes that all the @@ -127,13 +124,16 @@ def xyz2grd( each input record to have a single value, while the former can handle multiple values per record but can only parse regular floating point values. Translate incoming *z*-values via the ``incols`` parameter. + $registration + $projection + $region + $verbose $binary - $nodata - $find $coltypes + $find $header $incols - $registration + $nodata $wrap Returns From 1d15d6815b90aeccf186a76436aeda3fc50d31a3 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 12 Feb 2026 14:47:28 +0000 Subject: [PATCH 05/11] Update parameter ordering for zscale/zsize files (basemap, plot3d, grdview) Co-authored-by: seisman <3974108+seisman@users.noreply.github.com> --- pygmt/src/basemap.py | 16 ++++++++-------- pygmt/src/grdview.py | 2 +- pygmt/src/plot3d.py | 10 +++++----- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/pygmt/src/basemap.py b/pygmt/src/basemap.py index 50bc16d4b83..e7ab7012560 100644 --- a/pygmt/src/basemap.py +++ b/pygmt/src/basemap.py @@ -15,19 +15,19 @@ def basemap( # noqa: PLR0913 self, projection: str | None = None, - zsize: float | str | None = None, zscale: float | str | None = None, - frame: str | Sequence[str] | bool = False, + zsize: float | 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, map_scale: str | None = None, compass: str | None = None, rose: str | None = None, box: str | bool = False, - 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, ): """ @@ -69,9 +69,6 @@ def basemap( # noqa: PLR0913 Parameters ---------- - zscale - zsize - Set z-axis scaling or z-axis size. map_scale Draw a map scale bar on the plot. @@ -106,6 +103,9 @@ def basemap( # noqa: PLR0913 instead. This parameter is maintained for backward compatibility and accepts raw GMT CLI strings for the ``-F`` option. $projection + zscale + zsize + Set z-axis scaling or z-axis size. $region *Required if this is the first plot command.* $frame diff --git a/pygmt/src/grdview.py b/pygmt/src/grdview.py index f22d46ff834..f9cf5a3a93a 100644 --- a/pygmt/src/grdview.py +++ b/pygmt/src/grdview.py @@ -225,6 +225,7 @@ def grdview( # noqa: PLR0913 **+m**\ *ambient* to specify azimuth, intensity, and ambient arguments for that function, or just give **+d** to select the default arguments [Default is ``"+a-45+nt1+m0"``]. + $projection zscale/zsize Set z-axis scaling or z-axis size. region : str or list @@ -232,7 +233,6 @@ def grdview( # noqa: PLR0913 Specify the :doc:`region ` of interest. When used with ``perspective``, optionally append */zmin/zmax* to indicate the range to use for the 3-D axes [Default is the region given by the input grid]. - $projection $frame $verbose $panel diff --git a/pygmt/src/plot3d.py b/pygmt/src/plot3d.py index 70b55d427d0..58fb7bfdd6c 100644 --- a/pygmt/src/plot3d.py +++ b/pygmt/src/plot3d.py @@ -54,14 +54,14 @@ def plot3d( # noqa: PLR0912, PLR0913 projection: str | None = None, zscale: float | str | None = None, zsize: float | str | None = None, - frame: str | Sequence[str] | bool = False, 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, - transparency: float | Sequence[float] | bool | None = None, - perspective: float | Sequence[float] | str | bool = False, incols: int | str | Sequence[int | str] | None = None, + perspective: float | Sequence[float] | str | bool = False, + transparency: float | Sequence[float] | bool | None = None, **kwargs, ): r""" @@ -119,8 +119,6 @@ def plot3d( # noqa: PLR0912, PLR0913 should be a list of two 1-D arrays with the vector directions. These can be angle and length, azimuth and length, or x and y components, depending on the style options chosen. - zscale/zsize - Set z-axis scaling or z-axis size. straight_line By default, line segments are drawn as straight lines in the Cartesian and polar coordinate systems, and as great circle arcs (by resampling coarse input data @@ -197,6 +195,8 @@ def plot3d( # noqa: PLR0912, PLR0913 ``fill="+z"``. To apply it to the pen color, append **+z** to ``pen``. $projection + zscale/zsize + Set z-axis scaling or z-axis size. $region $frame $verbose From eff11690077fdcdc9dcd22d0b27c37d0c4c6656d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 12 Feb 2026 14:55:31 +0000 Subject: [PATCH 06/11] Update parameter ordering in all function definitions to match specification Co-authored-by: seisman <3974108+seisman@users.noreply.github.com> --- pygmt/src/binstats.py | 2 +- pygmt/src/blockm.py | 2 +- pygmt/src/coast.py | 4 ++-- pygmt/src/contour.py | 6 +++--- pygmt/src/grd2xyz.py | 2 +- pygmt/src/grdcontour.py | 4 ++-- pygmt/src/grdfilter.py | 2 +- pygmt/src/grdimage.py | 4 ++-- pygmt/src/grdlandmask.py | 2 +- pygmt/src/grdsample.py | 2 +- pygmt/src/grdtrack.py | 6 +++--- pygmt/src/histogram.py | 6 +++--- pygmt/src/info.py | 2 +- pygmt/src/nearneighbor.py | 6 +++--- pygmt/src/plot.py | 6 +++--- pygmt/src/rose.py | 6 +++--- pygmt/src/scalebar.py | 2 +- pygmt/src/solar.py | 4 ++-- pygmt/src/sph2grd.py | 2 +- pygmt/src/ternary.py | 4 ++-- pygmt/src/text.py | 4 ++-- pygmt/src/tilemap.py | 2 +- pygmt/src/triangulate.py | 4 ++-- pygmt/src/velo.py | 6 +++--- pygmt/src/wiggle.py | 4 ++-- pygmt/src/xyz2grd.py | 4 ++-- 26 files changed, 49 insertions(+), 49 deletions(-) diff --git a/pygmt/src/binstats.py b/pygmt/src/binstats.py index ad3d03d639b..96c0b6a3745 100644 --- a/pygmt/src/binstats.py +++ b/pygmt/src/binstats.py @@ -47,10 +47,10 @@ def binstats( ] = "number", quantile_value: float = 50, region: Sequence[float | str] | str | None = None, + incols: int | str | Sequence[int | str] | None = None, registration: Literal["gridline", "pixel"] | bool = False, verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"] | bool = False, - incols: int | str | Sequence[int | str] | None = None, **kwargs, ) -> xr.DataArray | None: r""" diff --git a/pygmt/src/blockm.py b/pygmt/src/blockm.py index e4c5cadbba7..e5178d72334 100644 --- a/pygmt/src/blockm.py +++ b/pygmt/src/blockm.py @@ -144,9 +144,9 @@ def blockmean( # noqa: PLR0913 $binary $nodata $find - $incols $coltypes $header + $incols $outcols $registration $wrap diff --git a/pygmt/src/coast.py b/pygmt/src/coast.py index 200f1fb0524..31b7d3d7eec 100644 --- a/pygmt/src/coast.py +++ b/pygmt/src/coast.py @@ -29,13 +29,13 @@ def coast( # noqa: PLR0913 map_scale: str | None = None, box: Box | bool = False, projection: str | None = None, - frame: str | Sequence[str] | bool = False, 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, - transparency: float | None = None, perspective: float | Sequence[float] | str | bool = False, + transparency: float | None = None, **kwargs, ): r""" diff --git a/pygmt/src/contour.py b/pygmt/src/contour.py index aa19b3c3584..5ffe769a49d 100644 --- a/pygmt/src/contour.py +++ b/pygmt/src/contour.py @@ -39,14 +39,14 @@ def contour( # noqa: PLR0913 z=None, no_clip: bool = False, projection: str | None = None, - frame: str | Sequence[str] | bool = False, 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, - transparency: float | None = None, - perspective: float | Sequence[float] | str | bool = False, incols: int | str | Sequence[int | str] | None = None, + perspective: float | Sequence[float] | str | bool = False, + transparency: float | None = None, **kwargs, ): r""" diff --git a/pygmt/src/grd2xyz.py b/pygmt/src/grd2xyz.py index 84a87cefeb4..cc67aaf6394 100644 --- a/pygmt/src/grd2xyz.py +++ b/pygmt/src/grd2xyz.py @@ -115,9 +115,9 @@ def grd2xyz( will be output. $verbose $binary + $nodata $coltypes $header - $nodata $outcols $skiprows diff --git a/pygmt/src/grdcontour.py b/pygmt/src/grdcontour.py index fada25fddc4..dcf1d11f68e 100644 --- a/pygmt/src/grdcontour.py +++ b/pygmt/src/grdcontour.py @@ -39,13 +39,13 @@ def grdcontour( self, grid: PathLike | xr.DataArray, projection: str | None = None, - frame: str | Sequence[str] | bool = False, 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, - transparency: float | None = None, perspective: float | Sequence[float] | str | bool = False, + transparency: float | None = None, **kwargs, ): r""" diff --git a/pygmt/src/grdfilter.py b/pygmt/src/grdfilter.py index 667df2d134b..2e31869c767 100644 --- a/pygmt/src/grdfilter.py +++ b/pygmt/src/grdfilter.py @@ -110,8 +110,8 @@ def grdfilter( $region $verbose $coltypes - $cores $registration + $cores Returns ------- diff --git a/pygmt/src/grdimage.py b/pygmt/src/grdimage.py index 3348b63ff46..8fce5bff0ec 100644 --- a/pygmt/src/grdimage.py +++ b/pygmt/src/grdimage.py @@ -31,13 +31,13 @@ def grdimage( # noqa: PLR0913 monochrome: bool = False, no_clip: bool = False, projection: str | None = None, - frame: str | Sequence[str] | bool = False, 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, - transparency: float | None = None, perspective: float | Sequence[float] | str | bool = False, + transparency: float | None = None, cores: int | bool = False, **kwargs, ): diff --git a/pygmt/src/grdlandmask.py b/pygmt/src/grdlandmask.py index f8c7edbe8f9..4dd464d6cef 100644 --- a/pygmt/src/grdlandmask.py +++ b/pygmt/src/grdlandmask.py @@ -99,8 +99,8 @@ def grdlandmask( $region $verbose $area_thresh - $cores $registration + $cores Returns ------- diff --git a/pygmt/src/grdsample.py b/pygmt/src/grdsample.py index be48756dd65..1c6b348df53 100644 --- a/pygmt/src/grdsample.py +++ b/pygmt/src/grdsample.py @@ -75,9 +75,9 @@ def grdsample( $region $verbose $coltypes - $cores $interpolation $registration + $cores Returns ------- diff --git a/pygmt/src/grdtrack.py b/pygmt/src/grdtrack.py index afd8aaf4127..3a1b0b23d74 100644 --- a/pygmt/src/grdtrack.py +++ b/pygmt/src/grdtrack.py @@ -260,17 +260,17 @@ def grdtrack( $region $aspatial $binary - $coltypes + $nodata $find + $coltypes $gap $header $incols $distcalc $interpolation - $nodata $outcols - $skiprows $wrap + $skiprows Returns ------- diff --git a/pygmt/src/histogram.py b/pygmt/src/histogram.py index 52231ad9c12..f122f36e189 100644 --- a/pygmt/src/histogram.py +++ b/pygmt/src/histogram.py @@ -48,14 +48,14 @@ def histogram( # noqa: PLR0913 projection: str | None = None, bar_width: float | str | None = None, bar_offset: float | str | None = None, - frame: str | Sequence[str] | bool = False, 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, - transparency: float | None = None, - perspective: float | Sequence[float] | str | bool = False, incols: int | str | Sequence[int | str] | None = None, + perspective: float | Sequence[float] | str | bool = False, + transparency: float | None = None, **kwargs, ): r""" diff --git a/pygmt/src/info.py b/pygmt/src/info.py index 254613ef8fd..57a7bfc09ad 100644 --- a/pygmt/src/info.py +++ b/pygmt/src/info.py @@ -18,10 +18,10 @@ def info( data: PathLike | TableLike, spacing: Sequence[float] | str | None = None, per_column: bool = False, + incols: int | str | Sequence[int | str] | None = None, registration: Literal["gridline", "pixel"] | bool = False, verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"] | bool = False, - incols: int | str | Sequence[int | str] | None = None, **kwargs, ) -> np.ndarray | str: r""" diff --git a/pygmt/src/nearneighbor.py b/pygmt/src/nearneighbor.py index 5047da2b8db..81244933512 100644 --- a/pygmt/src/nearneighbor.py +++ b/pygmt/src/nearneighbor.py @@ -36,10 +36,10 @@ def nearneighbor( outgrid: PathLike | None = None, spacing: Sequence[float | str] | None = None, region: Sequence[float | str] | str | None = None, + incols: int | str | Sequence[int | str] | None = None, registration: Literal["gridline", "pixel"] | bool = False, verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"] | bool = False, - incols: int | str | Sequence[int | str] | None = None, **kwargs, ) -> xr.DataArray | None: r""" @@ -125,12 +125,12 @@ def nearneighbor( $verbose $aspatial $binary - $coltypes + $nodata $find + $coltypes $gap $header $incols - $nodata $wrap Returns diff --git a/pygmt/src/plot.py b/pygmt/src/plot.py index cd1964ada2b..8f8873bde62 100644 --- a/pygmt/src/plot.py +++ b/pygmt/src/plot.py @@ -52,14 +52,14 @@ def plot( # noqa: PLR0912, PLR0913 direction=None, straight_line: bool | Literal["x", "y"] = False, projection: str | None = None, - frame: str | Sequence[str] | bool = False, 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, - transparency: float | Sequence[float] | bool | None = None, - perspective: float | Sequence[float] | str | bool = False, incols: int | str | Sequence[int | str] | None = None, + perspective: float | Sequence[float] | str | bool = False, + transparency: float | Sequence[float] | bool | None = None, **kwargs, ): r""" diff --git a/pygmt/src/rose.py b/pygmt/src/rose.py index 14edc5183a0..ef819c0685a 100644 --- a/pygmt/src/rose.py +++ b/pygmt/src/rose.py @@ -39,14 +39,14 @@ def rose( # noqa: PLR0913 data: PathLike | TableLike | None = None, length=None, azimuth=None, - frame: str | Sequence[str] | bool = False, 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, - transparency: float | None = None, - perspective: float | Sequence[float] | str | bool = False, incols: int | str | Sequence[int | str] | None = None, + perspective: float | Sequence[float] | str | bool = False, + transparency: float | None = None, **kwargs, ): """ diff --git a/pygmt/src/scalebar.py b/pygmt/src/scalebar.py index 918d10bbcd5..7558a8050e8 100644 --- a/pygmt/src/scalebar.py +++ b/pygmt/src/scalebar.py @@ -22,7 +22,6 @@ def scalebar( # noqa: PLR0913 height: float | str | None = None, position: Position | Sequence[float | str] | AnchorCode | None = None, scale_loc: float | Sequence[float] | bool = False, - label: str | bool = False, label_alignment: Literal["left", "right", "top", "bottom"] | None = None, unit: bool = False, fancy: bool = False, @@ -31,6 +30,7 @@ def scalebar( # noqa: PLR0913 verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"] | bool = False, panel: int | Sequence[int] | bool = False, + label: str | bool = False, perspective: float | Sequence[float] | str | bool = False, transparency: float | None = None, ): diff --git a/pygmt/src/solar.py b/pygmt/src/solar.py index 7669153e66f..2f9227e6405 100644 --- a/pygmt/src/solar.py +++ b/pygmt/src/solar.py @@ -22,13 +22,13 @@ def solar( # noqa: PLR0913 fill: str | None = None, pen: str | None = None, projection: str | None = None, - frame: str | Sequence[str] | bool = False, 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, - transparency: float | None = None, perspective: float | Sequence[float] | str | bool = False, + transparency: float | None = None, **kwargs, ): r""" diff --git a/pygmt/src/sph2grd.py b/pygmt/src/sph2grd.py index da287c8023b..d5f9028d201 100644 --- a/pygmt/src/sph2grd.py +++ b/pygmt/src/sph2grd.py @@ -21,10 +21,10 @@ def sph2grd( outgrid: PathLike | None = None, spacing: Sequence[float | str] | None = None, region: Sequence[float | str] | str | None = None, - registration: Literal["gridline", "pixel"] | bool = False, verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"] | bool = False, incols: int | str | Sequence[int | str] | None = None, + registration: Literal["gridline", "pixel"] | bool = False, cores: int | bool = False, **kwargs, ) -> xr.DataArray | None: diff --git a/pygmt/src/ternary.py b/pygmt/src/ternary.py index 9f2adc41051..127ae54d3a3 100644 --- a/pygmt/src/ternary.py +++ b/pygmt/src/ternary.py @@ -19,13 +19,13 @@ def ternary( # noqa: PLR0913 alabel: str | None = None, blabel: str | None = None, clabel: str | None = None, - frame: str | Sequence[str] | bool = False, 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, - transparency: float | None = None, perspective: float | Sequence[float] | str | bool = False, + transparency: float | None = None, **kwargs, ): r""" diff --git a/pygmt/src/text.py b/pygmt/src/text.py index 5f1f1bbef94..2007c4cace8 100644 --- a/pygmt/src/text.py +++ b/pygmt/src/text.py @@ -46,13 +46,13 @@ def text_( # noqa: PLR0912, PLR0913 justify: bool | None | AnchorCode | Sequence[AnchorCode] = None, no_clip: bool = False, projection: str | None = None, - frame: str | Sequence[str] | bool = False, 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, - transparency: float | Sequence[float] | bool | None = None, perspective: float | Sequence[float] | str | bool = False, + transparency: float | Sequence[float] | bool | None = None, **kwargs, ): r""" diff --git a/pygmt/src/tilemap.py b/pygmt/src/tilemap.py index deef5ca3188..66f7a7216bb 100644 --- a/pygmt/src/tilemap.py +++ b/pygmt/src/tilemap.py @@ -35,8 +35,8 @@ def tilemap( # noqa: PLR0913 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""" diff --git a/pygmt/src/triangulate.py b/pygmt/src/triangulate.py index bf0112f63cd..ee2760f715d 100644 --- a/pygmt/src/triangulate.py +++ b/pygmt/src/triangulate.py @@ -68,12 +68,12 @@ def regular_grid( # noqa: PLR0913 spacing: Sequence[float | str] | None = None, projection: str | None = None, region: Sequence[float | str] | str | None = None, + incols: int | str | Sequence[int | str] | None = None, registration: Literal["gridline", "pixel"] | bool = False, verbose: Literal[ "quiet", "error", "warning", "timing", "info", "compat", "debug" ] | bool = False, - incols: int | str | Sequence[int | str] | None = None, **kwargs, ) -> xr.DataArray | None: """ @@ -197,12 +197,12 @@ def delaunay_triples( # noqa: PLR0913 spacing: Sequence[float | str] | None = None, projection: str | None = None, region: Sequence[float | str] | str | None = None, + incols: int | str | Sequence[int | str] | None = None, registration: Literal["gridline", "pixel"] | bool = False, verbose: Literal[ "quiet", "error", "warning", "timing", "info", "compat", "debug" ] | bool = False, - incols: int | str | Sequence[int | str] | None = None, **kwargs, ) -> pd.DataFrame | np.ndarray | None: """ diff --git a/pygmt/src/velo.py b/pygmt/src/velo.py index 04fdbb03fcd..346d7e1295e 100644 --- a/pygmt/src/velo.py +++ b/pygmt/src/velo.py @@ -40,14 +40,14 @@ def velo( # noqa : PLR0913 data: PathLike | TableLike | None = None, no_clip: bool = False, projection: str | None = None, - frame: str | Sequence[str] | bool = False, 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, - transparency: float | None = None, - perspective: float | Sequence[float] | str | bool = False, incols: int | str | Sequence[int | str] | None = None, + perspective: float | Sequence[float] | str | bool = False, + transparency: float | None = None, **kwargs, ): r""" diff --git a/pygmt/src/wiggle.py b/pygmt/src/wiggle.py index 2f3989bc494..603d5339f73 100644 --- a/pygmt/src/wiggle.py +++ b/pygmt/src/wiggle.py @@ -42,7 +42,6 @@ def wiggle( # noqa: PLR0913 z=None, position: Position | Sequence[float | str] | AnchorCode | None = None, length: float | str | None = None, - label: str | None = None, label_alignment: Literal["left", "right"] | None = None, positive_fill: str | None = None, negative_fill: str | None = None, @@ -52,9 +51,10 @@ def wiggle( # noqa: PLR0913 verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"] | bool = False, panel: int | Sequence[int] | bool = False, + incols: int | str | Sequence[int | str] | None = None, + label: str | None = None, perspective: float | Sequence[float] | str | bool = False, transparency: float | None = None, - incols: int | str | Sequence[int | str] | None = None, **kwargs, ): r""" diff --git a/pygmt/src/xyz2grd.py b/pygmt/src/xyz2grd.py index e21c9fc59cb..72d13974026 100644 --- a/pygmt/src/xyz2grd.py +++ b/pygmt/src/xyz2grd.py @@ -129,11 +129,11 @@ def xyz2grd( $region $verbose $binary - $coltypes + $nodata $find + $coltypes $header $incols - $nodata $wrap Returns From 765e47c203929ab01c1912dcd150569e3dbf2e51 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 12 Feb 2026 15:07:44 +0000 Subject: [PATCH 07/11] Address review comments: move projection/region/frame to start in basemap, fix registration ordering in binstats Co-authored-by: seisman <3974108+seisman@users.noreply.github.com> --- pygmt/src/basemap.py | 14 +++++++------- pygmt/src/binstats.py | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/pygmt/src/basemap.py b/pygmt/src/basemap.py index e7ab7012560..b795ccfce06 100644 --- a/pygmt/src/basemap.py +++ b/pygmt/src/basemap.py @@ -69,6 +69,13 @@ def basemap( # noqa: PLR0913 Parameters ---------- + $projection + $region + *Required if this is the first plot command.* + $frame + zscale + zsize + Set z-axis scaling or z-axis size. map_scale Draw a map scale bar on the plot. @@ -102,13 +109,6 @@ def basemap( # noqa: PLR0913 :meth:`pygmt.Figure.directional_rose`, or :meth:`pygmt.Figure.magnetic_rose` instead. This parameter is maintained for backward compatibility and accepts raw GMT CLI strings for the ``-F`` option. - $projection - zscale - zsize - Set z-axis scaling or z-axis size. - $region - *Required if this is the first plot command.* - $frame $verbose $panel $coltypes diff --git a/pygmt/src/binstats.py b/pygmt/src/binstats.py index 96c0b6a3745..56ef3a30fca 100644 --- a/pygmt/src/binstats.py +++ b/pygmt/src/binstats.py @@ -47,10 +47,10 @@ def binstats( ] = "number", quantile_value: float = 50, region: Sequence[float | str] | str | None = None, - incols: int | str | Sequence[int | str] | None = None, - registration: Literal["gridline", "pixel"] | bool = False, verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"] | bool = False, + incols: int | str | Sequence[int | str] | None = None, + registration: Literal["gridline", "pixel"] | bool = False, **kwargs, ) -> xr.DataArray | None: r""" From d1629414ac9d7795a9ac1024bb3cf02e1c321f17 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 12 Feb 2026 15:15:21 +0000 Subject: [PATCH 08/11] Fix parameter ordering in grdtrack.py: skiprows should come before wrap Co-authored-by: seisman <3974108+seisman@users.noreply.github.com> --- pygmt/src/grdtrack.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pygmt/src/grdtrack.py b/pygmt/src/grdtrack.py index 3a1b0b23d74..1606f37a268 100644 --- a/pygmt/src/grdtrack.py +++ b/pygmt/src/grdtrack.py @@ -269,8 +269,8 @@ def grdtrack( $distcalc $interpolation $outcols - $wrap $skiprows + $wrap Returns ------- From 4fe4653f48030c7b092d9053ad0465c963a43673 Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Thu, 12 Feb 2026 23:35:26 +0800 Subject: [PATCH 09/11] Fix grdcontour.py --- pygmt/src/grdcontour.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pygmt/src/grdcontour.py b/pygmt/src/grdcontour.py index dcf1d11f68e..0e06f31be81 100644 --- a/pygmt/src/grdcontour.py +++ b/pygmt/src/grdcontour.py @@ -94,16 +94,12 @@ def grdcontour( Do not draw contours with less than `cut` number of points. resample : str or int Resample smoothing factor. - $projection - $region - $frame label_placement : str [**d**\|\ **f**\|\ **n**\|\ **l**\|\ **L**\|\ **x**\|\ **X**]\ *args*. Control the placement of labels along the quoted lines. It supports five controlling algorithms. See :gmt-docs:`grdcontour.html#g` for details. - $verbose pen : str or list [*type*]\ *pen*\ [**+c**\ [**l**\|\ **f**]]. *type*, if present, can be **a** for annotated contours or **c** for regular @@ -114,8 +110,6 @@ def grdcontour( contour lines are taken from the CPT (see ``levels``). If **+cf** is appended the colors from the CPT file are applied to the contour annotations. Select **+c** for both effects. - $panel - $coltypes label : str Add a legend entry for the contour being plotted. Normally, the annotated contour is selected for the legend. You can select the @@ -123,6 +117,12 @@ def grdcontour( to be of the format [*annotcontlabel*][/*contlabel*]. If either label contains a slash (/) character then use ``|`` as the separator for the two labels instead. + $projection + $region + $frame + $verbose + $panel + $coltypes $perspective $transparency From 56ec34d8ca3c2e7255df780014a4b427523279dc Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Thu, 12 Feb 2026 23:48:39 +0800 Subject: [PATCH 10/11] Manual fixes --- pygmt/src/blockm.py | 6 +++--- pygmt/src/contour.py | 6 +++--- pygmt/src/grdlandmask.py | 2 +- pygmt/src/histogram.py | 2 +- pygmt/src/info.py | 5 +---- pygmt/src/nearneighbor.py | 8 +++----- pygmt/src/plot3d.py | 3 ++- pygmt/src/scalebar.py | 2 +- pygmt/src/solar.py | 6 +++--- pygmt/src/sph2grd.py | 2 +- pygmt/src/surface.py | 7 ++----- pygmt/src/text.py | 6 +++--- pygmt/src/triangulate.py | 16 ++++++++-------- pygmt/src/xyz2grd.py | 4 ++-- 14 files changed, 34 insertions(+), 41 deletions(-) diff --git a/pygmt/src/blockm.py b/pygmt/src/blockm.py index e5178d72334..b4413286286 100644 --- a/pygmt/src/blockm.py +++ b/pygmt/src/blockm.py @@ -90,11 +90,11 @@ def blockmean( # noqa: PLR0913 outfile: PathLike | None = None, spacing: Sequence[float | str] | None = None, region: Sequence[float | str] | str | None = None, - registration: Literal["gridline", "pixel"] | bool = False, verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"] | bool = False, incols: int | str | Sequence[int | str] | None = None, outcols: int | str | Sequence[int | str] | None = None, + registration: Literal["gridline", "pixel"] | bool = False, **kwargs, ) -> pd.DataFrame | np.ndarray | None: r""" @@ -205,11 +205,11 @@ def blockmedian( # noqa: PLR0913 outfile: PathLike | None = None, spacing: Sequence[float | str] | None = None, region: Sequence[float | str] | str | None = None, - registration: Literal["gridline", "pixel"] | bool = False, verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"] | bool = False, incols: int | str | Sequence[int | str] | None = None, outcols: int | str | Sequence[int | str] | None = None, + registration: Literal["gridline", "pixel"] | bool = False, **kwargs, ) -> pd.DataFrame | np.ndarray | None: r""" @@ -320,11 +320,11 @@ def blockmode( # noqa: PLR0913 outfile: PathLike | None = None, spacing: Sequence[float | str] | None = None, region: Sequence[float | str] | str | None = None, - registration: Literal["gridline", "pixel"] | bool = False, verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"] | bool = False, incols: int | str | Sequence[int | str] | None = None, outcols: int | str | Sequence[int | str] | None = None, + registration: Literal["gridline", "pixel"] | bool = False, **kwargs, ) -> pd.DataFrame | np.ndarray | None: r""" diff --git a/pygmt/src/contour.py b/pygmt/src/contour.py index 5ffe769a49d..ae36b4d8c22 100644 --- a/pygmt/src/contour.py +++ b/pygmt/src/contour.py @@ -78,8 +78,6 @@ def contour( # noqa: PLR0913 $table_classes. x/y/z : 1-D arrays Arrays of x and y coordinates and values z of the data points. - $projection - $region annotation : float, list, or str Specify or disable annotated contour levels, modifies annotated contours specified in ``levels``. @@ -90,7 +88,6 @@ def contour( # noqa: PLR0913 - Adjust the appearance by appending different modifiers, e.g., ``"annot_int+f10p+gred"`` gives annotations with a font size of 10 points and a red filled box. For all available modifiers see :gmt-docs:`contour.html#a`. - $frame levels : float, list, or str Specify the contour lines to generate. @@ -139,6 +136,9 @@ def contour( # noqa: PLR0913 to be of the format [*annotcontlabel*][/*contlabel*]. If either label contains a slash (/) character then use ``|`` as the separator for the two labels instead. + $projection + $region + $frame $verbose $binary $panel diff --git a/pygmt/src/grdlandmask.py b/pygmt/src/grdlandmask.py index 4dd464d6cef..0c2dbb21b3e 100644 --- a/pygmt/src/grdlandmask.py +++ b/pygmt/src/grdlandmask.py @@ -64,6 +64,7 @@ def grdlandmask( ---------- $outgrid $spacing + $area_thresh resolution Select the resolution of the coastline dataset to use. The available resolutions from highest to lowest are: ``"full"``, ``"high"``, ``"intermediate"``, @@ -98,7 +99,6 @@ def grdlandmask( setting nodes to NaN. $region $verbose - $area_thresh $registration $cores diff --git a/pygmt/src/histogram.py b/pygmt/src/histogram.py index f122f36e189..c2e55ed7218 100644 --- a/pygmt/src/histogram.py +++ b/pygmt/src/histogram.py @@ -45,9 +45,9 @@ def histogram( # noqa: PLR0913 self, data: PathLike | TableLike, - projection: str | None = None, bar_width: float | str | None = None, bar_offset: float | str | None = None, + 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"] diff --git a/pygmt/src/info.py b/pygmt/src/info.py index 57a7bfc09ad..210419551b5 100644 --- a/pygmt/src/info.py +++ b/pygmt/src/info.py @@ -68,14 +68,11 @@ def info( **dz**\[\ **+c**\ *col*]. Report the min/max of the first (0'th) column to the nearest multiple of dz and output this in the form ``[zmin, zmax, dz]``. - registration - [**g**\|\ **p**]. - Select gridline or pixel node registration [Default is gridline]. - $verbose $aspatial $coltypes $incols + $registration Returns ------- diff --git a/pygmt/src/nearneighbor.py b/pygmt/src/nearneighbor.py index 81244933512..62b03b9f826 100644 --- a/pygmt/src/nearneighbor.py +++ b/pygmt/src/nearneighbor.py @@ -36,10 +36,10 @@ def nearneighbor( outgrid: PathLike | None = None, spacing: Sequence[float | str] | None = None, region: Sequence[float | str] | str | None = None, - incols: int | str | Sequence[int | str] | None = None, - registration: Literal["gridline", "pixel"] | bool = False, verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"] | bool = False, + incols: int | str | Sequence[int | str] | None = None, + registration: Literal["gridline", "pixel"] | bool = False, **kwargs, ) -> xr.DataArray | None: r""" @@ -118,10 +118,7 @@ def nearneighbor( Alternatively, use ``sectors="n"`` to call GDAL's nearest neighbor algorithm instead. - $registration - $region - $verbose $aspatial $binary @@ -131,6 +128,7 @@ def nearneighbor( $gap $header $incols + $registration $wrap Returns diff --git a/pygmt/src/plot3d.py b/pygmt/src/plot3d.py index 58fb7bfdd6c..c6aa0e93d67 100644 --- a/pygmt/src/plot3d.py +++ b/pygmt/src/plot3d.py @@ -195,7 +195,8 @@ def plot3d( # noqa: PLR0912, PLR0913 ``fill="+z"``. To apply it to the pen color, append **+z** to ``pen``. $projection - zscale/zsize + zscale + zsize Set z-axis scaling or z-axis size. $region $frame diff --git a/pygmt/src/scalebar.py b/pygmt/src/scalebar.py index 7558a8050e8..918d10bbcd5 100644 --- a/pygmt/src/scalebar.py +++ b/pygmt/src/scalebar.py @@ -22,6 +22,7 @@ def scalebar( # noqa: PLR0913 height: float | str | None = None, position: Position | Sequence[float | str] | AnchorCode | None = None, scale_loc: float | Sequence[float] | bool = False, + label: str | bool = False, label_alignment: Literal["left", "right", "top", "bottom"] | None = None, unit: bool = False, fancy: bool = False, @@ -30,7 +31,6 @@ def scalebar( # noqa: PLR0913 verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"] | bool = False, panel: int | Sequence[int] | bool = False, - label: str | bool = False, perspective: float | Sequence[float] | str | bool = False, transparency: float | None = None, ): diff --git a/pygmt/src/solar.py b/pygmt/src/solar.py index 2f9227e6405..4a4ab0dc688 100644 --- a/pygmt/src/solar.py +++ b/pygmt/src/solar.py @@ -74,13 +74,13 @@ def solar( # noqa: PLR0913 integer number of hours (e.g., -8 or +5); fractional hours are truncated towards zero (e.g., -8.5 becomes -8 and +5.5 becomes +5). [Default is the current UTC date and time]. - $region - $projection - $frame fill Set color or pattern for filling terminators [Default is no fill]. pen Set pen attributes for lines [Default is ``"0.25p,black,solid"``]. + $projection + $region + $frame $verbose $panel $perspective diff --git a/pygmt/src/sph2grd.py b/pygmt/src/sph2grd.py index d5f9028d201..1c32d422a61 100644 --- a/pygmt/src/sph2grd.py +++ b/pygmt/src/sph2grd.py @@ -54,13 +54,13 @@ def sph2grd( $table_classes. $outgrid $spacing - $cores $region $verbose $binary $header $incols $registration + $cores Returns ------- diff --git a/pygmt/src/surface.py b/pygmt/src/surface.py index 995b683bfc8..0fc0daaa71b 100644 --- a/pygmt/src/surface.py +++ b/pygmt/src/surface.py @@ -40,9 +40,9 @@ def surface( outgrid: PathLike | None = None, spacing: Sequence[float | str] | None = None, region: Sequence[float | str] | str | None = None, - registration: Literal["gridline", "pixel"] | bool = False, verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"] | bool = False, + registration: Literal["gridline", "pixel"] | bool = False, **kwargs, ) -> xr.DataArray | None: r""" @@ -92,10 +92,7 @@ def surface( $table_classes. x/y/z : 1-D arrays Arrays of x and y coordinates and values z of the data points. - $spacing - - $region $outgrid convergence : float Optional. Convergence limit. Iteration is assumed to have converged @@ -141,7 +138,7 @@ def surface( set boundary tension. If you do not prepend **i** or **b**, both will be set to the same value. [Default is 0 for both and gives minimum curvature solution.] - + $region $verbose $aspatial $binary diff --git a/pygmt/src/text.py b/pygmt/src/text.py index 2007c4cace8..a82afb4e3c0 100644 --- a/pygmt/src/text.py +++ b/pygmt/src/text.py @@ -133,9 +133,6 @@ def text_( # noqa: PLR0912, PLR0913 e.g., **BL** for Bottom Left. If no justification is explicitly given (i.e. ``justify=True``), then the input to ``textfiles`` must have this as a column. - $projection - $region - *Required if this is the first plot command.* clearance : str [*dx/dy*][**+to**\|\ **O**\|\ **c**\|\ **C**]. Adjust the clearance between the text and the surrounding box @@ -167,6 +164,9 @@ def text_( # noqa: PLR0912, PLR0913 (see ``clearance``) [Default is ``"0.25p,black,solid"``]. no_clip Do **not** clip text at the frame boundaries [Default is ``False``]. + $projection + $region + *Required if this is the first plot command.* $verbose $aspatial $panel diff --git a/pygmt/src/triangulate.py b/pygmt/src/triangulate.py index ee2760f715d..e41010adf5e 100644 --- a/pygmt/src/triangulate.py +++ b/pygmt/src/triangulate.py @@ -68,12 +68,12 @@ def regular_grid( # noqa: PLR0913 spacing: Sequence[float | str] | None = None, projection: str | None = None, region: Sequence[float | str] | str | None = None, - incols: int | str | Sequence[int | str] | None = None, - registration: Literal["gridline", "pixel"] | bool = False, verbose: Literal[ "quiet", "error", "warning", "timing", "info", "compat", "debug" ] | bool = False, + incols: int | str | Sequence[int | str] | None = None, + registration: Literal["gridline", "pixel"] | bool = False, **kwargs, ) -> xr.DataArray | None: """ @@ -116,8 +116,6 @@ def regular_grid( # noqa: PLR0913 Pass in (x, y[, z]) or (longitude, latitude[, elevation]) values by providing a file name to an ASCII data table, a 2-D $table_classes. - $projection - $region $spacing $outgrid The interpolation is performed in the original coordinates, so if @@ -125,6 +123,8 @@ def regular_grid( # noqa: PLR0913 all data to a local coordinate system before using ``triangulate`` (this is true of all gridding routines) or instead select :gmt-docs:`sphtriangulate `. + $projection + $region $verbose $binary $nodata @@ -197,12 +197,12 @@ def delaunay_triples( # noqa: PLR0913 spacing: Sequence[float | str] | None = None, projection: str | None = None, region: Sequence[float | str] | str | None = None, - incols: int | str | Sequence[int | str] | None = None, - registration: Literal["gridline", "pixel"] | bool = False, verbose: Literal[ "quiet", "error", "warning", "timing", "info", "compat", "debug" ] | bool = False, + incols: int | str | Sequence[int | str] | None = None, + registration: Literal["gridline", "pixel"] | bool = False, **kwargs, ) -> pd.DataFrame | np.ndarray | None: """ @@ -237,10 +237,10 @@ def delaunay_triples( # noqa: PLR0913 Pass in (x, y, z) or (longitude, latitude, elevation) values by providing a file name to an ASCII data table, a 2-D $table_classes. - $projection - $region $output_type $outfile + $projection + $region $verbose $binary $nodata diff --git a/pygmt/src/xyz2grd.py b/pygmt/src/xyz2grd.py index 72d13974026..fbd0b727ba6 100644 --- a/pygmt/src/xyz2grd.py +++ b/pygmt/src/xyz2grd.py @@ -36,9 +36,9 @@ def xyz2grd( spacing: Sequence[float | str] | None = None, projection: str | None = None, region: Sequence[float | str] | str | None = None, - registration: Literal["gridline", "pixel"] | bool = False, verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"] | bool = False, + registration: Literal["gridline", "pixel"] | bool = False, **kwargs, ) -> xr.DataArray | None: r""" @@ -124,7 +124,6 @@ def xyz2grd( each input record to have a single value, while the former can handle multiple values per record but can only parse regular floating point values. Translate incoming *z*-values via the ``incols`` parameter. - $registration $projection $region $verbose @@ -134,6 +133,7 @@ def xyz2grd( $coltypes $header $incols + $registration $wrap Returns From 6b1cfad6b31e297e89a043a212cf6dba0676cf58 Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Thu, 12 Feb 2026 23:57:49 +0800 Subject: [PATCH 11/11] Manually fix some files --- pygmt/src/filter1d.py | 1 + pygmt/src/grd2cpt.py | 1 + pygmt/src/grdclip.py | 2 +- pygmt/src/grdcut.py | 5 ++--- pygmt/src/grdfill.py | 2 +- pygmt/src/grdinfo.py | 2 +- pygmt/src/grdview.py | 3 ++- pygmt/src/makecpt.py | 2 +- pygmt/src/sphdistance.py | 4 ++-- pygmt/src/x2sys_cross.py | 6 ++---- 10 files changed, 14 insertions(+), 14 deletions(-) diff --git a/pygmt/src/filter1d.py b/pygmt/src/filter1d.py index 92aa8b49cdf..cefa075b29b 100644 --- a/pygmt/src/filter1d.py +++ b/pygmt/src/filter1d.py @@ -100,6 +100,7 @@ def filter1d( Indicate which column contains the independent variable (time). The left-most column is 0, while the right-most is (*n_cols* - 1) [Default is ``0``]. + $verbose Returns ------- diff --git a/pygmt/src/grd2cpt.py b/pygmt/src/grd2cpt.py index a09fb91c8f8..d175d24ea79 100644 --- a/pygmt/src/grd2cpt.py +++ b/pygmt/src/grd2cpt.py @@ -182,6 +182,7 @@ def grd2cpt( Produce a wrapped (cyclic) color table that endlessly repeats its range. Note that ``cyclic=True`` cannot be set together with ``categorical=True``. + $region $verbose Example diff --git a/pygmt/src/grdclip.py b/pygmt/src/grdclip.py index 16038a0c9e6..2dc422ea337 100644 --- a/pygmt/src/grdclip.py +++ b/pygmt/src/grdclip.py @@ -62,7 +62,6 @@ def grdclip( ---------- $grid $outgrid - $region above Pass a sequence of two values in the form of (*high*, *above*), to set all node values greater than *high* to *above*. @@ -80,6 +79,7 @@ def grdclip( (e.g., list of lists or 2-D numpy array) to replace different old values with different new values. This is mostly useful when your data are known to be integer values. + $region $verbose Returns diff --git a/pygmt/src/grdcut.py b/pygmt/src/grdcut.py index 5f300dde11d..a8ed5ea6eb0 100644 --- a/pygmt/src/grdcut.py +++ b/pygmt/src/grdcut.py @@ -61,8 +61,6 @@ def grdcut( or an image, so we need to specify the raster kind explicitly. The default is ``"grid"``. $outgrid - $projection - $region extend : bool or float Allow grid to be extended if new ``region`` exceeds existing boundaries. Give a value to initialize nodes outside current region. @@ -87,7 +85,8 @@ def grdcut( NaNs, append **+N** to strip off such columns before (optionally) considering the range of the core subset for further reduction of the area. - + $projection + $region $verbose $coltypes diff --git a/pygmt/src/grdfill.py b/pygmt/src/grdfill.py index adaa50c17ca..aa76838490f 100644 --- a/pygmt/src/grdfill.py +++ b/pygmt/src/grdfill.py @@ -131,8 +131,8 @@ def grdfill( is ignored. $region - $coltypes $verbose + $coltypes Returns ------- diff --git a/pygmt/src/grdinfo.py b/pygmt/src/grdinfo.py index 5f8a5db00fd..bb3f18dc577 100644 --- a/pygmt/src/grdinfo.py +++ b/pygmt/src/grdinfo.py @@ -51,7 +51,6 @@ def grdinfo( Parameters ---------- $grid - $region per_column : str or bool **n**\|\ **t**. Format the report using tab-separated fields on a single line. The @@ -114,6 +113,7 @@ def grdinfo( absolute value of the two extremes, append **+s**. We report the result via the text string *zmin/zmax* or *zmin/zmax/dz* (if *dz* was given) as expected by :func:`pygmt.makecpt`. + $region $verbose $coltypes diff --git a/pygmt/src/grdview.py b/pygmt/src/grdview.py index f9cf5a3a93a..3e37d1015f9 100644 --- a/pygmt/src/grdview.py +++ b/pygmt/src/grdview.py @@ -226,7 +226,8 @@ def grdview( # noqa: PLR0913 function, or just give **+d** to select the default arguments [Default is ``"+a-45+nt1+m0"``]. $projection - zscale/zsize + zscale + zsize Set z-axis scaling or z-axis size. region : str or list *xmin/xmax/ymin/ymax*\ [**+r**][**+u**\ *unit*]. diff --git a/pygmt/src/makecpt.py b/pygmt/src/makecpt.py index 3e331caffc7..f378421c686 100644 --- a/pygmt/src/makecpt.py +++ b/pygmt/src/makecpt.py @@ -157,7 +157,6 @@ def makecpt( continuous Force a continuous CPT when building from a list of colors and a list of z-values [Default is False, i.e. discrete CPT]. - $verbose categorical : bool Do not interpolate the input color table but pick the output colors starting at the beginning of the color table, until colors for all @@ -167,6 +166,7 @@ def makecpt( Produce a wrapped (cyclic) color table that endlessly repeats its range. Note that ``cyclic=True`` cannot be set together with ``categorical=True``. + $verbose """ if kwargs.get("W") is not None and kwargs.get("Ww") is not None: raise GMTParameterError(at_most_one=["categorical", "cyclic"]) diff --git a/pygmt/src/sphdistance.py b/pygmt/src/sphdistance.py index 5c8c0df5a4f..74d1e72ae89 100644 --- a/pygmt/src/sphdistance.py +++ b/pygmt/src/sphdistance.py @@ -62,8 +62,6 @@ def sphdistance( Arrays of x and y coordinates. $outgrid $spacing - $region - $verbose single_form : bool For large data sets you can save some memory (at the expense of more processing) by only storing one form of location coordinates @@ -99,6 +97,8 @@ def sphdistance( voronoi : str Append the name of a file with pre-calculated Voronoi polygons [Default performs the Voronoi construction on input data]. + $region + $verbose Returns ------- diff --git a/pygmt/src/x2sys_cross.py b/pygmt/src/x2sys_cross.py index 22d2c720640..c0ca51c38b0 100644 --- a/pygmt/src/x2sys_cross.py +++ b/pygmt/src/x2sys_cross.py @@ -162,8 +162,6 @@ def x2sys_cross( Use **e** for external COEs only, and **i** for internal COEs only [Default is all COEs]. - $region - speed : str or list **l**\|\ **u**\|\ **h**\ *speed*. Defines window of track speeds. If speeds are outside this window we do @@ -179,8 +177,6 @@ def x2sys_cross( speed of 0, upper speed of 10, and disable heading calculations for speeds below 5. - $verbose - numpoints : int Give the maximum number of data points on either side of the crossover to use in the spline interpolation [Default is 3]. @@ -188,6 +184,8 @@ def x2sys_cross( track_values : bool Report the values of each track at the crossover [Default reports the crossover value and the mean value]. + $region + $verbose Returns -------