Skip to content

Commit dece315

Browse files
committed
Improve docstrings
1 parent 97bbe05 commit dece315

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

pygmt/clib/session.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1618,6 +1618,12 @@ def virtualfile_from_stringio(self, stringio: io.StringIO):
16181618
Store the contents of a :class:`io.StringIO` object in a GMT_DATASET container
16191619
and create a virtual file to pass to a GMT module.
16201620
1621+
For simplicity, currently we make following assumptions in the stringio object
1622+
1623+
- ``"#"`` indicates a comment line.
1624+
- ``">"`` indicates a segment header.
1625+
- The object only contains one table and one segment.
1626+
16211627
Parameters
16221628
----------
16231629
stringio
@@ -1633,6 +1639,7 @@ def virtualfile_from_stringio(self, stringio: io.StringIO):
16331639
--------
16341640
>>> import io
16351641
>>> from pygmt.clib import Session
1642+
>>> # A StringIO object containing legend specifications
16361643
>>> stringio = io.StringIO(
16371644
... "# Comment\n"
16381645
... "H 24p Legend\n"
@@ -1648,10 +1655,6 @@ def virtualfile_from_stringio(self, stringio: io.StringIO):
16481655
2 S 0.1i c 0.15i p300/12 0.25p 0.3i My circle
16491656
"""
16501657
# Parse the strings in the io.StringIO object.
1651-
# For simplicity, we make a few assumptions.
1652-
# - "#" indicates a comment line
1653-
# - ">" indicates a segment header
1654-
# - Only one table and one segment
16551658
header = None
16561659
string_arrays = []
16571660
for line in stringio.getvalue().splitlines():

0 commit comments

Comments
 (0)