Skip to content

Commit bb1b137

Browse files
committed
Update other wrappers
1 parent da4027a commit bb1b137

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+224
-153
lines changed

pygmt/src/binstats.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
E="empty",
1717
I="spacing",
1818
N="normalize",
19-
R="region",
2019
S="search_radius",
2120
W="weight",
2221
a="aspatial",
@@ -25,7 +24,7 @@
2524
i="incols",
2625
r="registration",
2726
)
28-
@kwargs_to_strings(I="sequence", R="sequence", i="sequence_comma")
27+
@kwargs_to_strings(I="sequence", i="sequence_comma")
2928
def binstats(
3029
data: PathLike | TableLike,
3130
outgrid: PathLike | None = None,
@@ -48,6 +47,7 @@ def binstats(
4847
"sum",
4948
] = "number",
5049
quantile_value: float = 50,
50+
region=None,
5151
verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"]
5252
| bool = False,
5353
**kwargs,
@@ -67,6 +67,7 @@ def binstats(
6767
6868
{aliases}
6969
- C = statistic
70+
- R = region
7071
- V = verbose
7172
7273
Parameters
@@ -154,6 +155,7 @@ def binstats(
154155
},
155156
),
156157
).add_common(
158+
R=region,
157159
V=verbose,
158160
)
159161
aliasdict.merge(kwargs)

