From 76b5408614e65a3de3f4fecb476d15f25f36b06b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvonne=20Fr=C3=B6hlich?= Date: Sun, 21 Sep 2025 13:01:07 +0200 Subject: [PATCH 1/4] Make indents consistnt in decorator file --- pygmt/helpers/decorators.py | 122 ++++++++++++++++++------------------ 1 file changed, 61 insertions(+), 61 deletions(-) diff --git a/pygmt/helpers/decorators.py b/pygmt/helpers/decorators.py index 43e9f05458c..32624a52a2e 100644 --- a/pygmt/helpers/decorators.py +++ b/pygmt/helpers/decorators.py @@ -37,25 +37,25 @@ (using ``binary="o"``), where *ncols* is the number of data columns of *type*, which must be one of: - - **c**: int8_t (1-byte signed char) - - **u**: uint8_t (1-byte unsigned char) - - **h**: int16_t (2-byte signed int) - - **H**: uint16_t (2-byte unsigned int) - - **i**: int32_t (4-byte signed int) - - **I**: uint32_t (4-byte unsigned int) - - **l**: int64_t (8-byte signed int) - - **L**: uint64_t (8-byte unsigned int) - - **f**: 4-byte single-precision float - - **d**: 8-byte double-precision float - - **x**: use to skip *ncols* anywhere in the record + - **c**: int8_t (1-byte signed char) + - **u**: uint8_t (1-byte unsigned char) + - **h**: int16_t (2-byte signed int) + - **H**: uint16_t (2-byte unsigned int) + - **i**: int32_t (4-byte signed int) + - **I**: uint32_t (4-byte unsigned int) + - **l**: int64_t (8-byte signed int) + - **L**: uint64_t (8-byte unsigned int) + - **f**: 4-byte single-precision float + - **d**: 8-byte double-precision float + - **x**: use to skip *ncols* anywhere in the record For records with mixed types, append additional comma-separated combinations of *ncols* *type* (no space). The following modifiers are supported: - - **w** after any item to force byte-swapping. - - **+l**\|\ **b** to indicate that the entire data file should - be read as little- or big-endian, respectively. + - **w** after any item to force byte-swapping. + - **+l**\|\ **b** to indicate that the entire data file should + be read as little- or big-endian, respectively. Full documentation is at :gmt-docs:`gmt.html#bi-full`.""", "cmap": r""" @@ -105,38 +105,38 @@ a list with each item containing a string describing one set of criteria. - - **x**\|\ **X**: define a gap when there is a large enough - change in the x coordinates (uppercase to use projected - coordinates). - - **y**\|\ **Y**: define a gap when there is a large enough - change in the y coordinates (uppercase to use projected - coordinates). - - **d**\|\ **D**: define a gap when there is a large enough - distance between coordinates (uppercase to use projected - coordinates). - - **z**: define a gap when there is a large enough change in - the z data. Use **+c**\ *col* to change the z data column - [Default *col* is 2 (i.e., 3rd column)]. + - **x**\|\ **X**: define a gap when there is a large enough + change in the x coordinates (uppercase to use projected + coordinates). + - **y**\|\ **Y**: define a gap when there is a large enough + change in the y coordinates (uppercase to use projected + coordinates). + - **d**\|\ **D**: define a gap when there is a large enough + distance between coordinates (uppercase to use projected + coordinates). + - **z**: define a gap when there is a large enough change in + the z data. Use **+c**\ *col* to change the z data column + [Default *col* is 2 (i.e., 3rd column)]. A unit **u** may be appended to the specified *gap*: - - For geographic data (**x**\|\ **y**\|\ **d**), the unit may - be arc- **d**\ (egrees), **m**\ (inutes), and **s**\ (econds) - , or (m)\ **e**\ (ters), **f**\ (eet), **k**\ (ilometers), - **M**\ (iles), or **n**\ (autical miles) [Default is - (m)\ **e**\ (ters)]. - - For projected data (**X**\|\ **Y**\|\ **D**), the unit may be - **i**\ (nches), **c**\ (entimeters), or **p**\ (oints). + - For geographic data (**x**\|\ **y**\|\ **d**), the unit may + be arc- **d**\ (egrees), **m**\ (inutes), and **s**\ (econds), + or (m)\ **e**\ (ters), **f**\ (eet), **k**\ (ilometers), + **M**\ (iles), or **n**\ (autical miles) [Default is + (m)\ **e**\ (ters)]. + - For projected data (**X**\|\ **Y**\|\ **D**), the unit may be + **i**\ (nches), **c**\ (entimeters), or **p**\ (oints). Append modifier **+a** to specify that *all* the criteria must be met [default imposes breaks if any one criterion is met]. One of the following modifiers can be appended: - - **+n**: specify that the previous value minus the current - column value must exceed *gap* for a break to be imposed. - - **+p**: specify that the current value minus the previous - value must exceed *gap* for a break to be imposed.""", + - **+n**: specify that the previous value minus the current + column value must exceed *gap* for a break to be imposed. + - **+p**: specify that the current value minus the previous + value must exceed *gap* for a break to be imposed.""", "grid": r""" grid Name of the input grid file or the grid loaded as a @@ -153,17 +153,17 @@ header records. Prepend **o** to control the writing of header records, with the following modifiers supported: - - **+d** to remove existing header records. - - **+c** to add a header comment with column names to the - output [Default is no column names]. - - **+m** to add a segment header *segheader* to the output - after the header block [Default is no segment header]. - - **+r** to add a *remark* comment to the output [Default is no - comment]. The *remark* string may contain \\n to indicate - line-breaks. - - **+t** to add a *title* comment to the output [Default is no - title]. The *title* string may contain \\n to indicate - line-breaks. + - **+d** to remove existing header records. + - **+c** to add a header comment with column names to the + output [Default is no column names]. + - **+m** to add a segment header *segheader* to the output + after the header block [Default is no segment header]. + - **+r** to add a *remark* comment to the output [Default is no + comment]. The *remark* string may contain \\n to indicate + line-breaks. + - **+t** to add a *title* comment to the output [Default is no + title]. The *title* string may contain \\n to indicate + line-breaks. Blank lines and lines starting with \# are always skipped.""", "incols": r""" @@ -307,11 +307,11 @@ *inc* defaults to 1 if not specified. The following modifiers are supported: - - **+r** to reverse the suppression, i.e., only output the - records whose *z*-value equals NaN. - - **+a** to suppress the output of the record if just one or - more of the columns equal NaN [Default skips record only - if values in all specified *cols* equal NaN].""", + - **+r** to reverse the suppression, i.e., only output the + records whose *z*-value equals NaN. + - **+a** to suppress the output of the record if just one or + more of the columns equal NaN [Default skips record only + if values in all specified *cols* equal NaN].""", "spacing": r""" spacing : float, str, or list *x_inc*\ [**+e**\|\ **n**][/\ *y_inc*\ [**+e**\|\ **n**]]. @@ -361,14 +361,14 @@ different column if selected via **+c**\ *col*. The following cyclical coordinate transformations are supported: - - **y**: yearly cycle (normalized) - - **a**: annual cycle (monthly) - - **w**: weekly cycle (day) - - **d**: daily cycle (hour) - - **h**: hourly cycle (minute) - - **m**: minute cycle (second) - - **s**: second cycle (second) - - **c**: custom cycle (normalized) + - **y**: yearly cycle (normalized) + - **a**: annual cycle (monthly) + - **w**: weekly cycle (day) + - **d**: daily cycle (hour) + - **h**: hourly cycle (minute) + - **m**: minute cycle (second) + - **s**: second cycle (second) + - **c**: custom cycle (normalized) Full documentation is at :gmt-docs:`gmt.html#w-full`.""", } From 4c4cfaacb22e808091d60a026d7069e551918019 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvonne=20Fr=C3=B6hlich?= Date: Sun, 21 Sep 2025 13:32:49 +0200 Subject: [PATCH 2/4] Make indents consistnt in decorator file --- pygmt/helpers/decorators.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/pygmt/helpers/decorators.py b/pygmt/helpers/decorators.py index 32624a52a2e..d93a68af42e 100644 --- a/pygmt/helpers/decorators.py +++ b/pygmt/helpers/decorators.py @@ -189,13 +189,10 @@ following modifiers to any column or column range to transform the input columns: - - **+l** to take the *log10* of the input values. - - **+d** to divide the input values by the factor *divisor* - [Default is 1]. - - **+s** to multiple the input values by the factor *scale* - [Default is 1]. - - **+o** to add the given *offset* to the input values [Default - is 0].""", + - **+l** to take the *log10* of the input values. + - **+d** to divide the input values by the factor *divisor* [Default is 1]. + - **+s** to multiple the input values by the factor *scale* [Default is 1]. + - **+o** to add the given *offset* to the input values [Default is 0].""", "interpolation": r""" interpolation : str [**b**\|\ **c**\|\ **l**\|\ **n**][**+a**][**+b**\ *BC*][**+c**][**+t**\ *threshold*]. From 65a02b03c45a169fe12671c48a113398eb0a6c47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvonne=20Fr=C3=B6hlich?= Date: Sun, 21 Sep 2025 13:52:53 +0200 Subject: [PATCH 3/4] Adjust line length and docstring endings --- pygmt/helpers/decorators.py | 44 ++++++++++++++----------------------- 1 file changed, 16 insertions(+), 28 deletions(-) diff --git a/pygmt/helpers/decorators.py b/pygmt/helpers/decorators.py index d93a68af42e..9a70d907c3d 100644 --- a/pygmt/helpers/decorators.py +++ b/pygmt/helpers/decorators.py @@ -2,8 +2,7 @@ Decorators to help wrap the GMT modules. Apply them to functions wrapping GMT modules to automate: alias generation for -arguments, insert common text into docstrings, transform arguments to strings, -etc. +arguments, insert common text into docstrings, transform arguments to strings, etc. """ import functools @@ -22,14 +21,12 @@ [**s**\|\ **S**]][**+l**\|\ **r**][**+p**\ *percent*]. Features with an area smaller than *min_area* in km\ :sup:`2` or of hierarchical level that is lower than *min_level* or higher than - *max_level* will not be plotted [Default is ``"0/0/4"`` (all - features)].""", + *max_level* will not be plotted [Default is ``"0/0/4"`` (all features)].""", "aspatial": r""" aspatial : bool or str [*col*\ =]\ *name*\ [,...]. Control how aspatial data are handled during input and output. - Full documentation is at :gmt-docs:`gmt.html#aspatial-full`. - """, + Full documentation is at :gmt-docs:`gmt.html#aspatial-full`. """, "binary": r""" binary : bool or str **i**\|\ **o**\ [*ncols*][*type*][**w**][**+l**\|\ **b**]. @@ -54,8 +51,8 @@ are supported: - **w** after any item to force byte-swapping. - - **+l**\|\ **b** to indicate that the entire data file should - be read as little- or big-endian, respectively. + - **+l**\|\ **b** to indicate that the entire data file should be + read as little- or big-endian, respectively. Full documentation is at :gmt-docs:`gmt.html#bi-full`.""", "cmap": r""" @@ -66,9 +63,8 @@ "coltypes": r""" coltypes : str [**i**\|\ **o**]\ *colinfo*. - Specify data types of input and/or output columns (time or - geographical data). Full documentation is at - :gmt-docs:`gmt.html#f-full`.""", + Specify data types of input and/or output columns (time or geographical + data). Full documentation is at :gmt-docs:`gmt.html#f-full`.""", "cores": r""" cores : bool or int Specify the number of active cores to be used in any OpenMP-enabled @@ -106,14 +102,11 @@ criteria. - **x**\|\ **X**: define a gap when there is a large enough - change in the x coordinates (uppercase to use projected - coordinates). + change in the x coordinates (uppercase to use projected coordinates). - **y**\|\ **Y**: define a gap when there is a large enough - change in the y coordinates (uppercase to use projected - coordinates). + change in the y coordinates (uppercase to use projected coordinates). - **d**\|\ **D**: define a gap when there is a large enough - distance between coordinates (uppercase to use projected - coordinates). + distance between coordinates (uppercase to use projected coordinates). - **z**: define a gap when there is a large enough change in the z data. Use **+c**\ *col* to change the z data column [Default *col* is 2 (i.e., 3rd column)]. @@ -123,8 +116,7 @@ - For geographic data (**x**\|\ **y**\|\ **d**), the unit may be arc- **d**\ (egrees), **m**\ (inutes), and **s**\ (econds), or (m)\ **e**\ (ters), **f**\ (eet), **k**\ (ilometers), - **M**\ (iles), or **n**\ (autical miles) [Default is - (m)\ **e**\ (ters)]. + **M**\ (iles), or **n**\ (autical miles) [Default is (m)\ **e**\ (ters)]. - For projected data (**X**\|\ **Y**\|\ **D**), the unit may be **i**\ (nches), **c**\ (entimeters), or **p**\ (oints). @@ -196,8 +188,7 @@ "interpolation": r""" interpolation : str [**b**\|\ **c**\|\ **l**\|\ **n**][**+a**][**+b**\ *BC*][**+c**][**+t**\ *threshold*]. - Select interpolation mode for grids. You can select the type of - spline used: + Select interpolation mode for grids. You can select the type of spline used: - **b** for B-spline - **c** for bicubic [Default] @@ -255,8 +246,7 @@ Name of the output netCDF grid file. If not specified, will return an :class:`xarray.DataArray` object. For writing a specific grid file format or applying basic data operations to the output grid, see - :gmt-docs:`gmt.html#grd-inout-full` for the available modifiers. - """, + :gmt-docs:`gmt.html#grd-inout-full` for the available modifiers.""", "panel": r""" panel Select a specific subplot panel. Only allowed when used in @@ -277,8 +267,7 @@ [**+w**\ *lon0*/*lat0*\[/*z0*]][**+v**\ *x0*/*y0*]. Select perspective view and set the azimuth and elevation angle of the viewpoint [Default is ``[180, 90]``]. Full documentation is at - :gmt-docs:`gmt.html#perspective-full`. - """, + :gmt-docs:`gmt.html#perspective-full`.""", "projection": r""" projection : str *projcode*\[*projparams*/]\ *width*\|\ *scale*. @@ -291,8 +280,7 @@ registration : str **g**\|\ **p**. Force gridline (**g**) or pixel (**p**) node registration - [Default is **g**\ (ridline)]. - """, + [Default is **g**\ (ridline)].""", "skiprows": r""" skiprows : bool or str [*cols*][**+a**][**+r**]. @@ -346,7 +334,7 @@ [Default is ``0``, i.e., opaque]. Only visible when PDF or raster format output is selected. Only the PNG format selection adds a transparency layer - in the image (for further processing). """, + in the image (for further processing).""", "verbose": r""" verbose : bool or str Select verbosity level [:term:`Full usage `].""", From 72779592a3987b4ba51be2792114887cd2f254bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvonne=20Fr=C3=B6hlich?= Date: Sun, 21 Sep 2025 14:06:17 +0200 Subject: [PATCH 4/4] Remove white spaces --- 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 9a70d907c3d..6e770e08479 100644 --- a/pygmt/helpers/decorators.py +++ b/pygmt/helpers/decorators.py @@ -26,7 +26,7 @@ aspatial : bool or str [*col*\ =]\ *name*\ [,...]. Control how aspatial data are handled during input and output. - Full documentation is at :gmt-docs:`gmt.html#aspatial-full`. """, + Full documentation is at :gmt-docs:`gmt.html#aspatial-full`.""", "binary": r""" binary : bool or str **i**\|\ **o**\ [*ncols*][*type*][**w**][**+l**\|\ **b**]. @@ -91,7 +91,7 @@ "frame": r""" frame : bool, str, or list Set map boundary - :doc:`frame and axes attributes `. """, + :doc:`frame and axes attributes `.""", "gap": r""" gap : str or list **x**\|\ **y**\|\ **z**\|\ **d**\|\ **X**\|\ **Y**\|\