File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change 4
4
5
5
import dataclasses
6
6
from collections import defaultdict
7
- from collections .abc import Mapping , Sequence
7
+ from collections .abc import Mapping
8
8
from typing import Any , Literal
9
9
10
10
from pygmt .helpers .utils import is_nonstr_iter
@@ -131,6 +131,18 @@ class Alias:
131
131
>>> par = Alias(["xaf", "yaf", "WSen"])
132
132
>>> par._value
133
133
['xaf', 'yaf', 'WSen']
134
+
135
+ >>> par = Alias("high", mapping=True)
136
+ >>> par._value
137
+ 'h'
138
+
139
+ >>> par = Alias("mean", mapping={"mean": "a", "mad": "d", "full": "g"})
140
+ >>> par._value
141
+ 'a'
142
+
143
+ >>> par = Alias("invalid", mapping={"mean": "a", "mad": "d", "full": "g"})
144
+ >>> par._value
145
+ 'invalid'
134
146
"""
135
147
136
148
value : Any
@@ -139,7 +151,7 @@ class Alias:
139
151
mapping : bool | Mapping = False
140
152
141
153
@property
142
- def _value (self ) -> str | Sequence [str ] | None :
154
+ def _value (self ) -> str | list [str ] | None :
143
155
"""
144
156
The value of the alias as a string, a sequence of strings or None.
145
157
"""
You can’t perform that action at this time.
0 commit comments