pygmt/src/blockm.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ def _blockm(
7373
@fmt_docstring
7474
@use_alias(
7575
I="spacing",
76-
R="region",
7776
S="summary",
7877
a="aspatial",
7978
b="binary",
@@ -86,14 +85,15 @@ def _blockm(
8685
r="registration",
8786
w="wrap",
8887
)
89-
@kwargs_to_strings(I="sequence", R="sequence", i="sequence_comma", o="sequence_comma")
88+
@kwargs_to_strings(I="sequence", i="sequence_comma", o="sequence_comma")
9089
def blockmean(
9190
data: PathLike | TableLike | None = None,
9291
x=None,
9392
y=None,
9493
z=None,
9594
output_type: Literal["pandas", "numpy", "file"] = "pandas",
9695
outfile: PathLike | None = None,
96+
region=None,
9797
verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"]
9898
| bool = False,
9999
**kwargs,
@@ -113,6 +113,7 @@ def blockmean(
113113
Full GMT docs at :gmt-docs:`blockmean.html`.
114114
115115
{aliases}
116+
- R = region
116117
- V = verbose
117118
118119
Parameters
@@ -166,6 +167,7 @@ def blockmean(
166167
>>> data_bmean = pygmt.blockmean(data=data, region=[245, 255, 20, 30], spacing="5m")
167168
"""
168169
aliasdict = AliasSystem().add_common(
170+
R=region,
169171
V=verbose,
170172
)
171173
aliasdict.merge(kwargs)
@@ -185,7 +187,6 @@ def blockmean(
185187
@fmt_docstring
186188
@use_alias(
187189
I="spacing",
188-
R="region",
189190
a="aspatial",
190191
b="binary",
191192
d="nodata",
@@ -197,14 +198,15 @@ def blockmean(
197198
r="registration",
198199
w="wrap",
199200
)
200-
@kwargs_to_strings(I="sequence", R="sequence", i="sequence_comma", o="sequence_comma")
201+
@kwargs_to_strings(I="sequence", i="sequence_comma", o="sequence_comma")
201202
def blockmedian(
202203
data: PathLike | TableLike | None = None,
203204
x=None,
204205
y=None,
205206
z=None,
206207
output_type: Literal["pandas", "numpy", "file"] = "pandas",
207208
outfile: PathLike | None = None,
209+
region=None,
208210
verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"]
209211
| bool = False,
210212
**kwargs,
@@ -224,6 +226,7 @@ def blockmedian(
224226
Full GMT docs at :gmt-docs:`blockmedian.html`.
225227
226228
{aliases}
229+
- R = region
227230
- V = verbose
228231
229232
Parameters
@@ -271,6 +274,7 @@ def blockmedian(
271274
... )
272275
"""
273276
aliasdict = AliasSystem().add_common(
277+
R=region,
274278
V=verbose,
275279
)
276280
aliasdict.merge(kwargs)
@@ -290,7 +294,6 @@ def blockmedian(
290294
@fmt_docstring
291295
@use_alias(
292296
I="spacing",
293-
R="region",
294297
a="aspatial",
295298
b="binary",
296299
d="nodata",
@@ -302,14 +305,15 @@ def blockmedian(
302305
r="registration",
303306
w="wrap",
304307
)
305-
@kwargs_to_strings(I="sequence", R="sequence", i="sequence_comma", o="sequence_comma")
308+
@kwargs_to_strings(I="sequence", i="sequence_comma", o="sequence_comma")
306309
def blockmode(
307310
data: PathLike | TableLike | None = None,
308311
x=None,
309312
y=None,
310313
z=None,
311314
output_type: Literal["pandas", "numpy", "file"] = "pandas",
312315
outfile: PathLike | None = None,
316+
region=None,
313317
verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"]
314318
| bool = False,
315319
**kwargs,
@@ -329,6 +333,7 @@ def blockmode(
329333
Full GMT docs at :gmt-docs:`blockmode.html`.
330334
331335
{aliases}
336+
- R = region
332337
- V = verbose
333338
334339
Parameters
@@ -374,6 +379,7 @@ def blockmode(
374379
>>> data_bmode = pygmt.blockmode(data=data, region=[245, 255, 20, 30], spacing="5m")
375380
"""
376381
aliasdict = AliasSystem().add_common(
382+
R=region,
377383
V=verbose,
378384
)
379385
aliasdict.merge(kwargs)

pygmt/src/coast.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,19 @@
2929
I="rivers",
3030
L="map_scale",
3131
N="borders",
32-
R="region",
3332
S="water",
3433
W="shorelines",
3534
p="perspective",
3635
)
37-
@kwargs_to_strings(R="sequence", p="sequence")
36+
@kwargs_to_strings(p="sequence")
3837
def coast(
3938
self,
4039
projection=None,
4140
resolution: Literal[
4241
"auto", "full", "high", "intermediate", "low", "crude", None
4342
] = None,
4443
box: Box | bool = False,
44+
region=None,
4545
verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"]
4646
| bool = False,
4747
panel: int | tuple[int, int] | bool = False,
@@ -71,6 +71,7 @@ def coast(
7171
- D = resolution
7272
- F = box
7373
- J = projection
74+
- R = region
7475
- V = verbose
7576
- c = panel
7677
- t = transparency
@@ -222,6 +223,7 @@ def coast(
222223
F=Alias(box, name="box"),
223224
).add_common(
224225
J=projection,
226+
R=region,
225227
V=verbose,
226228
c=panel,
227229
t=transparency,

pygmt/src/colorbar.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,16 @@
2121
I="shading",
2222
L="equalsize",
2323
Q="log",
24-
R="region",
2524
W="scale",
2625
Z="zfile",
2726
p="perspective",
2827
)
29-
@kwargs_to_strings(R="sequence", G="sequence", I="sequence", p="sequence")
28+
@kwargs_to_strings(G="sequence", I="sequence", p="sequence")
3029
def colorbar(
3130
self,
3231
projection=None,
3332
box: Box | bool = False,
33+
region=None,
3434
verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"]
3535
| bool = False,
3636
panel: int | tuple[int, int] | bool = False,
@@ -53,6 +53,7 @@ def colorbar(
5353
{aliases}
5454
- F = box
5555
- J = projection
56+
- R = region
5657
- V = verbose
5758
- c = panel
5859
- t = transparency
@@ -151,6 +152,7 @@ def colorbar(
151152
F=Alias(box, name="box"),
152153
).add_common(
153154
J=projection,
155+
R=region,
154156
V=verbose,
155157
c=panel,
156158
t=transparency,

pygmt/src/contour.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
G="label_placement",
2525
L="triangular_mesh_pen",
2626
N="no_clip",
27-
R="region",
2827
S="skip",
2928
W="pen",
3029
b="binary",
@@ -36,14 +35,15 @@
3635
l="label",
3736
p="perspective",
3837
)
39-
@kwargs_to_strings(R="sequence", i="sequence_comma", p="sequence")
38+
@kwargs_to_strings(i="sequence_comma", p="sequence")
4039
def contour(
4140
self,
4241
data: PathLike | TableLike | None = None,
4342
x=None,
4443
y=None,
4544
z=None,
4645
projection=None,
46+
region=None,
4747
verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"]
4848
| bool = False,
4949
panel: int | tuple[int, int] | bool = False,
@@ -62,6 +62,7 @@ def contour(
6262
6363
{aliases}
6464
- J = projection
65+
- R = region
6566
- V = verbose
6667
- c = panel
6768
- t = transparency
@@ -161,6 +162,7 @@ def contour(
161162

162163
aliasdict = AliasSystem().add_common(
163164
J=projection,
165+
R=region,
164166
V=verbose,
165167
c=panel,
166168
t=transparency,

pygmt/src/dimfilter.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,12 @@
1515

1616

1717
@fmt_docstring
18-
@use_alias(
19-
D="distance",
20-
F="filter",
21-
I="spacing",
22-
N="sectors",
23-
R="region",
24-
)
25-
@kwargs_to_strings(I="sequence", R="sequence")
18+
@use_alias(D="distance", F="filter", I="spacing", N="sectors")
19+
@kwargs_to_strings(I="sequence")
2620
def dimfilter(
2721
grid: PathLike | xr.DataArray,
2822
outgrid: PathLike | None = None,
23+
region=None,
2924
verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"]
3025
| bool = False,
3126
**kwargs,
@@ -52,6 +47,7 @@ def dimfilter(
5247
Full GMT docs at :gmt-docs:`dimfilter.html`.
5348
5449
{aliases}
50+
- R = region
5551
- V = verbose
5652
5753
Parameters
@@ -152,6 +148,7 @@ def dimfilter(
152148
raise GMTInvalidInput(msg)
153149

154150
aliasdict = AliasSystem().add_common(
151+
R=region,
155152
V=verbose,
156153
)
157154
aliasdict.merge(kwargs)

pygmt/src/grd2cpt.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,19 @@
2424
H="output",
2525
I="reverse",
2626
L="limit",
27-
R="region",
2827
T="series",
2928
W="categorical",
3029
Ww="cyclic",
3130
)
32-
@kwargs_to_strings(L="sequence", R="sequence", T="sequence")
31+
@kwargs_to_strings(L="sequence", T="sequence")
3332
def grd2cpt(
3433
grid: PathLike | xr.DataArray,
3534
truncate: tuple[float, float] | None = None,
3635
overrule_bg: bool = False,
3736
no_bg: bool = False,
3837
log: bool = False,
3938
continuous: bool = False,
39+
region=None,
4040
verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"]
4141
| bool = False,
4242
**kwargs,
@@ -89,6 +89,7 @@ def grd2cpt(
8989
- M = overrule_bg
9090
- N = no_bg
9191
- Q = log
92+
- R = region
9293
- Z = continuous
9394
- V = verbose
9495
@@ -210,6 +211,7 @@ def grd2cpt(
210211
Q=Alias(log, name="log"),
211212
Z=Alias(continuous, name="continuous"),
212213
).add_common(
214+
R=region,
213215
V=verbose,
214216
)
215217
aliasdict.merge(kwargs)

pygmt/src/grd2xyz.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
@fmt_docstring
2626
@use_alias(
2727
C="cstyle",
28-
R="region",
2928
W="weight",
3029
Z="convention",
3130
b="binary",
@@ -35,11 +34,12 @@
3534
o="outcols",
3635
s="skiprows",
3736
)
38-
@kwargs_to_strings(R="sequence", o="sequence_comma")
37+
@kwargs_to_strings(o="sequence_comma")
3938
def grd2xyz(
4039
grid: PathLike | xr.DataArray,
4140
output_type: Literal["pandas", "numpy", "file"] = "pandas",
4241
outfile: PathLike | None = None,
42+
region=None,
4343
verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"]
4444
| bool = False,
4545
**kwargs,
@@ -53,6 +53,7 @@ def grd2xyz(
5353
Full GMT docs at :gmt-docs:`grd2xyz.html`.
5454
5555
{aliases}
56+
- R = region
5657
- V = verbose
5758
5859
Parameters
@@ -161,6 +162,7 @@ def grd2xyz(
161162
column_names = [str(grid.dims[1]), str(grid.dims[0]), str(grid.name)]
162163

163164
aliasdict = AliasSystem().add_common(
165+
R=region,
164166
V=verbose,
165167
)
166168
aliasdict.merge(kwargs)

0 commit comments

Comments
 (0)