Skip to content

Commit 5d2da64

Browse files
authored
Migrate the transparency parameter to the new alias system (#4066)
1 parent 9c42f50 commit 5d2da64

19 files changed

+57
-19
lines changed

pygmt/alias.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,8 @@ def add_common(self, **kwargs):
303303
alias = Alias(value, name="projection")
304304
case "c":
305305
alias = Alias(value, name="panel", sep=",", size=2)
306+
case "t":
307+
alias = Alias(value, name="transparency")
306308
case _:
307309
raise GMTValueError(key, description="common parameter")
308310
self.aliasdict[key] = alias

pygmt/src/basemap.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
Tm="compass",
2222
f="coltypes",
2323
p="perspective",
24-
t="transparency",
2524
)
2625
@kwargs_to_strings(R="sequence", p="sequence")
2726
def basemap(
@@ -30,6 +29,7 @@ def basemap(
3029
verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"]
3130
| bool = False,
3231
panel: int | tuple[int, int] | bool = False,
32+
transparency: float | None = None,
3333
**kwargs,
3434
):
3535
r"""
@@ -49,6 +49,7 @@ def basemap(
4949
- J = projection
5050
- V = verbose
5151
- c = panel
52+
- t = transparency
5253
5354
Parameters
5455
----------
@@ -98,6 +99,7 @@ def basemap(
9899
J=projection,
99100
V=verbose,
100101
c=panel,
102+
t=transparency,
101103
)
102104
aliasdict.merge(kwargs)
103105

pygmt/src/coast.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
S="water",
3434
W="shorelines",
3535
p="perspective",
36-
t="transparency",
3736
)
3837
@kwargs_to_strings(R="sequence", p="sequence")
3938
def coast(
@@ -45,6 +44,7 @@ def coast(
4544
verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"]
4645
| bool = False,
4746
panel: int | tuple[int, int] | bool = False,
47+
transparency: float | None = None,
4848
**kwargs,
4949
):
5050
r"""
@@ -71,6 +71,7 @@ def coast(
7171
- J = projection
7272
- V = verbose
7373
- c = panel
74+
- t = transparency
7475
7576
Parameters
7677
----------
@@ -233,6 +234,7 @@ def coast(
233234
J=projection,
234235
V=verbose,
235236
c=panel,
237+
t=transparency,
236238
)
237239
aliasdict.merge(kwargs)
238240

pygmt/src/colorbar.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
W="scale",
2626
Z="zfile",
2727
p="perspective",
28-
t="transparency",
2928
)
3029
@kwargs_to_strings(R="sequence", G="sequence", I="sequence", p="sequence")
3130
def colorbar(
@@ -34,6 +33,7 @@ def colorbar(
3433
verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"]
3534
| bool = False,
3635
panel: int | tuple[int, int] | bool = False,
36+
transparency: float | None = None,
3737
**kwargs,
3838
):
3939
r"""
@@ -53,6 +53,7 @@ def colorbar(
5353
- J = projection
5454
- V = verbose
5555
- c = panel
56+
- t = transparency
5657
5758
Parameters
5859
----------
@@ -158,6 +159,7 @@ def colorbar(
158159
J=projection,
159160
V=verbose,
160161
c=panel,
162+
t=transparency,
161163
)
162164
aliasdict.merge(kwargs)
163165

pygmt/src/contour.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
i="incols",
3636
l="label",
3737
p="perspective",
38-
t="transparency",
3938
)
4039
@kwargs_to_strings(R="sequence", i="sequence_comma", p="sequence")
4140
def contour(
@@ -48,6 +47,7 @@ def contour(
4847
verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"]
4948
| bool = False,
5049
panel: int | tuple[int, int] | bool = False,
50+
transparency: float | None = None,
5151
**kwargs,
5252
):
5353
r"""
@@ -64,6 +64,7 @@ def contour(
6464
- J = projection
6565
- V = verbose
6666
- c = panel
67+
- t = transparency
6768
6869
Parameters
6970
----------
@@ -162,6 +163,7 @@ def contour(
162163
J=projection,
163164
V=verbose,
164165
c=panel,
166+
t=transparency,
165167
)
166168
aliasdict.merge(kwargs)
167169

pygmt/src/grdcontour.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
l="label",
3636
f="coltypes",
3737
p="perspective",
38-
t="transparency",
3938
)
4039
@kwargs_to_strings(R="sequence", L="sequence", p="sequence")
4140
def grdcontour(
@@ -45,6 +44,7 @@ def grdcontour(
4544
verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"]
4645
| bool = False,
4746
panel: int | tuple[int, int] | bool = False,
47+
transparency: float | None = None,
4848
**kwargs,
4949
):
5050
r"""
@@ -58,6 +58,7 @@ def grdcontour(
5858
- J = projection
5959
- V = verbose
6060
- c = panel
61+
- t = transparency
6162
6263
Parameters
6364
----------
@@ -166,6 +167,7 @@ def grdcontour(
166167
J=projection,
167168
V=verbose,
168169
c=panel,
170+
t=transparency,
169171
)
170172
aliasdict.merge(kwargs)
171173

pygmt/src/grdimage.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
n="interpolation",
2929
f="coltypes",
3030
p="perspective",
31-
t="transparency",
3231
x="cores",
3332
)
3433
@kwargs_to_strings(R="sequence", p="sequence")
@@ -39,6 +38,7 @@ def grdimage(
3938
verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"]
4039
| bool = False,
4140
panel: int | tuple[int, int] | bool = False,
41+
transparency: float | None = None,
4242
**kwargs,
4343
):
4444
r"""
@@ -78,6 +78,7 @@ def grdimage(
7878
- J = projection
7979
- V = verbose
8080
- c = panel
81+
- t = transparency
8182
8283
Parameters
8384
----------
@@ -175,6 +176,7 @@ def grdimage(
175176
J=projection,
176177
V=verbose,
177178
c=panel,
179+
t=transparency,
178180
)
179181
aliasdict.merge(kwargs)
180182

pygmt/src/grdview.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
f="coltypes",
3131
n="interpolation",
3232
p="perspective",
33-
t="transparency",
3433
)
3534
@kwargs_to_strings(R="sequence", p="sequence")
3635
def grdview(
@@ -40,6 +39,7 @@ def grdview(
4039
verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"]
4140
| bool = False,
4241
panel: int | tuple[int, int] | bool = False,
42+
transparency: float | None = None,
4343
**kwargs,
4444
):
4545
r"""
@@ -57,6 +57,7 @@ def grdview(
5757
- J = projection
5858
- V = verbose
5959
- c = panel
60+
- t = transparency
6061
6162
Parameters
6263
----------
@@ -157,6 +158,7 @@ def grdview(
157158
J=projection,
158159
V=verbose,
159160
c=panel,
161+
t=transparency,
160162
)
161163
aliasdict.merge(kwargs)
162164

pygmt/src/histogram.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
i="incols",
3535
l="label",
3636
p="perspective",
37-
t="transparency",
3837
w="wrap",
3938
)
4039
@kwargs_to_strings(R="sequence", T="sequence", i="sequence_comma", p="sequence")
@@ -45,6 +44,7 @@ def histogram(
4544
verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"]
4645
| bool = False,
4746
panel: int | tuple[int, int] | bool = False,
47+
transparency: float | None = None,
4848
**kwargs,
4949
):
5050
r"""
@@ -56,6 +56,7 @@ def histogram(
5656
- J = projection
5757
- V = verbose
5858
- c = panel
59+
- t = transparency
5960
6061
Parameters
6162
----------
@@ -150,6 +151,7 @@ def histogram(
150151
J=projection,
151152
V=verbose,
152153
c=panel,
154+
t=transparency,
153155
)
154156
aliasdict.merge(kwargs)
155157

pygmt/src/image.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
M="monochrome",
1919
R="region",
2020
p="perspective",
21-
t="transparency",
2221
)
2322
@kwargs_to_strings(R="sequence", p="sequence")
2423
def image(
@@ -28,6 +27,7 @@ def image(
2827
verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"]
2928
| bool = False,
3029
panel: int | tuple[int, int] | bool = False,
30+
transparency: float | None = None,
3131
**kwargs,
3232
):
3333
r"""
@@ -42,6 +42,7 @@ def image(
4242
- J = projection
4343
- V = verbose
4444
- c = panel
45+
- t = transparency
4546
4647
Parameters
4748
----------
@@ -85,6 +86,7 @@ def image(
8586
J=projection,
8687
V=verbose,
8788
c=panel,
89+
t=transparency,
8890
)
8991
aliasdict.merge(kwargs)
9092

0 commit comments

Comments
 (0)