|
2 | 2 | Decorators to help wrap the GMT modules. |
3 | 3 |
|
4 | 4 | Apply them to functions wrapping GMT modules to automate: alias generation for |
5 | | -arguments, insert common text into docstrings, transform arguments to strings, |
6 | | -etc. |
| 5 | +arguments, insert common text into docstrings, transform arguments to strings, etc. |
7 | 6 | """ |
8 | 7 |
|
9 | 8 | import functools |
|
22 | 21 | [**s**\|\ **S**]][**+l**\|\ **r**][**+p**\ *percent*]. |
23 | 22 | Features with an area smaller than *min_area* in km\ :sup:`2` or of |
24 | 23 | hierarchical level that is lower than *min_level* or higher than |
25 | | - *max_level* will not be plotted [Default is ``"0/0/4"`` (all |
26 | | - features)].""", |
| 24 | + *max_level* will not be plotted [Default is ``"0/0/4"`` (all features)].""", |
27 | 25 | "aspatial": r""" |
28 | 26 | aspatial : bool or str |
29 | 27 | [*col*\ =]\ *name*\ [,...]. |
30 | 28 | Control how aspatial data are handled during input and output. |
31 | | - Full documentation is at :gmt-docs:`gmt.html#aspatial-full`. |
32 | | - """, |
| 29 | + Full documentation is at :gmt-docs:`gmt.html#aspatial-full`.""", |
33 | 30 | "binary": r""" |
34 | 31 | binary : bool or str |
35 | 32 | **i**\|\ **o**\ [*ncols*][*type*][**w**][**+l**\|\ **b**]. |
36 | 33 | Select native binary input (using ``binary="i"``) or output |
37 | 34 | (using ``binary="o"``), where *ncols* is the number of data columns |
38 | 35 | of *type*, which must be one of: |
39 | 36 |
|
40 | | - - **c**: int8_t (1-byte signed char) |
41 | | - - **u**: uint8_t (1-byte unsigned char) |
42 | | - - **h**: int16_t (2-byte signed int) |
43 | | - - **H**: uint16_t (2-byte unsigned int) |
44 | | - - **i**: int32_t (4-byte signed int) |
45 | | - - **I**: uint32_t (4-byte unsigned int) |
46 | | - - **l**: int64_t (8-byte signed int) |
47 | | - - **L**: uint64_t (8-byte unsigned int) |
48 | | - - **f**: 4-byte single-precision float |
49 | | - - **d**: 8-byte double-precision float |
50 | | - - **x**: use to skip *ncols* anywhere in the record |
| 37 | + - **c**: int8_t (1-byte signed char) |
| 38 | + - **u**: uint8_t (1-byte unsigned char) |
| 39 | + - **h**: int16_t (2-byte signed int) |
| 40 | + - **H**: uint16_t (2-byte unsigned int) |
| 41 | + - **i**: int32_t (4-byte signed int) |
| 42 | + - **I**: uint32_t (4-byte unsigned int) |
| 43 | + - **l**: int64_t (8-byte signed int) |
| 44 | + - **L**: uint64_t (8-byte unsigned int) |
| 45 | + - **f**: 4-byte single-precision float |
| 46 | + - **d**: 8-byte double-precision float |
| 47 | + - **x**: use to skip *ncols* anywhere in the record |
51 | 48 |
|
52 | 49 | For records with mixed types, append additional comma-separated |
53 | 50 | combinations of *ncols* *type* (no space). The following modifiers |
54 | 51 | are supported: |
55 | 52 |
|
56 | | - - **w** after any item to force byte-swapping. |
57 | | - - **+l**\|\ **b** to indicate that the entire data file should |
58 | | - be read as little- or big-endian, respectively. |
| 53 | + - **w** after any item to force byte-swapping. |
| 54 | + - **+l**\|\ **b** to indicate that the entire data file should be |
| 55 | + read as little- or big-endian, respectively. |
59 | 56 |
|
60 | 57 | Full documentation is at :gmt-docs:`gmt.html#bi-full`.""", |
61 | 58 | "cmap": r""" |
|
66 | 63 | "coltypes": r""" |
67 | 64 | coltypes : str |
68 | 65 | [**i**\|\ **o**]\ *colinfo*. |
69 | | - Specify data types of input and/or output columns (time or |
70 | | - geographical data). Full documentation is at |
71 | | - :gmt-docs:`gmt.html#f-full`.""", |
| 66 | + Specify data types of input and/or output columns (time or geographical |
| 67 | + data). Full documentation is at :gmt-docs:`gmt.html#f-full`.""", |
72 | 68 | "cores": r""" |
73 | 69 | cores : bool or int |
74 | 70 | Specify the number of active cores to be used in any OpenMP-enabled |
|
95 | 91 | "frame": r""" |
96 | 92 | frame : bool, str, or list |
97 | 93 | Set map boundary |
98 | | - :doc:`frame and axes attributes </tutorials/basics/frames>`. """, |
| 94 | + :doc:`frame and axes attributes </tutorials/basics/frames>`.""", |
99 | 95 | "gap": r""" |
100 | 96 | gap : str or list |
101 | 97 | **x**\|\ **y**\|\ **z**\|\ **d**\|\ **X**\|\ **Y**\|\ |
|
105 | 101 | a list with each item containing a string describing one set of |
106 | 102 | criteria. |
107 | 103 |
|
108 | | - - **x**\|\ **X**: define a gap when there is a large enough |
109 | | - change in the x coordinates (uppercase to use projected |
110 | | - coordinates). |
111 | | - - **y**\|\ **Y**: define a gap when there is a large enough |
112 | | - change in the y coordinates (uppercase to use projected |
113 | | - coordinates). |
114 | | - - **d**\|\ **D**: define a gap when there is a large enough |
115 | | - distance between coordinates (uppercase to use projected |
116 | | - coordinates). |
117 | | - - **z**: define a gap when there is a large enough change in |
118 | | - the z data. Use **+c**\ *col* to change the z data column |
119 | | - [Default *col* is 2 (i.e., 3rd column)]. |
| 104 | + - **x**\|\ **X**: define a gap when there is a large enough |
| 105 | + change in the x coordinates (uppercase to use projected coordinates). |
| 106 | + - **y**\|\ **Y**: define a gap when there is a large enough |
| 107 | + change in the y coordinates (uppercase to use projected coordinates). |
| 108 | + - **d**\|\ **D**: define a gap when there is a large enough |
| 109 | + distance between coordinates (uppercase to use projected coordinates). |
| 110 | + - **z**: define a gap when there is a large enough change in |
| 111 | + the z data. Use **+c**\ *col* to change the z data column |
| 112 | + [Default *col* is 2 (i.e., 3rd column)]. |
120 | 113 |
|
121 | 114 | A unit **u** may be appended to the specified *gap*: |
122 | 115 |
|
123 | | - - For geographic data (**x**\|\ **y**\|\ **d**), the unit may |
124 | | - be arc- **d**\ (egrees), **m**\ (inutes), and **s**\ (econds) |
125 | | - , or (m)\ **e**\ (ters), **f**\ (eet), **k**\ (ilometers), |
126 | | - **M**\ (iles), or **n**\ (autical miles) [Default is |
127 | | - (m)\ **e**\ (ters)]. |
128 | | - - For projected data (**X**\|\ **Y**\|\ **D**), the unit may be |
129 | | - **i**\ (nches), **c**\ (entimeters), or **p**\ (oints). |
| 116 | + - For geographic data (**x**\|\ **y**\|\ **d**), the unit may |
| 117 | + be arc- **d**\ (egrees), **m**\ (inutes), and **s**\ (econds), |
| 118 | + or (m)\ **e**\ (ters), **f**\ (eet), **k**\ (ilometers), |
| 119 | + **M**\ (iles), or **n**\ (autical miles) [Default is (m)\ **e**\ (ters)]. |
| 120 | + - For projected data (**X**\|\ **Y**\|\ **D**), the unit may be |
| 121 | + **i**\ (nches), **c**\ (entimeters), or **p**\ (oints). |
130 | 122 |
|
131 | 123 | Append modifier **+a** to specify that *all* the criteria must be |
132 | 124 | met [default imposes breaks if any one criterion is met]. |
133 | 125 |
|
134 | 126 | One of the following modifiers can be appended: |
135 | 127 |
|
136 | | - - **+n**: specify that the previous value minus the current |
137 | | - column value must exceed *gap* for a break to be imposed. |
138 | | - - **+p**: specify that the current value minus the previous |
139 | | - value must exceed *gap* for a break to be imposed.""", |
| 128 | + - **+n**: specify that the previous value minus the current |
| 129 | + column value must exceed *gap* for a break to be imposed. |
| 130 | + - **+p**: specify that the current value minus the previous |
| 131 | + value must exceed *gap* for a break to be imposed.""", |
140 | 132 | "grid": r""" |
141 | 133 | grid |
142 | 134 | Name of the input grid file or the grid loaded as a |
|
153 | 145 | header records. Prepend **o** to control the writing of header |
154 | 146 | records, with the following modifiers supported: |
155 | 147 |
|
156 | | - - **+d** to remove existing header records. |
157 | | - - **+c** to add a header comment with column names to the |
158 | | - output [Default is no column names]. |
159 | | - - **+m** to add a segment header *segheader* to the output |
160 | | - after the header block [Default is no segment header]. |
161 | | - - **+r** to add a *remark* comment to the output [Default is no |
162 | | - comment]. The *remark* string may contain \\n to indicate |
163 | | - line-breaks. |
164 | | - - **+t** to add a *title* comment to the output [Default is no |
165 | | - title]. The *title* string may contain \\n to indicate |
166 | | - line-breaks. |
| 148 | + - **+d** to remove existing header records. |
| 149 | + - **+c** to add a header comment with column names to the |
| 150 | + output [Default is no column names]. |
| 151 | + - **+m** to add a segment header *segheader* to the output |
| 152 | + after the header block [Default is no segment header]. |
| 153 | + - **+r** to add a *remark* comment to the output [Default is no |
| 154 | + comment]. The *remark* string may contain \\n to indicate |
| 155 | + line-breaks. |
| 156 | + - **+t** to add a *title* comment to the output [Default is no |
| 157 | + title]. The *title* string may contain \\n to indicate |
| 158 | + line-breaks. |
167 | 159 |
|
168 | 160 | Blank lines and lines starting with \# are always skipped.""", |
169 | 161 | "incols": r""" |
|
189 | 181 | following modifiers to any column or column range to transform |
190 | 182 | the input columns: |
191 | 183 |
|
192 | | - - **+l** to take the *log10* of the input values. |
193 | | - - **+d** to divide the input values by the factor *divisor* |
194 | | - [Default is 1]. |
195 | | - - **+s** to multiple the input values by the factor *scale* |
196 | | - [Default is 1]. |
197 | | - - **+o** to add the given *offset* to the input values [Default |
198 | | - is 0].""", |
| 184 | + - **+l** to take the *log10* of the input values. |
| 185 | + - **+d** to divide the input values by the factor *divisor* [Default is 1]. |
| 186 | + - **+s** to multiple the input values by the factor *scale* [Default is 1]. |
| 187 | + - **+o** to add the given *offset* to the input values [Default is 0].""", |
199 | 188 | "interpolation": r""" |
200 | 189 | interpolation : str |
201 | 190 | [**b**\|\ **c**\|\ **l**\|\ **n**][**+a**][**+b**\ *BC*][**+c**][**+t**\ *threshold*]. |
202 | | - Select interpolation mode for grids. You can select the type of |
203 | | - spline used: |
| 191 | + Select interpolation mode for grids. You can select the type of spline used: |
204 | 192 |
|
205 | 193 | - **b** for B-spline |
206 | 194 | - **c** for bicubic [Default] |
|
258 | 246 | Name of the output netCDF grid file. If not specified, will return an |
259 | 247 | :class:`xarray.DataArray` object. For writing a specific grid file format or |
260 | 248 | applying basic data operations to the output grid, see |
261 | | - :gmt-docs:`gmt.html#grd-inout-full` for the available modifiers. |
262 | | - """, |
| 249 | + :gmt-docs:`gmt.html#grd-inout-full` for the available modifiers.""", |
263 | 250 | "panel": r""" |
264 | 251 | panel |
265 | 252 | Select a specific subplot panel. Only allowed when used in |
|
280 | 267 | [**+w**\ *lon0*/*lat0*\[/*z0*]][**+v**\ *x0*/*y0*]. |
281 | 268 | Select perspective view and set the azimuth and elevation angle of |
282 | 269 | the viewpoint [Default is ``[180, 90]``]. Full documentation is at |
283 | | - :gmt-docs:`gmt.html#perspective-full`. |
284 | | - """, |
| 270 | + :gmt-docs:`gmt.html#perspective-full`.""", |
285 | 271 | "projection": r""" |
286 | 272 | projection : str |
287 | 273 | *projcode*\[*projparams*/]\ *width*\|\ *scale*. |
|
294 | 280 | registration : str |
295 | 281 | **g**\|\ **p**. |
296 | 282 | Force gridline (**g**) or pixel (**p**) node registration |
297 | | - [Default is **g**\ (ridline)]. |
298 | | - """, |
| 283 | + [Default is **g**\ (ridline)].""", |
299 | 284 | "skiprows": r""" |
300 | 285 | skiprows : bool or str |
301 | 286 | [*cols*][**+a**][**+r**]. |
|
307 | 292 | *inc* defaults to 1 if not specified. The following modifiers are |
308 | 293 | supported: |
309 | 294 |
|
310 | | - - **+r** to reverse the suppression, i.e., only output the |
311 | | - records whose *z*-value equals NaN. |
312 | | - - **+a** to suppress the output of the record if just one or |
313 | | - more of the columns equal NaN [Default skips record only |
314 | | - if values in all specified *cols* equal NaN].""", |
| 295 | + - **+r** to reverse the suppression, i.e., only output the |
| 296 | + records whose *z*-value equals NaN. |
| 297 | + - **+a** to suppress the output of the record if just one or |
| 298 | + more of the columns equal NaN [Default skips record only |
| 299 | + if values in all specified *cols* equal NaN].""", |
315 | 300 | "spacing": r""" |
316 | 301 | spacing : float, str, or list |
317 | 302 | *x_inc*\ [**+e**\|\ **n**][/\ *y_inc*\ [**+e**\|\ **n**]]. |
|
349 | 334 | [Default is ``0``, i.e., opaque]. |
350 | 335 | Only visible when PDF or raster format output is selected. |
351 | 336 | Only the PNG format selection adds a transparency layer |
352 | | - in the image (for further processing). """, |
| 337 | + in the image (for further processing).""", |
353 | 338 | "verbose": r""" |
354 | 339 | verbose : bool or str |
355 | 340 | Select verbosity level [:term:`Full usage <verbose>`].""", |
|
361 | 346 | different column if selected via **+c**\ *col*. The following |
362 | 347 | cyclical coordinate transformations are supported: |
363 | 348 |
|
364 | | - - **y**: yearly cycle (normalized) |
365 | | - - **a**: annual cycle (monthly) |
366 | | - - **w**: weekly cycle (day) |
367 | | - - **d**: daily cycle (hour) |
368 | | - - **h**: hourly cycle (minute) |
369 | | - - **m**: minute cycle (second) |
370 | | - - **s**: second cycle (second) |
371 | | - - **c**: custom cycle (normalized) |
| 349 | + - **y**: yearly cycle (normalized) |
| 350 | + - **a**: annual cycle (monthly) |
| 351 | + - **w**: weekly cycle (day) |
| 352 | + - **d**: daily cycle (hour) |
| 353 | + - **h**: hourly cycle (minute) |
| 354 | + - **m**: minute cycle (second) |
| 355 | + - **s**: second cycle (second) |
| 356 | + - **c**: custom cycle (normalized) |
372 | 357 |
|
373 | 358 | Full documentation is at :gmt-docs:`gmt.html#w-full`.""", |
374 | 359 | } |
|
0 commit comments