Skip to content

Commit c0896ff

Browse files
authored
_to_string: Add doctest to ensure it works for both Sequence and Mappable objects (#4173)
1 parent 195347d commit c0896ff

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

pygmt/alias.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,13 @@ def _to_string(
104104
>>> _to_string(("12p", "34p"), prefix="+o", sep="/")
105105
'+o12p/34p'
106106
107+
>>> # Works for parameters that accept Sequence and Mappable objects.
108+
>>> # E.g., project -Lw|lmin/lmax.
109+
>>> _to_string("limit", sep="/", size=2, mapping={"limit": "w"})
110+
'w'
111+
>>> _to_string((12, 34), sep="/", size=2, mapping={"limit": "w"})
112+
'12/34'
113+
107114
>>> _to_string(["xaf", "yaf", "WSen"])
108115
['xaf', 'yaf', 'WSen']
109116

0 commit comments

Comments
 (0)