From bb241359138bdb830c888941cb0015c5f67043a3 Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Sat, 15 Nov 2025 19:09:29 +0800 Subject: [PATCH 1/5] fmt_docstrings: Use string.Template for docstring placeholders --- pygmt/helpers/decorators.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pygmt/helpers/decorators.py b/pygmt/helpers/decorators.py index fb6ecdf7645..466ba532ca7 100644 --- a/pygmt/helpers/decorators.py +++ b/pygmt/helpers/decorators.py @@ -6,6 +6,7 @@ """ import functools +import string import textwrap import warnings from inspect import Parameter, signature @@ -467,8 +468,7 @@ def fmt_docstring(module_func): # Dedent the docstring to make it all match the option text. docstring = textwrap.dedent(module_func.__doc__) - module_func.__doc__ = docstring.format(**filler_text) - + module_func.__doc__ = string.Template(docstring).safe_substitute(**filler_text) return module_func From 92d14a71ca63cae2913895dd406adae803df398f Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Sat, 15 Nov 2025 19:15:42 +0800 Subject: [PATCH 2/5] Update docstring placeholders to the string.Template syntax --- pygmt/src/basemap.py | 16 +++---- pygmt/src/binstats.py | 18 ++++---- pygmt/src/blockm.py | 90 ++++++++++++++++++------------------- pygmt/src/coast.py | 16 +++---- pygmt/src/colorbar.py | 10 ++--- pygmt/src/contour.py | 26 +++++------ pygmt/src/dimfilter.py | 6 +-- pygmt/src/filter1d.py | 4 +- pygmt/src/grd2cpt.py | 4 +- pygmt/src/grd2xyz.py | 22 ++++----- pygmt/src/grdclip.py | 8 ++-- pygmt/src/grdcontour.py | 18 ++++---- pygmt/src/grdcut.py | 12 ++--- pygmt/src/grdfill.py | 10 ++--- pygmt/src/grdfilter.py | 16 +++---- pygmt/src/grdgradient.py | 12 ++--- pygmt/src/grdhisteq.py | 20 ++++----- pygmt/src/grdimage.py | 24 +++++----- pygmt/src/grdinfo.py | 8 ++-- pygmt/src/grdlandmask.py | 14 +++--- pygmt/src/grdproject.py | 16 +++---- pygmt/src/grdsample.py | 18 ++++---- pygmt/src/grdtrack.py | 36 +++++++-------- pygmt/src/grdview.py | 18 ++++---- pygmt/src/grdvolume.py | 10 ++--- pygmt/src/histogram.py | 32 ++++++------- pygmt/src/image.py | 12 ++--- pygmt/src/info.py | 10 ++--- pygmt/src/inset.py | 6 +-- pygmt/src/legend.py | 12 ++--- pygmt/src/logo.py | 12 ++--- pygmt/src/makecpt.py | 2 +- pygmt/src/meca.py | 14 +++--- pygmt/src/nearneighbor.py | 28 ++++++------ pygmt/src/plot.py | 40 ++++++++--------- pygmt/src/plot3d.py | 40 ++++++++--------- pygmt/src/project.py | 8 ++-- pygmt/src/psconvert.py | 2 +- pygmt/src/rose.py | 20 ++++----- pygmt/src/select.py | 32 ++++++------- pygmt/src/solar.py | 14 +++--- pygmt/src/sph2grd.py | 18 ++++---- pygmt/src/sphdistance.py | 8 ++-- pygmt/src/sphinterpolate.py | 8 ++-- pygmt/src/subplot.py | 10 ++--- pygmt/src/surface.py | 26 +++++------ pygmt/src/ternary.py | 14 +++--- pygmt/src/text.py | 22 ++++----- pygmt/src/triangulate.py | 54 +++++++++++----------- pygmt/src/velo.py | 24 +++++----- pygmt/src/which.py | 2 +- pygmt/src/wiggle.py | 30 ++++++------- pygmt/src/x2sys_cross.py | 4 +- pygmt/src/x2sys_init.py | 6 +-- pygmt/src/xyz2grd.py | 26 +++++------ 55 files changed, 494 insertions(+), 494 deletions(-) diff --git a/pygmt/src/basemap.py b/pygmt/src/basemap.py index 1e1270d96e9..bd1b3f9a30f 100644 --- a/pygmt/src/basemap.py +++ b/pygmt/src/basemap.py @@ -58,12 +58,12 @@ def basemap( Parameters ---------- - {projection} + $projection zscale/zsize Set z-axis scaling or z-axis size. - {region} + $region *Required if this is the first plot command.* - {frame} + $frame map_scale : str [**g**\|\ **j**\|\ **J**\|\ **n**\|\ **x**]\ *refpoint*\ **+w**\ *length*. @@ -92,11 +92,11 @@ def basemap( compass : str Draw a map magnetic rose on the map at the location defined by the reference and anchor points. - {verbose} - {panel} - {coltypes} - {perspective} - {transparency} + $verbose + $panel + $coltypes + $perspective + $transparency """ self._activate_figure() diff --git a/pygmt/src/binstats.py b/pygmt/src/binstats.py index 2a486894432..914af4faf72 100644 --- a/pygmt/src/binstats.py +++ b/pygmt/src/binstats.py @@ -76,7 +76,7 @@ def binstats( ---------- data A file name of an ASCII data table or a 2-D {table-classes}. - {outgrid} + $outgrid statistic Choose the statistic that will be computed per node based on the points that are within *radius* distance of the node. Select one of: @@ -115,14 +115,14 @@ def binstats( computed while the count will be the sum of the weights instead of number of points. If the weights are actually uncertainties (one sigma) then append **+s** and weight = 1/sigma. - {spacing} - {region} - {verbose} - {aspatial} - {binary} - {header} - {incols} - {registration} + $spacing + $region + $verbose + $aspatial + $binary + $header + $incols + $registration Returns ------- diff --git a/pygmt/src/blockm.py b/pygmt/src/blockm.py index 80e5f2af86e..a9fe4a7fdfc 100644 --- a/pygmt/src/blockm.py +++ b/pygmt/src/blockm.py @@ -126,9 +126,9 @@ def blockmean( {table-classes}. x/y/z : 1-D arrays Arrays of x and y coordinates and values z of the data points. - {output_type} - {outfile} - {spacing} + $output_type + $outfile + $spacing summary : str [**m**\|\ **n**\|\ **s**\|\ **w**]. Type of summary values calculated by blockmean. @@ -137,18 +137,18 @@ def blockmean( - **n**: report the number of input points inside each block - **s**: report the sum of all z-values inside a block - **w**: report the sum of weights - {region} - {verbose} - {aspatial} - {binary} - {nodata} - {find} - {incols} - {coltypes} - {header} - {outcols} - {registration} - {wrap} + $region + $verbose + $aspatial + $binary + $nodata + $find + $incols + $coltypes + $header + $outcols + $registration + $wrap Returns ------- @@ -241,21 +241,21 @@ def blockmedian( {table-classes}. x/y/z : 1-D arrays Arrays of x and y coordinates and values z of the data points. - {output_type} - {outfile} - {spacing} - {region} - {verbose} - {aspatial} - {binary} - {nodata} - {find} - {coltypes} - {header} - {incols} - {outcols} - {registration} - {wrap} + $output_type + $outfile + $spacing + $region + $verbose + $aspatial + $binary + $nodata + $find + $coltypes + $header + $incols + $outcols + $registration + $wrap Returns ------- @@ -350,21 +350,21 @@ def blockmode( {table-classes}. x/y/z : 1-D arrays Arrays of x and y coordinates and values z of the data points. - {output_type} - {outfile} - {spacing} - {region} - {verbose} - {aspatial} - {binary} - {nodata} - {find} - {coltypes} - {header} - {incols} - {outcols} - {registration} - {wrap} + $output_type + $outfile + $spacing + $region + $verbose + $aspatial + $binary + $nodata + $find + $coltypes + $header + $incols + $outcols + $registration + $wrap Returns ------- diff --git a/pygmt/src/coast.py b/pygmt/src/coast.py index 9f54ffcafe0..ca9b03c2576 100644 --- a/pygmt/src/coast.py +++ b/pygmt/src/coast.py @@ -79,11 +79,11 @@ def coast( Parameters ---------- - {projection} - {region} + $projection + $region *Required if this is the first plot command.* - {area_thresh} - {frame} + $area_thresh + $frame lakes : str or list *fill*\ [**+l**\|\ **+r**]. Set the shade, color, or pattern for lakes and river-lakes. The @@ -172,10 +172,10 @@ def coast( 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]. - {panel} - {perspective} - {transparency} - {verbose} + $panel + $perspective + $transparency + $verbose Example ------- diff --git a/pygmt/src/colorbar.py b/pygmt/src/colorbar.py index 5cbcfec8da1..e1840a11312 100644 --- a/pygmt/src/colorbar.py +++ b/pygmt/src/colorbar.py @@ -71,7 +71,7 @@ def colorbar( ---------- frame : str or list Set colorbar boundary frame, labels, and axes attributes. - {cmap} + $cmap position : str [**g**\|\ **j**\|\ **J**\|\ **n**\|\ **x**]\ *refpoint*\ [**+w**\ *length*\ [/\ *width*]]\ [**+e**\ [**b**\|\ **f**][*length*]]\ @@ -135,10 +135,10 @@ def colorbar( may be in plot distance units or given as relative fractions and will be automatically scaled so that the sum of the widths equals the requested colorbar length. - {verbose} - {panel} - {perspective} - {transparency} + $verbose + $panel + $perspective + $transparency Example ------- diff --git a/pygmt/src/contour.py b/pygmt/src/contour.py index b4cd956a90e..b8d76b8f963 100644 --- a/pygmt/src/contour.py +++ b/pygmt/src/contour.py @@ -79,8 +79,8 @@ 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} + $projection + $region annotation : float, list, or str Specify or disable annotated contour levels, modifies annotated contours specified in ``levels``. @@ -91,7 +91,7 @@ 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} + $frame levels : float, list, or str Specify the contour lines to generate. @@ -140,16 +140,16 @@ 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. - {verbose} - {binary} - {panel} - {nodata} - {find} - {coltypes} - {header} - {incols} - {perspective} - {transparency} + $verbose + $binary + $panel + $nodata + $find + $coltypes + $header + $incols + $perspective + $transparency """ self._activate_figure() diff --git a/pygmt/src/dimfilter.py b/pygmt/src/dimfilter.py index f70b6ea12a6..cc35c515d2b 100644 --- a/pygmt/src/dimfilter.py +++ b/pygmt/src/dimfilter.py @@ -53,8 +53,8 @@ def dimfilter( Parameters ---------- - {grid} - {outgrid} + $grid + $outgrid distance : int or str Distance flag tells how grid (x,y) relates to filter width, as follows: @@ -111,7 +111,7 @@ def dimfilter( region : str or list [*xmin*, *xmax*, *ymin*, *ymax*]. Define the region of the output points [Default is the same as the input]. - {verbose} + $verbose Returns ------- diff --git a/pygmt/src/filter1d.py b/pygmt/src/filter1d.py index 101cd9c9f1d..dc1abc7a5b5 100644 --- a/pygmt/src/filter1d.py +++ b/pygmt/src/filter1d.py @@ -46,8 +46,8 @@ def filter1d( Parameters ---------- - {output_type} - {outfile} + $output_type + $outfile filter_type : str **type**\ *width*\ [**+h**]. Set the filter **type**. Choose among convolution and non-convolution diff --git a/pygmt/src/grd2cpt.py b/pygmt/src/grd2cpt.py index 3408faa2c65..416a58539a6 100644 --- a/pygmt/src/grd2cpt.py +++ b/pygmt/src/grd2cpt.py @@ -96,7 +96,7 @@ def grd2cpt( Parameters ---------- - {grid} + $grid transparency : float or str Set a constant level of transparency (0-100) for all color slices. Append **+a** to also affect the foreground, background, and NaN colors [Default is no @@ -182,7 +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``. - {verbose} + $verbose Example ------- diff --git a/pygmt/src/grd2xyz.py b/pygmt/src/grd2xyz.py index 662fe228c81..288f7e0176f 100644 --- a/pygmt/src/grd2xyz.py +++ b/pygmt/src/grd2xyz.py @@ -59,9 +59,9 @@ def grd2xyz( Parameters ---------- - {grid} - {output_type} - {outfile} + $grid + $output_type + $outfile cstyle : str [**f**\|\ **i**]. Replace the x- and y-coordinates on output with the corresponding @@ -69,7 +69,7 @@ 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} + $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. @@ -84,7 +84,7 @@ 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} + $verbose convention : str [*flags*]. Write a 1-column ASCII [or binary] table. Output will be organized @@ -115,12 +115,12 @@ def grd2xyz( - **d**: 8-byte floating point double precision Default format is scanline orientation of ASCII numbers: **TLa**. - {binary} - {nodata} - {coltypes} - {header} - {outcols} - {skiprows} + $binary + $nodata + $coltypes + $header + $outcols + $skiprows Returns ------- diff --git a/pygmt/src/grdclip.py b/pygmt/src/grdclip.py index d735f6ee1dc..33a2c5e1d43 100644 --- a/pygmt/src/grdclip.py +++ b/pygmt/src/grdclip.py @@ -61,9 +61,9 @@ def grdclip( Parameters ---------- - {grid} - {outgrid} - {region} + $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*. @@ -81,7 +81,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. - {verbose} + $verbose Returns ------- diff --git a/pygmt/src/grdcontour.py b/pygmt/src/grdcontour.py index 925147e47c0..709d96c6a92 100644 --- a/pygmt/src/grdcontour.py +++ b/pygmt/src/grdcontour.py @@ -66,7 +66,7 @@ def grdcontour( Parameters ---------- - {grid} + $grid levels : float, list, or str Specify the contour lines to generate. @@ -94,16 +94,16 @@ def grdcontour( Do not draw contours with less than `cut` number of points. resample : str or int Resample smoothing factor. - {projection} - {region} - {frame} + $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} + $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 +114,8 @@ 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} + $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,8 +123,8 @@ 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. - {perspective} - {transparency} + $perspective + $transparency Example ------- diff --git a/pygmt/src/grdcut.py b/pygmt/src/grdcut.py index cf198d9dc74..1687570ddf1 100644 --- a/pygmt/src/grdcut.py +++ b/pygmt/src/grdcut.py @@ -53,15 +53,15 @@ def grdcut( Parameters ---------- - {grid} + $grid kind The raster data kind. Valid values are ``"grid"`` and ``"image"``. When the input ``grid`` is a file name, it's difficult to determine if the file is a grid or an image, so we need to specify the raster kind explicitly. The default is ``"grid"``. - {outgrid} - {projection} - {region} + $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,8 +87,8 @@ def grdcut( considering the range of the core subset for further reduction of the area. - {verbose} - {coltypes} + $verbose + $coltypes Returns ------- diff --git a/pygmt/src/grdfill.py b/pygmt/src/grdfill.py index 11dd368caf5..7c60398d4bb 100644 --- a/pygmt/src/grdfill.py +++ b/pygmt/src/grdfill.py @@ -111,8 +111,8 @@ def grdfill( # noqa: PLR0913 Parameters ---------- - {grid} - {outgrid} + $grid + $outgrid constantfill Fill the holes with a constant value. Specify the constant value to use. gridfill @@ -143,9 +143,9 @@ def grdfill( # noqa: PLR0913 .. deprecated:: 0.15.0 Use ``constantfill``, ``gridfill``, ``neighborfill``, or ``splinefill`` instead. The parameter will be removed in v0.19.0. - {region} - {coltypes} - {verbose} + $region + $coltypes + $verbose Returns ------- diff --git a/pygmt/src/grdfilter.py b/pygmt/src/grdfilter.py index 00b3915e43b..ce82564d8d7 100644 --- a/pygmt/src/grdfilter.py +++ b/pygmt/src/grdfilter.py @@ -50,8 +50,8 @@ def grdfilter( Parameters ---------- - {grid} - {outgrid} + $grid + $outgrid filter : str **b**\|\ **c**\|\ **g**\|\ **o**\|\ **m**\|\ **p**\|\ **h**\ *width*\ [/*width2*\][*modifiers*]. @@ -87,7 +87,7 @@ def grdfilter( - ``"5"``: grid (x,y) in Mercator ``projection="m1"`` img units, *width* in km, Spherical distance calculation. - {spacing} + $spacing nans : str or float **i**\|\ **p**\|\ **r**. Determine how NaN-values in the input grid affect the filtered output. @@ -96,15 +96,15 @@ def grdfilter( the output node will be set to NaN (only applies if both grids are co-registered). **p** will force the filtered value to be NaN if any grid nodes with NaN-values are found inside the filter circle. - {region} + $region toggle Toggle the node registration for the output grid so as to become the opposite of the input grid [Default gives the same registration as the input grid]. Alternatively, use ``registration`` to set the registration explicitly. - {verbose} - {coltypes} - {registration} - {cores} + $verbose + $coltypes + $registration + $cores Returns ------- diff --git a/pygmt/src/grdgradient.py b/pygmt/src/grdgradient.py index c10784a0391..93f8356ce5a 100644 --- a/pygmt/src/grdgradient.py +++ b/pygmt/src/grdgradient.py @@ -55,8 +55,8 @@ def grdgradient( Parameters ---------- - {grid} - {outgrid} + $grid + $outgrid azimuth : float, str, or list *azim*\ [/*azim2*]. Azimuthal direction for a directional derivative; *azim* is the @@ -141,13 +141,13 @@ def grdgradient( grid output is not needed for this run then do not specify ``outgrid``. For subsequent runs, just use **r** to read these values. Using **R** will read then delete the statistics file. - {region} + $region slope_file : str Name of output grid file with scalar magnitudes of gradient vectors. Requires ``direction`` but makes ``outgrid`` optional. - {verbose} - {coltypes} - {interpolation} + $verbose + $coltypes + $interpolation Returns ------- diff --git a/pygmt/src/grdhisteq.py b/pygmt/src/grdhisteq.py index a877ab69198..bd5c542bb2e 100644 --- a/pygmt/src/grdhisteq.py +++ b/pygmt/src/grdhisteq.py @@ -83,8 +83,8 @@ def equalize_grid( Parameters ---------- - {grid} - {outgrid} + $grid + $outgrid divisions : int Set the number of divisions of the data range. gaussian : bool or int or float @@ -94,8 +94,8 @@ def equalize_grid( range. quadratic: bool Perform quadratic equalization [Default is linear]. - {region} - {verbose} + $region + $verbose Returns ------- @@ -181,16 +181,16 @@ def compute_bins( Parameters ---------- - {grid} - {output_type} - {outfile} + $grid + $output_type + $outfile divisions : int Set the number of divisions of the data range. quadratic : bool Perform quadratic equalization [Default is linear]. - {region} - {verbose} - {header} + $region + $verbose + $header Returns ------- diff --git a/pygmt/src/grdimage.py b/pygmt/src/grdimage.py index fdd5dced557..1d2b6106034 100644 --- a/pygmt/src/grdimage.py +++ b/pygmt/src/grdimage.py @@ -88,9 +88,9 @@ def grdimage( # noqa: PLR0913 Parameters ---------- - {grid} - {frame} - {cmap} + $grid + $frame + $cmap img_in : str [**r**]. GMT will automatically detect standard image files (Geotiff, TIFF, @@ -132,7 +132,7 @@ 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} + $projection monochrome Force conversion to monochrome image using the (television) YIQ transformation. Cannot be used with ``nan_transparent``. @@ -146,14 +146,14 @@ 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"``]. - {region} - {verbose} - {panel} - {coltypes} - {interpolation} - {perspective} - {transparency} - {cores} + $region + $verbose + $panel + $coltypes + $interpolation + $perspective + $transparency + $cores Example ------- diff --git a/pygmt/src/grdinfo.py b/pygmt/src/grdinfo.py index cd7195f58d2..c1224a74f62 100644 --- a/pygmt/src/grdinfo.py +++ b/pygmt/src/grdinfo.py @@ -50,8 +50,8 @@ def grdinfo( Parameters ---------- - {grid} - {region} + $grid + $region per_column : str or bool **n**\|\ **t**. Format the report using tab-separated fields on a single line. The @@ -114,8 +114,8 @@ 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`. - {verbose} - {coltypes} + $verbose + $coltypes Returns ------- diff --git a/pygmt/src/grdlandmask.py b/pygmt/src/grdlandmask.py index c91cb262e67..e7975c969f1 100644 --- a/pygmt/src/grdlandmask.py +++ b/pygmt/src/grdlandmask.py @@ -54,10 +54,10 @@ def grdlandmask( Parameters ---------- - {outgrid} - {spacing} - {region} - {area_thresh} + $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"``, @@ -90,9 +90,9 @@ def grdlandmask( Values can be any number, or one of ``None``, ``"NaN"``, and ``np.nan`` for setting nodes to NaN. - {verbose} - {registration} - {cores} + $verbose + $registration + $cores Returns ------- diff --git a/pygmt/src/grdproject.py b/pygmt/src/grdproject.py index 7678ab42d63..0ac81f57b63 100644 --- a/pygmt/src/grdproject.py +++ b/pygmt/src/grdproject.py @@ -65,20 +65,20 @@ def grdproject( Parameters ---------- - {grid} - {outgrid} + $grid + $outgrid inverse : bool When set to ``True`` transforms grid from rectangular to geographical [Default is ``False``]. - {projection} - {region} + $projection + $region center If ``True``, let the projected coordinates be relative to the projection center [Default is relative to the lower left corner]. Optionally, set offsets (*dx*, *dy*) in the projected units to be added (or subtracted when ``inverse`` is set) to (from) the projected coordinates, such as false eastings and northings for particular projection zones [Default is ``(0, 0)``]. - {spacing} + $spacing dpi : int Set the resolution for the new grid in dots per inch. scaling : str @@ -93,9 +93,9 @@ def grdproject( Append **c**, **i**, or **p** to indicate that centimeters, inches, or points should be the projected measure unit. Cannot be used with ``scaling``. - {verbose} - {interpolation} - {registration} + $verbose + $interpolation + $registration Returns ------- diff --git a/pygmt/src/grdsample.py b/pygmt/src/grdsample.py index c8593372d89..e9ee3ad7f6d 100644 --- a/pygmt/src/grdsample.py +++ b/pygmt/src/grdsample.py @@ -63,20 +63,20 @@ def grdsample( Parameters ---------- - {grid} - {outgrid} - {spacing} - {region} + $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. - {verbose} - {coltypes} - {interpolation} - {registration} - {cores} + $verbose + $coltypes + $interpolation + $registration + $cores Returns ------- diff --git a/pygmt/src/grdtrack.py b/pygmt/src/grdtrack.py index fd0631de1fc..fb257cc6e0a 100644 --- a/pygmt/src/grdtrack.py +++ b/pygmt/src/grdtrack.py @@ -85,13 +85,13 @@ def grdtrack( Parameters ---------- - {grid} + $grid points Pass in either a file name to an ASCII data table, a 2-D {table-classes}. - {output_type} - {outfile} + $output_type + $outfile newcolname : str Required if ``points`` is a :class:`pandas.DataFrame`. The name for the new column in the track :class:`pandas.DataFrame` table where the @@ -195,7 +195,7 @@ 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} + $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]. @@ -253,22 +253,22 @@ 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} + $verbose z_only : bool Only write out the sampled z-values [Default writes all columns]. - {aspatial} - {binary} - {nodata} - {find} - {coltypes} - {gap} - {header} - {incols} - {distcalc} - {interpolation} - {outcols} - {skiprows} - {wrap} + $aspatial + $binary + $nodata + $find + $coltypes + $gap + $header + $incols + $distcalc + $interpolation + $outcols + $skiprows + $wrap Returns ------- diff --git a/pygmt/src/grdview.py b/pygmt/src/grdview.py index 0a62dd4f79e..caedd485c86 100644 --- a/pygmt/src/grdview.py +++ b/pygmt/src/grdview.py @@ -66,16 +66,16 @@ def grdview( # noqa: PLR0913 Parameters ---------- - {grid} + $grid region : str or list *xmin/xmax/ymin/ymax*\ [**+r**][**+u**\ *unit*]. 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} + $projection zscale/zsize Set z-axis scaling or z-axis size. - {frame} + $frame cmap : str The name of the color palette table to use. drapegrid : str or :class:`xarray.DataArray` @@ -118,12 +118,12 @@ 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"``]. - {verbose} - {panel} - {coltypes} - {interpolation} - {perspective} - {transparency} + $verbose + $panel + $coltypes + $interpolation + $perspective + $transparency Example ------- diff --git a/pygmt/src/grdvolume.py b/pygmt/src/grdvolume.py index 1f97f12994d..f7bf485f5c6 100644 --- a/pygmt/src/grdvolume.py +++ b/pygmt/src/grdvolume.py @@ -51,9 +51,9 @@ def grdvolume( Parameters ---------- - {grid} - {output_type} - {outfile} + $grid + $output_type + $outfile contour : str, float, or list *cval*\|\ *low/high/delta*\|\ **r**\ *low/high*\|\ **r**\ *cval*. Find area, volume and mean height (volume/area) inside and above the @@ -68,8 +68,8 @@ def grdvolume( between two contours. If no *contour* is given then there is no contour and the entire grid area, volume and the mean height is returned and *cval* will be reported as 0. - {region} - {verbose} + $region + $verbose Returns ------- diff --git a/pygmt/src/histogram.py b/pygmt/src/histogram.py index 4b2d026f11f..19be328390b 100644 --- a/pygmt/src/histogram.py +++ b/pygmt/src/histogram.py @@ -67,14 +67,14 @@ def histogram( data Pass in either a file name to an ASCII data table, a Python list, a 2-D {table-classes}. - {projection} - {region} - {frame} - {cmap} + $projection + $region + $frame + $cmap fill : str Set color or pattern for filling bars [Default is no fill]. - {pen} - {panel} + $pen + $panel annotate : bool or str [**+b**][**+f**\ *font*][**+o**\ *off*][**+r**]. Annotate each bar with the count it represents. Append any of the @@ -138,16 +138,16 @@ def histogram( To use weights provided as a second data column instead of pure counts, append **+w**. - {verbose} - {binary} - {nodata} - {find} - {header} - {incols} - {label} - {perspective} - {transparency} - {wrap} + $verbose + $binary + $nodata + $find + $header + $incols + $label + $perspective + $transparency + $wrap """ self._activate_figure() diff --git a/pygmt/src/image.py b/pygmt/src/image.py index 24a184812eb..cdaf5167b96 100644 --- a/pygmt/src/image.py +++ b/pygmt/src/image.py @@ -62,8 +62,8 @@ def image( An Encapsulated PostScript (EPS) file or a raster image file. An EPS file must contain an appropriate BoundingBox. A raster file can have a depth of 1, 8, 24, or 32 bits and is read via GDAL. - {projection} - {region} + $projection + $region position : str [**g**\|\ **j**\|\ **J**\|\ **n**\|\ **x**]\ *refpoint*\ **+r**\ *dpi*\ **+w**\ [**-**]\ *width*\ [/*height*]\ [**+j**\ *justify*]\ @@ -85,10 +85,10 @@ def image( monochrome Convert color image to monochrome grayshades using the (television) YIQ-transformation. - {verbose} - {panel} - {perspective} - {transparency} + $verbose + $panel + $perspective + $transparency """ self._activate_figure() diff --git a/pygmt/src/info.py b/pygmt/src/info.py index 8381e33dba1..76122446c1b 100644 --- a/pygmt/src/info.py +++ b/pygmt/src/info.py @@ -75,11 +75,11 @@ def info( 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]``. - {verbose} - {aspatial} - {incols} - {coltypes} - {registration} + $verbose + $aspatial + $incols + $coltypes + $registration Returns ------- diff --git a/pygmt/src/inset.py b/pygmt/src/inset.py index 30b5d316e0b..394d73b648c 100644 --- a/pygmt/src/inset.py +++ b/pygmt/src/inset.py @@ -102,9 +102,9 @@ def inset( no_clip Do **not** clip features extruding outside the inset frame boundaries [Default is ``False``]. - {region} - {projection} - {verbose} + $region + $projection + $verbose Examples -------- diff --git a/pygmt/src/legend.py b/pygmt/src/legend.py index 82dabc72478..bc8c3847a70 100644 --- a/pygmt/src/legend.py +++ b/pygmt/src/legend.py @@ -67,8 +67,8 @@ def legend( - A :class:`io.StringIO` object containing the legend specification See :gmt-docs:`legend.html` for the definition of the legend specification. - {projection} - {region} + $projection + $region position : str [**g**\|\ **j**\|\ **J**\|\ **n**\|\ **x**]\ *refpoint*\ **+w**\ *width*\ [/*height*]\ [**+j**\ *justify*]\ [**+l**\ *spacing*]\ @@ -82,10 +82,10 @@ def legend( rectangular box is drawn using :gmt-term:`MAP_FRAME_PEN`. To customize the box appearance, pass a :class:`pygmt.params.Box` object to control style, fill, pen, and other box properties. - {verbose} - {panel} - {perspective} - {transparency} + $verbose + $panel + $perspective + $transparency """ self._activate_figure() diff --git a/pygmt/src/logo.py b/pygmt/src/logo.py index defdc065eb3..74f9c5bac9a 100644 --- a/pygmt/src/logo.py +++ b/pygmt/src/logo.py @@ -48,8 +48,8 @@ def logo( Parameters ---------- - {projection} - {region} + $projection + $region position : str [**g**\|\ **j**\|\ **J**\|\ **n**\|\ **x**]\ *refpoint*\ **+w**\ *width*\ [**+j**\ *justify*]\ [**+o**\ *dx*\ [/*dy*]]. @@ -65,10 +65,10 @@ def logo( - ``"standard"``: The text label "The Generic Mapping Tools". - ``"no_label"``: Skip the text label. - ``"url"``: The URL to the GMT website. - {verbose} - {panel} - {transparency} - {perspective} + $verbose + $panel + $transparency + $perspective """ self._activate_figure() diff --git a/pygmt/src/makecpt.py b/pygmt/src/makecpt.py index 96adc0d426d..04ece3d4762 100644 --- a/pygmt/src/makecpt.py +++ b/pygmt/src/makecpt.py @@ -157,7 +157,7 @@ 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} + $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 diff --git a/pygmt/src/meca.py b/pygmt/src/meca.py index 54fb84cac16..b8631f15197 100644 --- a/pygmt/src/meca.py +++ b/pygmt/src/meca.py @@ -341,13 +341,13 @@ def meca( # 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]. - {projection} - {region} - {frame} - {verbose} - {panel} - {perspective} - {transparency} + $projection + $region + $frame + $verbose + $panel + $perspective + $transparency """ self._activate_figure() # Determine the focal mechanism convention from the input data or parameters. diff --git a/pygmt/src/nearneighbor.py b/pygmt/src/nearneighbor.py index df58fea9e55..524680f7b42 100644 --- a/pygmt/src/nearneighbor.py +++ b/pygmt/src/nearneighbor.py @@ -93,14 +93,14 @@ def nearneighbor( x/y/z : 1-D arrays Arrays of x and y coordinates and values z of the data points. - {spacing} + $spacing - {region} + $region search_radius : str Set the search radius that determines which data points are considered close to a node. - {outgrid} + $outgrid empty : str Optional. Set the value assigned to empty nodes. Defaults to NaN. @@ -118,17 +118,17 @@ def nearneighbor( Alternatively, use ``sectors="n"`` to call GDAL's nearest neighbor algorithm instead. - {verbose} - {aspatial} - {binary} - {nodata} - {find} - {coltypes} - {gap} - {header} - {incols} - {registration} - {wrap} + $verbose + $aspatial + $binary + $nodata + $find + $coltypes + $gap + $header + $incols + $registration + $wrap Returns ------- diff --git a/pygmt/src/plot.py b/pygmt/src/plot.py index 6fecd648733..5562ae45a62 100644 --- a/pygmt/src/plot.py +++ b/pygmt/src/plot.py @@ -117,8 +117,8 @@ 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} + $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 @@ -142,8 +142,8 @@ 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} + $frame + $cmap offset : str *dx*/*dy*. Offset the plot symbol or line locations by the given amounts @@ -179,7 +179,7 @@ def plot( # noqa: PLR0912, PLR0913 Instead of the codes **a**\|\ **r**\|\ **s**\|\ **t** you may append the coordinates of a *refpoint* which will serve as a fixed external reference point for all groups. - {fill} + $fill *fill* can be a 1-D array, but it is only valid if using ``x``/``y`` and ``cmap=True`` is also required. intensity : float, bool, or 1-D array @@ -210,8 +210,8 @@ def plot( # noqa: PLR0912, PLR0913 style : str Plot symbols (including vectors, pie slices, fronts, decorated or quoted lines). - {pen} - {verbose} + $pen + $verbose zvalue : str *value*\|\ *file*. Instead of specifying a symbol or polygon fill and outline color @@ -221,21 +221,21 @@ 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``. - {aspatial} - {binary} - {panel} - {nodata} - {find} - {coltypes} - {gap} - {header} - {incols} - {label} - {perspective} - {transparency} + $aspatial + $binary + $panel + $nodata + $find + $coltypes + $gap + $header + $incols + $label + $perspective + $transparency ``transparency`` can also be a 1-D array to set varying transparency for symbols, but this option is only valid if using ``x``/``y``. - {wrap} + $wrap """ # TODO(GMT>6.5.0): Remove the note for the upstream bug of the "straight_line" # parameter. diff --git a/pygmt/src/plot3d.py b/pygmt/src/plot3d.py index c7c4cad5d74..8400eb880b4 100644 --- a/pygmt/src/plot3d.py +++ b/pygmt/src/plot3d.py @@ -120,10 +120,10 @@ 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} + $projection zscale/zsize Set z-axis scaling or z-axis size. - {region} + $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 @@ -149,13 +149,13 @@ 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} + $frame + $cmap offset : str *dx*/*dy*\ [/*dz*]. Offset the plot symbol or line locations by the given amounts *dx*/*dy*\ [/*dz*] [Default is no offset]. - {fill} + $fill *fill* can be a 1-D array, but it is only valid if using ``x``/``y`` and ``cmap=True`` is also required. intensity : float, bool, or 1-D array @@ -190,8 +190,8 @@ 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} + $verbose + $pen zvalue : str *value*\|\ *file*. Instead of specifying a symbol or polygon fill and outline color @@ -201,21 +201,21 @@ 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``. - {aspatial} - {binary} - {panel} - {nodata} - {find} - {coltypes} - {gap} - {header} - {incols} - {label} - {perspective} - {transparency} + $aspatial + $binary + $panel + $nodata + $find + $coltypes + $gap + $header + $incols + $label + $perspective + $transparency ``transparency`` can also be a 1-D array to set varying transparency for symbols, but this option is only valid if using ``x``/``y``/``z``. - {wrap} + $wrap """ # TODO(GMT>6.5.0): Remove the note for the upstream bug of the "straight_line" # parameter. diff --git a/pygmt/src/project.py b/pygmt/src/project.py index 1778a331cd3..f299b732e46 100644 --- a/pygmt/src/project.py +++ b/pygmt/src/project.py @@ -124,8 +124,8 @@ def project( # 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}. - {output_type} - {outfile} + $output_type + $outfile center Set the origin of the projection, in the form of (*cx*, *cy*), in Definitions 1 @@ -207,8 +207,8 @@ def project( # noqa: PLR0913 For the Cartesian ellipse (which requires ``flat_earth``), the *direction* is counter-clockwise from the horizontal instead of an *azimuth*. - {verbose} - {coltypes} + $verbose + $coltypes Returns ------- diff --git a/pygmt/src/psconvert.py b/pygmt/src/psconvert.py index 73e6cc84faf..d59cb0ec295 100644 --- a/pygmt/src/psconvert.py +++ b/pygmt/src/psconvert.py @@ -112,7 +112,7 @@ def psconvert( both an EPS and a PDF file. Using **F** creates a multi-page PDF file from the list of input PS or PDF files. It requires the ``prefix`` parameter. - {verbose} + $verbose """ self._activate_figure() # Default cropping the figure to True diff --git a/pygmt/src/rose.py b/pygmt/src/rose.py index f2d4810225c..992bd687e48 100644 --- a/pygmt/src/rose.py +++ b/pygmt/src/rose.py @@ -198,16 +198,16 @@ def rose( Statistics, *J. Stat. Software*, 31(10), 1-21, https://doi.org/10.18637/jss.v031.i10. - {verbose} - {binary} - {panel} - {nodata} - {find} - {header} - {incols} - {perspective} - {transparency} - {wrap} + $verbose + $binary + $panel + $nodata + $find + $header + $incols + $perspective + $transparency + $wrap """ self._activate_figure() diff --git a/pygmt/src/select.py b/pygmt/src/select.py index c9ff73c35d7..f463df602af 100644 --- a/pygmt/src/select.py +++ b/pygmt/src/select.py @@ -88,9 +88,9 @@ def select( data Pass in either a file name to an ASCII data table, a 2-D {table-classes}. - {output_type} - {outfile} - {area_thresh} + $output_type + $outfile + $area_thresh dist2pt : str *pointfile*\|\ *lon*/*lat*\ **+d**\ *dist*. Pass all records whose locations are within *dist* of any of the @@ -143,7 +143,7 @@ def select( (and ``area_thresh``, ``resolution``). - **z** select records NOT within the range specified by ``z_subregion``. - {projection} + $projection mask : str or list Pass all records whose location is inside specified geographical features. Specify if records should be skipped (s) or kept (k) using @@ -163,8 +163,8 @@ def select( 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} + $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 @@ -184,16 +184,16 @@ 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. - {binary} - {nodata} - {find} - {coltypes} - {gap} - {header} - {incols} - {outcols} - {skiprows} - {wrap} + $binary + $nodata + $find + $coltypes + $gap + $header + $incols + $outcols + $skiprows + $wrap Returns ------- diff --git a/pygmt/src/solar.py b/pygmt/src/solar.py index edfd5688d44..7669153e66f 100644 --- a/pygmt/src/solar.py +++ b/pygmt/src/solar.py @@ -74,17 +74,17 @@ 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} + $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"``]. - {verbose} - {panel} - {perspective} - {transparency} + $verbose + $panel + $perspective + $transparency Example ------- diff --git a/pygmt/src/sph2grd.py b/pygmt/src/sph2grd.py index 50ab428ba89..f2b6d28311b 100644 --- a/pygmt/src/sph2grd.py +++ b/pygmt/src/sph2grd.py @@ -48,15 +48,15 @@ def sph2grd( Pass in data with L, M, C[L,M], S[L,M] values by providing a file name to an ASCII data table, a 2-D {table-classes}. - {outgrid} - {spacing} - {region} - {verbose} - {binary} - {header} - {incols} - {registration} - {cores} + $outgrid + $spacing + $region + $verbose + $binary + $header + $incols + $registration + $cores Returns ------- diff --git a/pygmt/src/sphdistance.py b/pygmt/src/sphdistance.py index ba185a7a665..3da03a7d25b 100644 --- a/pygmt/src/sphdistance.py +++ b/pygmt/src/sphdistance.py @@ -59,10 +59,10 @@ def sphdistance( {table-classes}. x/y : 1-D arrays Arrays of x and y coordinates. - {outgrid} - {spacing} - {region} - {verbose} + $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 diff --git a/pygmt/src/sphinterpolate.py b/pygmt/src/sphinterpolate.py index 1c82c741dfc..fe09fa60311 100644 --- a/pygmt/src/sphinterpolate.py +++ b/pygmt/src/sphinterpolate.py @@ -46,10 +46,10 @@ def sphinterpolate( 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}. - {outgrid} - {spacing} - {region} - {verbose} + $outgrid + $spacing + $region + $verbose Returns ------- diff --git a/pygmt/src/subplot.py b/pygmt/src/subplot.py index 8916d0edbb7..337f26ba689 100644 --- a/pygmt/src/subplot.py +++ b/pygmt/src/subplot.py @@ -96,7 +96,7 @@ def subplot( lowercase Roman numerals; use **+R** for uppercase Roman numerals [Default is Arabic numerals]. Append **+v** to increase tag numbers vertically down columns [Default is horizontally across rows]. - {frame} + $frame clearance : str or list [*side*]\ *clearance*. Reserve a space of dimension *clearance* between the margin and the @@ -109,7 +109,7 @@ def subplot( side and 2 cm on south side). Such space will be left untouched by the main map plotting but can be accessed by methods that plot scales, bars, text, etc. - {projection} + $projection margins Margin space that is added between neighboring subplots (i.e., the interior margins) in addition to the automatic space added for tick marks, annotations, @@ -124,7 +124,7 @@ def subplot( The actual gap created is always a sum of the margins for the two opposing sides (e.g., east plus west or south plus north margins) [Default is half the primary annotation font size, giving the full annotation font size as the default gap]. - {region} + $region sharex : bool or str Set subplot layout for shared x-axes. Use when all subplots in a column share a common *x*-range. If ``sharex=True``, the first (i.e., @@ -157,7 +157,7 @@ def subplot( While individual subplots can have titles (see ``sharex``/``sharey`` or ``frame``), the entire figure may also have an overarching *heading* [no heading]. Font is determined by setting :gmt-term:`FONT_HEADING`. - {verbose} + $verbose """ self._activate_figure() @@ -257,7 +257,7 @@ def set_panel( clearances set by ``clearance`` in the initial :meth:`pygmt.Figure.subplot` call. - {verbose} + $verbose """ self._activate_figure() diff --git a/pygmt/src/surface.py b/pygmt/src/surface.py index 7dcb1e55d18..58488b1b4e2 100644 --- a/pygmt/src/surface.py +++ b/pygmt/src/surface.py @@ -90,10 +90,10 @@ def surface( x/y/z : 1-D arrays Arrays of x and y coordinates and values z of the data points. - {spacing} + $spacing - {region} - {outgrid} + $region + $outgrid convergence : float Optional. Convergence limit. Iteration is assumed to have converged when the maximum absolute change in any grid value is less than @@ -138,16 +138,16 @@ 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} - {nodata} - {find} - {coltypes} - {header} - {incols} - {registration} - {wrap} + $verbose + $aspatial + $binary + $nodata + $find + $coltypes + $header + $incols + $registration + $wrap Returns ------- diff --git a/pygmt/src/ternary.py b/pygmt/src/ternary.py index f9b79c0f2be..cc0edc14534 100644 --- a/pygmt/src/ternary.py +++ b/pygmt/src/ternary.py @@ -65,8 +65,8 @@ def ternary( # noqa: PLR0913 [*amin*, *amax*, *bmin*, *bmax*, *cmin*, *cmax*]. Give the min and max limits for each of the three axes **a**, **b**, and **c**. - {cmap} - {fill} + $cmap + $fill alabel Set the label for the *a* vertex where the component is 100%. The label is placed at a distance of three times the :gmt-term:`MAP_LABEL_OFFSET` setting @@ -78,11 +78,11 @@ def ternary( # noqa: PLR0913 style : str *symbol*\[\ *size*]. Plot individual symbols in a ternary diagram. - {pen} - {verbose} - {panel} - {perspective} - {transparency} + $pen + $verbose + $panel + $perspective + $transparency """ self._activate_figure() diff --git a/pygmt/src/text.py b/pygmt/src/text.py index 900bda554c9..2180bf1748d 100644 --- a/pygmt/src/text.py +++ b/pygmt/src/text.py @@ -133,8 +133,8 @@ def text_( # noqa: PLR0912, PLR0913, PLR0915 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} + $projection + $region *Required if this is the first plot command.* clearance : str [*dx/dy*][**+to**\|\ **O**\|\ **c**\|\ **C**]. @@ -167,21 +167,21 @@ def text_( # noqa: PLR0912, PLR0913, PLR0915 (see ``clearance``) [Default is ``"0.25p,black,solid"``]. no_clip Do **not** clip text at the frame boundaries [Default is ``False``]. - {verbose} - {aspatial} - {panel} - {find} - {coltypes} - {header} + $verbose + $aspatial + $panel + $find + $coltypes + $header use_word : int Select a specific word from the trailing text, with the first word being 0 [Default is the entire trailing text]. No numerical columns can be specified. - {perspective} - {transparency} + $perspective + $transparency ``transparency`` can also be a 1-D array to set varying transparency for texts, but this option is only valid if using ``x``/``y`` and ``text``. - {wrap} + $wrap """ self._activate_figure() diff --git a/pygmt/src/triangulate.py b/pygmt/src/triangulate.py index ee9840d1d62..877c8fdf966 100644 --- a/pygmt/src/triangulate.py +++ b/pygmt/src/triangulate.py @@ -115,25 +115,25 @@ def regular_grid( 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} + $projection + $region + $spacing + $outgrid The interpolation is performed in the original coordinates, so if your triangles are close to the poles you are better off projecting all data to a local coordinate system before using ``triangulate`` (this is true of all gridding routines) or instead select :gmt-docs:`sphtriangulate `. - {verbose} - {binary} - {nodata} - {find} - {coltypes} - {header} - {incols} - {registration} - {skiprows} - {wrap} + $verbose + $binary + $nodata + $find + $coltypes + $header + $incols + $registration + $skiprows + $wrap Returns ------- @@ -232,19 +232,19 @@ def delaunay_triples( 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} - {verbose} - {binary} - {nodata} - {find} - {coltypes} - {header} - {incols} - {skiprows} - {wrap} + $projection + $region + $output_type + $outfile + $verbose + $binary + $nodata + $find + $coltypes + $header + $incols + $skiprows + $wrap Returns ------- diff --git a/pygmt/src/velo.py b/pygmt/src/velo.py index 01adc1b22ab..67db7d0ee02 100644 --- a/pygmt/src/velo.py +++ b/pygmt/src/velo.py @@ -170,15 +170,15 @@ def velo( with extension taken positive. - **5**: azimuth of eps2 in degrees CW from North. - {projection} - {region} + $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} + $frame + $cmap rescale : str Can be used to rescale the uncertainties of velocities (``spec="e"`` and ``spec="r"``) and rotations (``spec="w"``). Can be combined with @@ -224,7 +224,7 @@ def velo( 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} + $verbose pen : str [*pen*][**+c**\ [**f**\|\ **l**]]. Set pen attributes for velocity arrows, ellipse circumference and fault @@ -242,13 +242,13 @@ def velo( 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**. - {panel} - {nodata} - {find} - {header} - {incols} - {perspective} - {transparency} + $panel + $nodata + $find + $header + $incols + $perspective + $transparency """ self._activate_figure() diff --git a/pygmt/src/which.py b/pygmt/src/which.py index b60952f77b3..d4facbceba6 100644 --- a/pygmt/src/which.py +++ b/pygmt/src/which.py @@ -56,7 +56,7 @@ def which( where GMT normally places downloaded files), **c** to place it in the user cache directory, or **u** for the user data directory instead (i.e., ignoring any subdirectory structure). - {verbose} + $verbose Returns ------- diff --git a/pygmt/src/wiggle.py b/pygmt/src/wiggle.py index ec46f1d0e2d..b2aff053fbd 100644 --- a/pygmt/src/wiggle.py +++ b/pygmt/src/wiggle.py @@ -101,14 +101,14 @@ def wiggle( # noqa: PLR0913 {table-classes}. Use parameter ``incols`` to choose which columns are x, y, z, respectively. - {projection} - {region} + $projection + $region scale : str or float Give anomaly scale in data-units/distance-unit. Append **c**, **i**, or **p** to indicate the distance unit (centimeters, inches, or points); if no unit is given we use the default unit that is controlled by :gmt-term:`PROJ_LENGTH_UNIT`. - {frame} + $frame position : str [**g**\|\ **j**\|\ **J**\|\ **n**\|\ **x**]\ *refpoint*\ **+w**\ *length*\ [**+j**\ *justify*]\ [**+al**\|\ **r**]\ @@ -121,20 +121,20 @@ def wiggle( # noqa: PLR0913 track : str Draw track [Default is no track]. Append pen attributes to use [Default is ``"0.25p,black,solid"``]. - {verbose} + $verbose pen : str Specify outline pen attributes [Default is no outline]. - {binary} - {panel} - {nodata} - {find} - {coltypes} - {gap} - {header} - {incols} - {perspective} - {transparency} - {wrap} + $binary + $panel + $nodata + $find + $coltypes + $gap + $header + $incols + $perspective + $transparency + $wrap """ self._activate_figure() diff --git a/pygmt/src/x2sys_cross.py b/pygmt/src/x2sys_cross.py index 50f47b36c42..dde45bb7cc4 100644 --- a/pygmt/src/x2sys_cross.py +++ b/pygmt/src/x2sys_cross.py @@ -159,7 +159,7 @@ def x2sys_cross( Use **e** for external COEs only, and **i** for internal COEs only [Default is all COEs]. - {region} + $region speed : str or list **l**\|\ **u**\|\ **h**\ *speed*. @@ -176,7 +176,7 @@ def x2sys_cross( speed of 0, upper speed of 10, and disable heading calculations for speeds below 5. - {verbose} + $verbose numpoints : int Give the maximum number of data points on either side of the crossover diff --git a/pygmt/src/x2sys_init.py b/pygmt/src/x2sys_init.py index 4313ed5e033..f510811ffc6 100644 --- a/pygmt/src/x2sys_init.py +++ b/pygmt/src/x2sys_init.py @@ -106,8 +106,8 @@ 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} + $region + $verbose gap : str or list **t**\|\ **d**\ *gap*. @@ -118,7 +118,7 @@ def x2sys_init( If these limits are exceeded then a data gap is assumed and no COE will be determined. - {distcalc} + $distcalc """ aliasdict = AliasSystem().add_common( R=region, diff --git a/pygmt/src/xyz2grd.py b/pygmt/src/xyz2grd.py index 83bccb2e305..3aa329a7710 100644 --- a/pygmt/src/xyz2grd.py +++ b/pygmt/src/xyz2grd.py @@ -66,7 +66,7 @@ def xyz2grd( providing a file name to an ASCII data table, a 2-D {table-classes}. x/y/z : 1-D arrays The arrays of x and y coordinates and z data points. - {outgrid} + $outgrid duplicate : str [**d**\|\ **f**\|\ **l**\|\ **m**\|\ **n**\|\ **r**\|\ **S**\|\ **s**\|\ **u**\|\ **z**]. @@ -82,10 +82,10 @@ def xyz2grd( that were assigned to each node (this only requires two input columns *x* and *y* as *z* is not consulted). Append **z** to sum multiple values that belong to the same node. - {spacing} - {projection} - {region} - {verbose} + $spacing + $projection + $region + $verbose convention : str [*flags*]. Read a 1-column ASCII [or binary] table. This assumes that all the @@ -126,14 +126,14 @@ 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. - {binary} - {nodata} - {find} - {coltypes} - {header} - {incols} - {registration} - {wrap} + $binary + $nodata + $find + $coltypes + $header + $incols + $registration + $wrap Returns ------- From b4284915bd589671aa333f83ade999dbf0592aed Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Sat, 15 Nov 2025 19:16:49 +0800 Subject: [PATCH 3/5] Update {aliases} to $aliases and {table-classes} to $table_classes --- pygmt/helpers/decorators.py | 10 +++++----- pygmt/src/basemap.py | 2 +- pygmt/src/binstats.py | 4 ++-- pygmt/src/blockm.py | 12 ++++++------ pygmt/src/coast.py | 2 +- pygmt/src/colorbar.py | 2 +- pygmt/src/contour.py | 4 ++-- pygmt/src/dimfilter.py | 2 +- pygmt/src/filter1d.py | 2 +- pygmt/src/grd2cpt.py | 2 +- pygmt/src/grd2xyz.py | 2 +- pygmt/src/grdcontour.py | 2 +- pygmt/src/grdcut.py | 2 +- pygmt/src/grdfill.py | 2 +- pygmt/src/grdfilter.py | 2 +- pygmt/src/grdgradient.py | 2 +- pygmt/src/grdhisteq.py | 4 ++-- pygmt/src/grdimage.py | 2 +- pygmt/src/grdinfo.py | 2 +- pygmt/src/grdlandmask.py | 2 +- pygmt/src/grdproject.py | 2 +- pygmt/src/grdsample.py | 2 +- pygmt/src/grdtrack.py | 4 ++-- pygmt/src/grdview.py | 2 +- pygmt/src/grdvolume.py | 2 +- pygmt/src/histogram.py | 4 ++-- pygmt/src/image.py | 2 +- pygmt/src/info.py | 4 ++-- pygmt/src/inset.py | 2 +- pygmt/src/legend.py | 2 +- pygmt/src/logo.py | 2 +- pygmt/src/makecpt.py | 2 +- pygmt/src/meca.py | 2 +- pygmt/src/nearneighbor.py | 4 ++-- pygmt/src/plot.py | 4 ++-- pygmt/src/plot3d.py | 4 ++-- pygmt/src/project.py | 4 ++-- pygmt/src/psconvert.py | 2 +- pygmt/src/rose.py | 4 ++-- pygmt/src/select.py | 4 ++-- pygmt/src/sph2grd.py | 4 ++-- pygmt/src/sphdistance.py | 4 ++-- pygmt/src/sphinterpolate.py | 4 ++-- pygmt/src/subplot.py | 4 ++-- pygmt/src/surface.py | 4 ++-- pygmt/src/ternary.py | 4 ++-- pygmt/src/text.py | 2 +- pygmt/src/tilemap.py | 2 +- pygmt/src/triangulate.py | 8 ++++---- pygmt/src/velo.py | 4 ++-- pygmt/src/which.py | 2 +- pygmt/src/wiggle.py | 4 ++-- pygmt/src/x2sys_cross.py | 2 +- pygmt/src/x2sys_init.py | 2 +- pygmt/src/xyz2grd.py | 4 ++-- 55 files changed, 88 insertions(+), 88 deletions(-) diff --git a/pygmt/helpers/decorators.py b/pygmt/helpers/decorators.py index 466ba532ca7..a1e70a94845 100644 --- a/pygmt/helpers/decorators.py +++ b/pygmt/helpers/decorators.py @@ -407,11 +407,11 @@ def fmt_docstring(module_func): ... ---------- ... data ... Pass in either a file name to an ASCII data table, a 2-D - ... {table-classes}. - ... {region} - ... {projection} + ... $table_classes. + ... $region + ... $projection ... - ... {aliases} + ... $aliases ... ''' ... pass >>> print(gmtinfo.__doc__) @@ -453,7 +453,7 @@ def fmt_docstring(module_func): aliases.append(f" - {arg} = {alias}") filler_text["aliases"] = "\n".join(aliases) - filler_text["table-classes"] = ( + filler_text["table_classes"] = ( ":class:`numpy.ndarray`, a :class:`pandas.DataFrame`, an\n" " :class:`xarray.Dataset` made up of 1-D :class:`xarray.DataArray`\n" " data variables, or a :class:`geopandas.GeoDataFrame` containing the\n" diff --git a/pygmt/src/basemap.py b/pygmt/src/basemap.py index bd1b3f9a30f..8c264f4f3e5 100644 --- a/pygmt/src/basemap.py +++ b/pygmt/src/basemap.py @@ -45,7 +45,7 @@ def basemap( Full GMT docs at :gmt-docs:`basemap.html`. - {aliases} + $aliases - B = frame - J = projection - Jz = zscale diff --git a/pygmt/src/binstats.py b/pygmt/src/binstats.py index 914af4faf72..2ba98a2e1b3 100644 --- a/pygmt/src/binstats.py +++ b/pygmt/src/binstats.py @@ -66,7 +66,7 @@ def binstats( Full GMT docs at :gmt-docs:`gmtbinstats.html`. - {aliases} + $aliases - C = statistic - R = region - V = verbose @@ -75,7 +75,7 @@ def binstats( Parameters ---------- data - A file name of an ASCII data table or a 2-D {table-classes}. + A file name of an ASCII data table or a 2-D $table_classes. $outgrid statistic Choose the statistic that will be computed per node based on the points that are diff --git a/pygmt/src/blockm.py b/pygmt/src/blockm.py index a9fe4a7fdfc..87191d7326e 100644 --- a/pygmt/src/blockm.py +++ b/pygmt/src/blockm.py @@ -113,7 +113,7 @@ def blockmean( Full GMT docs at :gmt-docs:`blockmean.html`. - {aliases} + $aliases - R = region - V = verbose - r = registration @@ -123,7 +123,7 @@ def blockmean( data 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}. + $table_classes. x/y/z : 1-D arrays Arrays of x and y coordinates and values z of the data points. $output_type @@ -228,7 +228,7 @@ def blockmedian( Full GMT docs at :gmt-docs:`blockmedian.html`. - {aliases} + $aliases - R = region - V = verbose - r = registration @@ -238,7 +238,7 @@ def blockmedian( data 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}. + $table_classes. x/y/z : 1-D arrays Arrays of x and y coordinates and values z of the data points. $output_type @@ -337,7 +337,7 @@ def blockmode( Full GMT docs at :gmt-docs:`blockmode.html`. - {aliases} + $aliases - R = region - V = verbose - r = registration @@ -347,7 +347,7 @@ def blockmode( data 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}. + $table_classes. x/y/z : 1-D arrays Arrays of x and y coordinates and values z of the data points. $output_type diff --git a/pygmt/src/coast.py b/pygmt/src/coast.py index ca9b03c2576..ae6efb3e0bb 100644 --- a/pygmt/src/coast.py +++ b/pygmt/src/coast.py @@ -66,7 +66,7 @@ def coast( Full GMT docs at :gmt-docs:`coast.html`. - {aliases} + $aliases - B = frame - D = resolution - F = box diff --git a/pygmt/src/colorbar.py b/pygmt/src/colorbar.py index e1840a11312..eeb5c5b570a 100644 --- a/pygmt/src/colorbar.py +++ b/pygmt/src/colorbar.py @@ -56,7 +56,7 @@ def colorbar( Full GMT docs at :gmt-docs:`colorbar.html`. - {aliases} + $aliases - B = frame - F = box - I = shading diff --git a/pygmt/src/contour.py b/pygmt/src/contour.py index b8d76b8f963..f01ebb5d703 100644 --- a/pygmt/src/contour.py +++ b/pygmt/src/contour.py @@ -61,7 +61,7 @@ def contour( # noqa: PLR0913 Full GMT docs at :gmt-docs:`contour.html`. - {aliases} + $aliases - B = frame - J = projection - N = no_clip @@ -76,7 +76,7 @@ def contour( # noqa: PLR0913 data 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}. + $table_classes. x/y/z : 1-D arrays Arrays of x and y coordinates and values z of the data points. $projection diff --git a/pygmt/src/dimfilter.py b/pygmt/src/dimfilter.py index cc35c515d2b..704c92ee18b 100644 --- a/pygmt/src/dimfilter.py +++ b/pygmt/src/dimfilter.py @@ -47,7 +47,7 @@ def dimfilter( Full GMT docs at :gmt-docs:`dimfilter.html`. - {aliases} + $aliases - R = region - V = verbose diff --git a/pygmt/src/filter1d.py b/pygmt/src/filter1d.py index dc1abc7a5b5..edad413c990 100644 --- a/pygmt/src/filter1d.py +++ b/pygmt/src/filter1d.py @@ -41,7 +41,7 @@ def filter1d( Full GMT docs at :gmt-docs:`filter1d.html`. - {aliases} + $aliases - V = verbose Parameters diff --git a/pygmt/src/grd2cpt.py b/pygmt/src/grd2cpt.py index 416a58539a6..964a25de64e 100644 --- a/pygmt/src/grd2cpt.py +++ b/pygmt/src/grd2cpt.py @@ -85,7 +85,7 @@ def grd2cpt( Full GMT docs at :gmt-docs:`grd2cpt.html`. - {aliases} + $aliases - G = truncate - M = overrule_bg - N = no_bg diff --git a/pygmt/src/grd2xyz.py b/pygmt/src/grd2xyz.py index 288f7e0176f..20988d96724 100644 --- a/pygmt/src/grd2xyz.py +++ b/pygmt/src/grd2xyz.py @@ -53,7 +53,7 @@ def grd2xyz( Full GMT docs at :gmt-docs:`grd2xyz.html`. - {aliases} + $aliases - R = region - V = verbose diff --git a/pygmt/src/grdcontour.py b/pygmt/src/grdcontour.py index 709d96c6a92..fada25fddc4 100644 --- a/pygmt/src/grdcontour.py +++ b/pygmt/src/grdcontour.py @@ -55,7 +55,7 @@ def grdcontour( Full GMT docs at :gmt-docs:`grdcontour.html`. - {aliases} + $aliases - B = frame - J = projection - R = region diff --git a/pygmt/src/grdcut.py b/pygmt/src/grdcut.py index 1687570ddf1..3b7bdfd9455 100644 --- a/pygmt/src/grdcut.py +++ b/pygmt/src/grdcut.py @@ -46,7 +46,7 @@ def grdcut( Full GMT docs at :gmt-docs:`grdcut.html`. - {aliases} + $aliases - J = projection - R = region - V = verbose diff --git a/pygmt/src/grdfill.py b/pygmt/src/grdfill.py index 7c60398d4bb..8e404573146 100644 --- a/pygmt/src/grdfill.py +++ b/pygmt/src/grdfill.py @@ -99,7 +99,7 @@ def grdfill( # noqa: PLR0913 Full GMT docs at :gmt-docs:`grdfill.html`. - {aliases} + $aliases - Ac = constantfill - Ag = gridfill - An = neighborfill diff --git a/pygmt/src/grdfilter.py b/pygmt/src/grdfilter.py index ce82564d8d7..96e0dbd0f48 100644 --- a/pygmt/src/grdfilter.py +++ b/pygmt/src/grdfilter.py @@ -41,7 +41,7 @@ def grdfilter( Full GMT docs at :gmt-docs:`grdfilter.html`. - {aliases} + $aliases - R = region - T = toggle - V = verbose diff --git a/pygmt/src/grdgradient.py b/pygmt/src/grdgradient.py index 93f8356ce5a..98846e1013e 100644 --- a/pygmt/src/grdgradient.py +++ b/pygmt/src/grdgradient.py @@ -49,7 +49,7 @@ def grdgradient( Full GMT docs at :gmt-docs:`grdgradient.html`. - {aliases} + $aliases - R = region - V = verbose diff --git a/pygmt/src/grdhisteq.py b/pygmt/src/grdhisteq.py index bd5c542bb2e..a92adade6bf 100644 --- a/pygmt/src/grdhisteq.py +++ b/pygmt/src/grdhisteq.py @@ -77,7 +77,7 @@ def equalize_grid( Full GMT docs at :gmt-docs:`grdhisteq.html`. - {aliases} + $aliases - R = region - V = verbose @@ -175,7 +175,7 @@ def compute_bins( Full GMT docs at :gmt-docs:`grdhisteq.html`. - {aliases} + $aliases - R = region - V = verbose diff --git a/pygmt/src/grdimage.py b/pygmt/src/grdimage.py index 1d2b6106034..563872fe775 100644 --- a/pygmt/src/grdimage.py +++ b/pygmt/src/grdimage.py @@ -74,7 +74,7 @@ def grdimage( # noqa: PLR0913 Full GMT docs at :gmt-docs:`grdimage.html`. - {aliases} + $aliases - B = frame - J = projection - M = monochrome diff --git a/pygmt/src/grdinfo.py b/pygmt/src/grdinfo.py index c1224a74f62..9be58e2d931 100644 --- a/pygmt/src/grdinfo.py +++ b/pygmt/src/grdinfo.py @@ -44,7 +44,7 @@ def grdinfo( Full GMT docs at :gmt-docs:`grdinfo.html`. - {aliases} + $aliases - R = region - V = verbose diff --git a/pygmt/src/grdlandmask.py b/pygmt/src/grdlandmask.py index e7975c969f1..ec364e4bc8d 100644 --- a/pygmt/src/grdlandmask.py +++ b/pygmt/src/grdlandmask.py @@ -43,7 +43,7 @@ def grdlandmask( Full GMT docs at :gmt-docs:`grdlandmask.html`. - {aliases} + $aliases - D = resolution - E = bordervalues - N = maskvalues diff --git a/pygmt/src/grdproject.py b/pygmt/src/grdproject.py index 0ac81f57b63..4060afbcca4 100644 --- a/pygmt/src/grdproject.py +++ b/pygmt/src/grdproject.py @@ -56,7 +56,7 @@ def grdproject( Full GMT docs at :gmt-docs:`grdproject.html`. - {aliases} + $aliases - C = center - J = projection - R = region diff --git a/pygmt/src/grdsample.py b/pygmt/src/grdsample.py index e9ee3ad7f6d..f87353100fe 100644 --- a/pygmt/src/grdsample.py +++ b/pygmt/src/grdsample.py @@ -55,7 +55,7 @@ def grdsample( Full GMT docs at :gmt-docs:`grdsample.html`. - {aliases} + $aliases - R = region - V = verbose - r = registration diff --git a/pygmt/src/grdtrack.py b/pygmt/src/grdtrack.py index fb257cc6e0a..674ff748df2 100644 --- a/pygmt/src/grdtrack.py +++ b/pygmt/src/grdtrack.py @@ -79,7 +79,7 @@ def grdtrack( Full GMT docs at :gmt-docs:`grdtrack.html`. - {aliases} + $aliases - R = region - V = verbose @@ -89,7 +89,7 @@ def grdtrack( points Pass in either a file name to an ASCII data table, a 2-D - {table-classes}. + $table_classes. $output_type $outfile newcolname : str diff --git a/pygmt/src/grdview.py b/pygmt/src/grdview.py index caedd485c86..06b5ef1ab55 100644 --- a/pygmt/src/grdview.py +++ b/pygmt/src/grdview.py @@ -53,7 +53,7 @@ def grdview( # noqa: PLR0913 Full GMT docs at :gmt-docs:`grdview.html`. - {aliases} + $aliases - B = frame - J = projection - Jz = zscale diff --git a/pygmt/src/grdvolume.py b/pygmt/src/grdvolume.py index f7bf485f5c6..c8470297b57 100644 --- a/pygmt/src/grdvolume.py +++ b/pygmt/src/grdvolume.py @@ -45,7 +45,7 @@ def grdvolume( Full GMT docs at :gmt-docs:`grdvolume.html`. - {aliases} + $aliases - R = region - V = verbose diff --git a/pygmt/src/histogram.py b/pygmt/src/histogram.py index 19be328390b..a7277ed678e 100644 --- a/pygmt/src/histogram.py +++ b/pygmt/src/histogram.py @@ -53,7 +53,7 @@ def histogram( Full GMT docs at :gmt-docs:`histogram.html`. - {aliases} + $aliases - B = frame - J = projection - R = region @@ -66,7 +66,7 @@ def histogram( ---------- data Pass in either a file name to an ASCII data table, a Python list, a 2-D - {table-classes}. + $table_classes. $projection $region $frame diff --git a/pygmt/src/image.py b/pygmt/src/image.py index cdaf5167b96..d389e7477d9 100644 --- a/pygmt/src/image.py +++ b/pygmt/src/image.py @@ -46,7 +46,7 @@ def image( Full GMT docs at :gmt-docs:`image.html`. - {aliases} + $aliases - F = box - J = projection - M = monochrome diff --git a/pygmt/src/info.py b/pygmt/src/info.py index 76122446c1b..032d6ecdc07 100644 --- a/pygmt/src/info.py +++ b/pygmt/src/info.py @@ -52,7 +52,7 @@ def info( Full GMT docs at :gmt-docs:`gmtinfo.html`. - {aliases} + $aliases - V = verbose - r = registration @@ -60,7 +60,7 @@ def info( ---------- data Pass in either a file name to an ASCII data table, a 1-D/2-D - {table-classes}. + $table_classes. per_column : bool Report the min/max values per column in separate columns. spacing : str diff --git a/pygmt/src/inset.py b/pygmt/src/inset.py index 394d73b648c..18f33efe4d0 100644 --- a/pygmt/src/inset.py +++ b/pygmt/src/inset.py @@ -37,7 +37,7 @@ def inset( Full GMT docs at :gmt-docs:`inset.html`. - {aliases} + $aliases - F = box - J = projection - N = no_clip diff --git a/pygmt/src/legend.py b/pygmt/src/legend.py index bc8c3847a70..6f5be423489 100644 --- a/pygmt/src/legend.py +++ b/pygmt/src/legend.py @@ -47,7 +47,7 @@ def legend( Full GMT docs at :gmt-docs:`legend.html`. - {aliases} + $aliases - F = box - J = projection - R = region diff --git a/pygmt/src/logo.py b/pygmt/src/logo.py index 74f9c5bac9a..0087a7dddec 100644 --- a/pygmt/src/logo.py +++ b/pygmt/src/logo.py @@ -36,7 +36,7 @@ def logo( Full GMT docs at :gmt-docs:`gmtlogo.html`. - {aliases} + $aliases - F = box - J = projection - R = region diff --git a/pygmt/src/makecpt.py b/pygmt/src/makecpt.py index 04ece3d4762..b2c36405840 100644 --- a/pygmt/src/makecpt.py +++ b/pygmt/src/makecpt.py @@ -73,7 +73,7 @@ def makecpt( Full GMT docs at :gmt-docs:`makecpt.html`. - {aliases} + $aliases - G = truncate - M = overrule_bg - N = no_bg diff --git a/pygmt/src/meca.py b/pygmt/src/meca.py index b8631f15197..8a047fc06b3 100644 --- a/pygmt/src/meca.py +++ b/pygmt/src/meca.py @@ -199,7 +199,7 @@ def meca( # noqa: PLR0913 Full GMT docs at :gmt-docs:`supplements/seis/meca.html`. - {aliases} + $aliases - B = frame - J = projection - N = no_clip diff --git a/pygmt/src/nearneighbor.py b/pygmt/src/nearneighbor.py index 524680f7b42..ed69a87bb95 100644 --- a/pygmt/src/nearneighbor.py +++ b/pygmt/src/nearneighbor.py @@ -79,7 +79,7 @@ def nearneighbor( Full GMT docs at :gmt-docs:`nearneighbor.html`. - {aliases} + $aliases - R = region - V = verbose - r = registration @@ -89,7 +89,7 @@ def nearneighbor( data 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}. + $table_classes. x/y/z : 1-D arrays Arrays of x and y coordinates and values z of the data points. diff --git a/pygmt/src/plot.py b/pygmt/src/plot.py index 5562ae45a62..5befabf9a68 100644 --- a/pygmt/src/plot.py +++ b/pygmt/src/plot.py @@ -87,7 +87,7 @@ def plot( # noqa: PLR0912, PLR0913 Full GMT docs at :gmt-docs:`plot.html`. - {aliases} + $aliases - A = straight_line - B = frame - J = projection @@ -101,7 +101,7 @@ def plot( # noqa: PLR0912, PLR0913 ---------- data Pass in either a file name to an ASCII data table, a 2-D - {table-classes}. + $table_classes. Use parameter ``incols`` to choose which columns are x, y, fill, and size, respectively. x/y : float or 1-D arrays diff --git a/pygmt/src/plot3d.py b/pygmt/src/plot3d.py index 8400eb880b4..6021c348123 100644 --- a/pygmt/src/plot3d.py +++ b/pygmt/src/plot3d.py @@ -89,7 +89,7 @@ def plot3d( # noqa: PLR0912, PLR0913 Full GMT docs at :gmt-docs:`plot3d.html`. - {aliases} + $aliases - A = straight_line - B = frame - J = projection @@ -104,7 +104,7 @@ def plot3d( # noqa: PLR0912, PLR0913 Parameters ---------- data - Either a data file name, a 2-D {table-classes}. + Either a data file name, a 2-D $table_classes. Optionally, use parameter ``incols`` to specify which columns are x, y, z, fill, and size, respectively. x/y/z : float or 1-D arrays diff --git a/pygmt/src/project.py b/pygmt/src/project.py index f299b732e46..a30c56504a2 100644 --- a/pygmt/src/project.py +++ b/pygmt/src/project.py @@ -110,7 +110,7 @@ def project( # noqa: PLR0913 Full GMT docs at :gmt-docs:`project.html`. - {aliases} + $aliases - C = center - E = endpoint - L = length @@ -123,7 +123,7 @@ def project( # noqa: PLR0913 data 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}. + $table_classes. $output_type $outfile diff --git a/pygmt/src/psconvert.py b/pygmt/src/psconvert.py index d59cb0ec295..6d486d9f277 100644 --- a/pygmt/src/psconvert.py +++ b/pygmt/src/psconvert.py @@ -36,7 +36,7 @@ def psconvert( Full GMT docs at :gmt-docs:`psconvert.html`. - {aliases} + $aliases - C = gs_option - E = dpi - F = prefix diff --git a/pygmt/src/rose.py b/pygmt/src/rose.py index 992bd687e48..0b72a4f1a97 100644 --- a/pygmt/src/rose.py +++ b/pygmt/src/rose.py @@ -65,7 +65,7 @@ def rose( Full GMT docs at :gmt-docs:`rose.html`. - {aliases} + $aliases - B = frame - R = region - V = verbose @@ -77,7 +77,7 @@ def rose( ---------- data Pass in either a file name to an ASCII data table, a 2-D - {table-classes}. + $table_classes. Use parameter ``incols`` to choose which columns are length and azimuth, respectively. If a file with only azimuths is given, use ``incols`` to indicate the single column with azimuths; then all diff --git a/pygmt/src/select.py b/pygmt/src/select.py index f463df602af..45e75d0731d 100644 --- a/pygmt/src/select.py +++ b/pygmt/src/select.py @@ -77,7 +77,7 @@ def select( Full GMT docs at :gmt-docs:`gmtselect.html`. - {aliases} + $aliases - D = resolution - J = projection - R = region @@ -87,7 +87,7 @@ def select( ---------- data Pass in either a file name to an ASCII data table, a 2-D - {table-classes}. + $table_classes. $output_type $outfile $area_thresh diff --git a/pygmt/src/sph2grd.py b/pygmt/src/sph2grd.py index f2b6d28311b..dad12e1a520 100644 --- a/pygmt/src/sph2grd.py +++ b/pygmt/src/sph2grd.py @@ -36,7 +36,7 @@ def sph2grd( Full GMT docs at :gmt-docs:`sph2grd.html`. - {aliases} + $aliases - R = region - V = verbose - r = registration @@ -47,7 +47,7 @@ def sph2grd( data Pass in data with L, M, C[L,M], S[L,M] values by providing a file name to an ASCII data table, a 2-D - {table-classes}. + $table_classes. $outgrid $spacing $region diff --git a/pygmt/src/sphdistance.py b/pygmt/src/sphdistance.py index 3da03a7d25b..aa86c627dc5 100644 --- a/pygmt/src/sphdistance.py +++ b/pygmt/src/sphdistance.py @@ -47,7 +47,7 @@ def sphdistance( Full GMT docs at :gmt-docs:`sphdistance.html`. - {aliases} + $aliases - R = region - V = verbose @@ -56,7 +56,7 @@ def sphdistance( data Pass in (x, y) or (longitude, latitude) values by providing a file name to an ASCII data table, a 2-D - {table-classes}. + $table_classes. x/y : 1-D arrays Arrays of x and y coordinates. $outgrid diff --git a/pygmt/src/sphinterpolate.py b/pygmt/src/sphinterpolate.py index fe09fa60311..c94cb0eed95 100644 --- a/pygmt/src/sphinterpolate.py +++ b/pygmt/src/sphinterpolate.py @@ -36,7 +36,7 @@ def sphinterpolate( Full GMT docs at :gmt-docs:`sphinterpolate.html`. - {aliases} + $aliases - R = region - V = verbose @@ -45,7 +45,7 @@ def sphinterpolate( data 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}. + $table_classes. $outgrid $spacing $region diff --git a/pygmt/src/subplot.py b/pygmt/src/subplot.py index 337f26ba689..4df32ed38fb 100644 --- a/pygmt/src/subplot.py +++ b/pygmt/src/subplot.py @@ -52,7 +52,7 @@ def subplot( Full GMT docs at :gmt-docs:`subplot.html#synopsis-begin-mode`. - {aliases} + $aliases - B = frame - J = projection - M = margins @@ -223,7 +223,7 @@ def set_panel( both dimensions then you must specify ``projection="x"`` [The default ``projection="X"`` will fill the subplot by using unequal scales]. - {aliases} + $aliases - V = verbose Parameters diff --git a/pygmt/src/surface.py b/pygmt/src/surface.py index 58488b1b4e2..ceea5202ce8 100644 --- a/pygmt/src/surface.py +++ b/pygmt/src/surface.py @@ -76,7 +76,7 @@ def surface( Full GMT docs at :gmt-docs:`surface.html`. - {aliases} + $aliases - R = region - V = verbose - r = registration @@ -86,7 +86,7 @@ def surface( data 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}. + $table_classes. x/y/z : 1-D arrays Arrays of x and y coordinates and values z of the data points. diff --git a/pygmt/src/ternary.py b/pygmt/src/ternary.py index cc0edc14534..9f2adc41051 100644 --- a/pygmt/src/ternary.py +++ b/pygmt/src/ternary.py @@ -41,7 +41,7 @@ def ternary( # noqa: PLR0913 Full GMT docs at :gmt-docs:`ternary.html`. - {aliases} + $aliases - B = frame - L = alabel/blabel/clabel - R = region @@ -54,7 +54,7 @@ def ternary( # noqa: PLR0913 ---------- data Pass in either a file name to an ASCII data table, a Python list, a 2-D - {table-classes}. + $table_classes. width : str Set the width of the figure by passing a number, followed by a unit (**i** for inches, **c** for centimeters). Use a negative width diff --git a/pygmt/src/text.py b/pygmt/src/text.py index 2180bf1748d..156dd616a92 100644 --- a/pygmt/src/text.py +++ b/pygmt/src/text.py @@ -71,7 +71,7 @@ def text_( # noqa: PLR0912, PLR0913, PLR0915 Full GMT docs at :gmt-docs:`text.html`. - {aliases} + $aliases - B = frame - F = **+a**: angle, **+c**: position, **+j**: justify, **+f**: font - J = projection diff --git a/pygmt/src/tilemap.py b/pygmt/src/tilemap.py index d1484f7e410..85d1cf0bdeb 100644 --- a/pygmt/src/tilemap.py +++ b/pygmt/src/tilemap.py @@ -52,7 +52,7 @@ def tilemap( # noqa: PLR0913 ``lonlat=True``. If reprojection is not desired, please set ``lonlat=False`` and provide Spherical Mercator (EPSG:3857) coordinates to the ``region`` parameter. - {aliases} + $aliases - B = frame - J = projection - M = monochrome diff --git a/pygmt/src/triangulate.py b/pygmt/src/triangulate.py index 877c8fdf966..02e66229d4c 100644 --- a/pygmt/src/triangulate.py +++ b/pygmt/src/triangulate.py @@ -101,7 +101,7 @@ def regular_grid( Full GMT docs at :gmt-docs:`triangulate.html`. - {aliases} + $aliases - J = projection - R = region - V = verbose @@ -114,7 +114,7 @@ def regular_grid( data 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}. + $table_classes. $projection $region $spacing @@ -218,7 +218,7 @@ def delaunay_triples( Full GMT docs at :gmt-docs:`triangulate.html` - {aliases} + $aliases - J = projection - R = region - V = verbose @@ -231,7 +231,7 @@ def delaunay_triples( data 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}. + $table_classes. $projection $region $output_type diff --git a/pygmt/src/velo.py b/pygmt/src/velo.py index 67db7d0ee02..ce120057e06 100644 --- a/pygmt/src/velo.py +++ b/pygmt/src/velo.py @@ -61,7 +61,7 @@ def velo( Full GMT docs at :gmt-docs:`supplements/geodesy/velo.html`. - {aliases} + $aliases - B = frame - J = projection - N = no_clip @@ -75,7 +75,7 @@ def velo( ---------- data Pass in either a file name to an ASCII data table, a 2-D - {table-classes}. + $table_classes. Note that text columns are only supported with file or :class:`pandas.DataFrame` inputs. diff --git a/pygmt/src/which.py b/pygmt/src/which.py index d4facbceba6..4790a3bd510 100644 --- a/pygmt/src/which.py +++ b/pygmt/src/which.py @@ -36,7 +36,7 @@ def which( Full GMT docs at :gmt-docs:`gmtwhich.html`. - {aliases} + $aliases - V = verbose Parameters diff --git a/pygmt/src/wiggle.py b/pygmt/src/wiggle.py index b2aff053fbd..f9e3fb3dfd0 100644 --- a/pygmt/src/wiggle.py +++ b/pygmt/src/wiggle.py @@ -82,7 +82,7 @@ def wiggle( # noqa: PLR0913 Full GMT docs at :gmt-docs:`wiggle.html`. - {aliases} + $aliases - B = frame - G = **+p**: fillpositive, **+n**: fillnegative - J = projection @@ -98,7 +98,7 @@ def wiggle( # noqa: PLR0913 The arrays of x and y coordinates and z data points. data Pass in either a file name to an ASCII data table, a 2-D - {table-classes}. + $table_classes. Use parameter ``incols`` to choose which columns are x, y, z, respectively. $projection diff --git a/pygmt/src/x2sys_cross.py b/pygmt/src/x2sys_cross.py index dde45bb7cc4..f7b8d91c283 100644 --- a/pygmt/src/x2sys_cross.py +++ b/pygmt/src/x2sys_cross.py @@ -90,7 +90,7 @@ def x2sys_cross( Full GMT docs at :gmt-docs:`supplements/x2sys/x2sys_cross.html`. - {aliases} + $aliases - R = region - V = verbose diff --git a/pygmt/src/x2sys_init.py b/pygmt/src/x2sys_init.py index f510811ffc6..41cee96b704 100644 --- a/pygmt/src/x2sys_init.py +++ b/pygmt/src/x2sys_init.py @@ -44,7 +44,7 @@ def x2sys_init( Full GMT docs at :gmt-docs:`supplements/x2sys/x2sys_init.html`. - {aliases} + $aliases - R = region - V = verbose diff --git a/pygmt/src/xyz2grd.py b/pygmt/src/xyz2grd.py index 3aa329a7710..09015c42564 100644 --- a/pygmt/src/xyz2grd.py +++ b/pygmt/src/xyz2grd.py @@ -53,7 +53,7 @@ def xyz2grd( Full GMT docs at :gmt-docs:`xyz2grd.html`. - {aliases} + $aliases - J = projection - R = region - V = verbose @@ -63,7 +63,7 @@ def xyz2grd( ---------- data 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}. + providing a file name to an ASCII data table, a 2-D $table_classes. x/y/z : 1-D arrays The arrays of x and y coordinates and z data points. $outgrid From 99dd6e857ca4dc8b6f2880c394dfd1a44668835e Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Sat, 15 Nov 2025 19:19:08 +0800 Subject: [PATCH 4/5] Replace {{/}} with {/} in LaTeX math equations --- pygmt/src/colorbar.py | 2 +- pygmt/src/grdfill.py | 4 ++-- pygmt/src/grdgradient.py | 20 ++++++++++---------- pygmt/src/meca.py | 6 +++--- pygmt/src/nearneighbor.py | 6 +++--- pygmt/src/project.py | 16 ++++++++-------- pygmt/src/surface.py | 2 +- pygmt/src/tilemap.py | 4 ++-- 8 files changed, 30 insertions(+), 30 deletions(-) diff --git a/pygmt/src/colorbar.py b/pygmt/src/colorbar.py index eeb5c5b570a..9b9827d8fda 100644 --- a/pygmt/src/colorbar.py +++ b/pygmt/src/colorbar.py @@ -46,7 +46,7 @@ def colorbar( .. note:: For GMT >=6.5.0, the fontsizes of the colorbar x-label, x-annotations, and y-label are scaled based on the width of the colorbar following - :math:`\sqrt{{colorbar\_width / 15}}`. To set a desired fontsize via the + :math:`\sqrt{colorbar\_width / 15}`. To set a desired fontsize via the GMT default parameters :gmt-term:`FONT_ANNOT_PRIMARY`, :gmt-term:`FONT_ANNOT_SECONDARY`, and :gmt-term:`FONT_LABEL` (or jointly :gmt-term:`FONT`) users have to divide the desired fontsize by the value diff --git a/pygmt/src/grdfill.py b/pygmt/src/grdfill.py index 8e404573146..ac08f368f59 100644 --- a/pygmt/src/grdfill.py +++ b/pygmt/src/grdfill.py @@ -121,7 +121,7 @@ def grdfill( # noqa: PLR0913 neighborfill Fill the holes with the nearest neighbor. Specify the search radius in pixels. If set to ``True``, the default search radius will be used - (:math:`r^2 = \sqrt{{n^2 + m^2}}`, where (*n,m*) are the node dimensions of the + (:math:`r^2 = \sqrt{n^2 + m^2}`, where (*n,m*) are the node dimensions of the grid). splinefill Fill the holes with a bicubic spline. Specify the tension value to use. If set @@ -136,7 +136,7 @@ def grdfill( # noqa: PLR0913 mode Specify the hole-filling algorithm to use. Choose from **c** for constant fill and append the constant value, **n** for nearest neighbor (and optionally append - a search radius in pixels [default radius is :math:`r^2 = \sqrt{{ X^2 + Y^2 }}`, + a search radius in pixels [default radius is :math:`r^2 = \sqrt{ X^2 + Y^2 }`, where (*X,Y*) are the node dimensions of the grid]), or **s** for bicubic spline (optionally append a *tension* parameter [Default is no tension]). diff --git a/pygmt/src/grdgradient.py b/pygmt/src/grdgradient.py index 98846e1013e..0bac2093568 100644 --- a/pygmt/src/grdgradient.py +++ b/pygmt/src/grdgradient.py @@ -63,8 +63,8 @@ def grdgradient( angle in the x,y plane measured in degrees positive clockwise from north (the positive y-direction) toward east (the positive x-direction). The negative of the directional derivative, - :math:`-(\frac{{dz}}{{dx}}\sin(\mbox{{azim}}) + \ - \frac{{dz}}{{dy}}\cos(\mbox{{azim}}))`, is found; negation yields + :math:`-(\frac{dz}{dx}\sin(\mbox{azim}) + \ + \frac{dz}{dy}\cos(\mbox{azim}))`, is found; negation yields positive values when the slope of :math:`z(x,y)` is downhill in the *azim* direction, the correct sense for shading the illumination of an image by a light source above the x,y plane shining from the *azim* @@ -114,18 +114,18 @@ def grdgradient( given, it is set to the average of :math:`g`. The following forms are supported: - - **True**: Normalize using :math:`g_n = \mbox{{amp}}\ - (\frac{{g - \mbox{{offset}}}}{{max(|g - \mbox{{offset}}|)}})` + - **True**: Normalize using :math:`g_n = \mbox{amp}\ + (\frac{g - \mbox{offset}{max(|g - \mbox{offset}|)})` - **e**: Normalize using a cumulative Laplace distribution yielding: - :math:`g_n = \mbox{{amp}}(1 - \ - \exp{{(\sqrt{{2}}\frac{{g - \mbox{{offset}}}}{{\sigma}}))}}`, where + :math:`g_n = \mbox{amp}(1 - \ + \exp{(\sqrt{2}\frac{g - \mbox{offset}{\sigma}))}`, where :math:`\sigma` is estimated using the L1 norm of - :math:`(g - \mbox{{offset}})` if it is not given. + :math:`(g - \mbox{offset})` if it is not given. - **t**: Normalize using a cumulative Cauchy distribution yielding: :math:`g_n = \ - \frac{{2(\mbox{{amp}})}}{{\pi}}(\tan^{{-1}}(\frac{{g - \ - \mbox{{offset}}}}{{\sigma}}))` where :math:`\sigma` is estimated - using the L2 norm of :math:`(g - \mbox{{offset}})` if it is not + \frac{2(\mbox{amp})}{\pi}(\tan^{-1}(\frac{g - \ + \mbox{offset}{\sigma}))` where :math:`\sigma` is estimated + using the L2 norm of :math:`(g - \mbox{offset})` if it is not given. As a final option, you may add **+a**\ *ambient* to add *ambient* to diff --git a/pygmt/src/meca.py b/pygmt/src/meca.py index 8a047fc06b3..b9f9c956aa4 100644 --- a/pygmt/src/meca.py +++ b/pygmt/src/meca.py @@ -172,7 +172,7 @@ def meca( # noqa: PLR0913 | *mantissa*, *exponent* - | angles in degrees; | seismic moment is - | :math:`mantissa * 10 ^ {{exponent}}` + | :math:`mantissa * 10 ^ {exponent}` | in dyn cm * - ``"mt"`` - seismic moment tensor @@ -180,7 +180,7 @@ def meca( # noqa: PLR0913 | *mrt*, *mrf*, *mtf*, | *exponent* - | moment components - | in :math:`10 ^ {{exponent}}` dyn cm + | in :math:`10 ^ {exponent}` dyn cm * - ``"partial"`` - partial focal mechanism - | *strike1*, *dip1*, *strike2*, @@ -194,7 +194,7 @@ def meca( # noqa: PLR0913 | *n_value*, *n_azimuth*, *n_plunge*, | *p_value*, *p_azimuth*, *p_plunge*, | *exponent* - - | values in :math:`10 ^ {{exponent}}` dyn cm; + - | values in :math:`10 ^ {exponent}` dyn cm; | azimuths and plunges in degrees Full GMT docs at :gmt-docs:`supplements/seis/meca.html`. diff --git a/pygmt/src/nearneighbor.py b/pygmt/src/nearneighbor.py index ed69a87bb95..cbd3f76e8d8 100644 --- a/pygmt/src/nearneighbor.py +++ b/pygmt/src/nearneighbor.py @@ -55,9 +55,9 @@ def nearneighbor( function and the averaging used is given by: .. math:: - w(r_i) = \frac{{w_i}}{{1 + d(r_i) ^ 2}}, - \quad d(r) = \frac {{3r}}{{R}}, - \quad \bar{{z}} = \frac{{\sum_i^n w(r_i) z_i}}{{\sum_i^n w(r_i)}} + w(r_i) = \frac{w_i}{1 + d(r_i) ^ 2}, + \quad d(r) = \frac {3r}{R}, + \quad \bar{z} = \frac{\sum_i^n w(r_i) z_i}{\sum_i^n w(r_i)} where :math:`n` is the number of data points that satisfy the selection criteria and :math:`r_i` is the distance from the node to the *i*'th data diff --git a/pygmt/src/project.py b/pygmt/src/project.py index a30c56504a2..ad88345d1cb 100644 --- a/pygmt/src/project.py +++ b/pygmt/src/project.py @@ -86,9 +86,9 @@ def project( # noqa: PLR0913 Data can be selectively windowed by using the ``length`` and ``width`` parameters. If ``width`` is used, the projection width is set to use only - data with :math:`w_{{min}} < q < w_{{max}}`. If ``length`` is set, then + data with :math:`w_{min} < q < w_{max}`. If ``length`` is set, then the length is set to use only those data with - :math:`l_{{min}} < p < l_{{max}}`. If the ``endpoint`` parameter + :math:`l_{min} < p < l_{max}`. If the ``endpoint`` parameter has been used to define the projection, then ``length="w"`` may be used to window the length of the projection to exactly the span from O to B. @@ -98,10 +98,10 @@ def project( # noqa: PLR0913 x-axis. azimuth = 90 - theta. No assumptions are made regarding the units for - :math:`x, y, r, s, p, q, dist, l_{{min}}, l_{{max}}, w_{{min}}, w_{{max}}`. + :math:`x, y, r, s, p, q, dist, l_{min}, l_{max}, w_{min}, w_{max}`. If ``unit`` is selected, map units are assumed and :math:`x, y, r, s` must be in degrees and - :math:`p, q, dist, l_{{min}}, l_{{max}}, w_{{min}}, w_{{max}}` + :math:`p, q, dist, l_{min}, l_{max}, w_{min}, w_{max}` will be in km. Calculations of specific great-circle and geodesic distances or for @@ -159,7 +159,7 @@ def project( # noqa: PLR0913 through *cx*/*cy*, append **+c** to compute the required colatitude. Use ``center`` and ``endpoint`` to generate a circle that goes through the center and end point. Note, in this case the center and - end point cannot be farther apart than :math:`2|\mbox{{colat}}|`. + end point cannot be farther apart than :math:`2|\mbox{colat}|`. Finally, if you append **+h** then we will report the position of the pole as part of the segment header [Default is no header]. **Note**: No input is read and the value of ``data``, ``x``, ``y``, @@ -167,7 +167,7 @@ def project( # noqa: PLR0913 length (*lmin*, *lmax*) or ``"limit"``. Project only those data whose *p* coordinate is within - :math:`l_{{min}} < p < l_{{max}}`. If ``endpoint`` has been set, then you may + :math:`l_{min} < p < l_{max}`. If ``endpoint`` has been set, then you may alternatively set it to ``"limit"`` to stay within the distance from ``center`` to ``endpoint``. flat_earth : bool @@ -176,7 +176,7 @@ def project( # noqa: PLR0913 unit : bool Set units for :math:`x, y, r, s` to degrees and - :math:`p, q, dist, l_{{min}}, l_{{max}}, w_{{min}}, w_{{max}}` to km. + :math:`p, q, dist, l_{min}, l_{max}, w_{min}, w_{max}` to km. [Default is ``False``; all arguments use the same units] sort : bool @@ -188,7 +188,7 @@ def project( # noqa: PLR0913 width (*w_min*, *w_max*). Specify width controls for the projected points. Project only those points whose - q coordinate is within :math:`w_{{min}} < q < w_{{max}}`. + q coordinate is within :math:`w_{min} < q < w_{max}`. ellipse : str *major*/*minor*/*azimuth* [**+e**\|\ **n**]. diff --git a/pygmt/src/surface.py b/pygmt/src/surface.py index ceea5202ce8..116c67fbab0 100644 --- a/pygmt/src/surface.py +++ b/pygmt/src/surface.py @@ -99,7 +99,7 @@ def surface( when the maximum absolute change in any grid value is less than ``convergence``. (Units same as data z units). Alternatively, give limit in percentage of root-mean-square (rms) deviation by - appending %. [Default is scaled to :math:`10^{{-4}}` of the rms + appending %. [Default is scaled to :math:`10^{-4}` of the rms deviation of the data from a best-fit (least-squares) plane.] This is the final convergence limit at the desired grid spacing; for intermediate (coarser) grids the effective convergence limit is diff --git a/pygmt/src/tilemap.py b/pygmt/src/tilemap.py index 85d1cf0bdeb..deef5ca3188 100644 --- a/pygmt/src/tilemap.py +++ b/pygmt/src/tilemap.py @@ -87,8 +87,8 @@ def tilemap( # noqa: PLR0913 tile providers. Default is ``xyzservices.providers.OpenStreetMap.HOT``, i.e. OpenStreetMap Humanitarian web tiles. - A web tile provider in the form of a URL. The placeholders for the XYZ in the - URL need to be ``{{x}}``, ``{{y}}``, ``{{z}}``, respectively. E.g. - ``https://{{s}}.tile.openstreetmap.org/{{z}}/{{x}}/{{y}}.png``. + URL need to be ``{x}``, ``{y}``, ``{z}``, respectively. E.g. + ``https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png``. - A local file path. The file is read with :doc:`rasterio ` and all bands are loaded into the basemap. See :doc:`contextily:working_with_local_files`. From c6b9661a9bc4a6c69ecf7949fb434e7b00d5c991 Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Sat, 15 Nov 2025 19:38:20 +0800 Subject: [PATCH 5/5] grdgradient was incorrectly updated --- pygmt/src/grdgradient.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pygmt/src/grdgradient.py b/pygmt/src/grdgradient.py index 0bac2093568..bc8b22888a6 100644 --- a/pygmt/src/grdgradient.py +++ b/pygmt/src/grdgradient.py @@ -114,17 +114,17 @@ def grdgradient( given, it is set to the average of :math:`g`. The following forms are supported: - - **True**: Normalize using :math:`g_n = \mbox{amp}\ - (\frac{g - \mbox{offset}{max(|g - \mbox{offset}|)})` + - **True**: Normalize using math:`g_n = \mbox{amp}\ + (\frac{g - \mbox{offset}}{max(|g - \mbox{offset}|)})` - **e**: Normalize using a cumulative Laplace distribution yielding: :math:`g_n = \mbox{amp}(1 - \ - \exp{(\sqrt{2}\frac{g - \mbox{offset}{\sigma}))}`, where + \exp{(\sqrt{2}\frac{g - \mbox{offset}}{\sigma}))}`, where :math:`\sigma` is estimated using the L1 norm of :math:`(g - \mbox{offset})` if it is not given. - **t**: Normalize using a cumulative Cauchy distribution yielding: :math:`g_n = \ \frac{2(\mbox{amp})}{\pi}(\tan^{-1}(\frac{g - \ - \mbox{offset}{\sigma}))` where :math:`\sigma` is estimated + \mbox{offset}}{\sigma}))` where :math:`\sigma` is estimated using the L2 norm of :math:`(g - \mbox{offset})` if it is not given.