Skip to content

Commit a869d24

Browse files
committed
Rename to_string to _to_string
1 parent a074ddb commit a869d24

1 file changed

Lines changed: 15 additions & 15 deletions

File tree

pygmt/alias.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from pygmt.helpers.utils import is_nonstr_iter, sequence_join
1111

1212

13-
def to_string(
13+
def _to_string(
1414
value: Any,
1515
prefix: str = "", # Default to an empty string to simplify the code logic.
1616
mapping: bool | Mapping = False,
@@ -61,29 +61,29 @@ def to_string(
6161
6262
Examples
6363
--------
64-
>>> to_string("text")
64+
>>> _to_string("text")
6565
'text'
66-
>>> to_string(12)
66+
>>> _to_string(12)
6767
'12'
68-
>>> to_string((12, 34), separator="/")
68+
>>> _to_string((12, 34), separator="/")
6969
'12/34'
70-
>>> to_string(("12p", "34p"), separator=",")
70+
>>> _to_string(("12p", "34p"), separator=",")
7171
'12p,34p'
72-
>>> to_string(("12p", "34p"), prefix="+o", separator="/")
72+
>>> _to_string(("12p", "34p"), prefix="+o", separator="/")
7373
'+o12p/34p'
74-
>>> to_string(True)
74+
>>> _to_string(True)
7575
''
76-
>>> to_string(True, prefix="+a")
76+
>>> _to_string(True, prefix="+a")
7777
'+a'
78-
>>> to_string(False)
79-
>>> to_string(None)
80-
>>> to_string(["xaf", "yaf", "WSen"])
78+
>>> _to_string(False)
79+
>>> _to_string(None)
80+
>>> _to_string(["xaf", "yaf", "WSen"])
8181
['xaf', 'yaf', 'WSen']
82-
>>> to_string("high", mapping=True)
82+
>>> _to_string("high", mapping=True)
8383
'h'
84-
>>> to_string("mean", mapping={"mean": "a", "mad": "d", "full": "g"})
84+
>>> _to_string("mean", mapping={"mean": "a", "mad": "d", "full": "g"})
8585
'a'
86-
>>> to_string("invalid", mapping={"mean": "a", "mad": "d", "full": "g"})
86+
>>> _to_string("invalid", mapping={"mean": "a", "mad": "d", "full": "g"})
8787
'invalid'
8888
"""
8989
if value is None or value is False: # None and False are converted to None.
@@ -157,7 +157,7 @@ def _value(self) -> str | list[str] | None:
157157
"""
158158
The value of the alias as a string, a sequence of strings or None.
159159
"""
160-
return to_string(
160+
return _to_string(
161161
value=self.value,
162162
prefix=self.prefix,
163163
separator=self.separator,

0 commit comments

Comments
 (0)