Skip to content

Commit

Permalink
Improve docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
seisman committed Sep 13, 2024
1 parent 97bbe05 commit dece315
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions pygmt/clib/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -1618,6 +1618,12 @@ def virtualfile_from_stringio(self, stringio: io.StringIO):
Store the contents of a :class:`io.StringIO` object in a GMT_DATASET container
and create a virtual file to pass to a GMT module.
For simplicity, currently we make following assumptions in the stringio object
- ``"#"`` indicates a comment line.
- ``">"`` indicates a segment header.
- The object only contains one table and one segment.
Parameters
----------
stringio
Expand All @@ -1633,6 +1639,7 @@ def virtualfile_from_stringio(self, stringio: io.StringIO):
--------
>>> import io
>>> from pygmt.clib import Session
>>> # A StringIO object containing legend specifications
>>> stringio = io.StringIO(
... "# Comment\n"
... "H 24p Legend\n"
Expand All @@ -1648,10 +1655,6 @@ def virtualfile_from_stringio(self, stringio: io.StringIO):
2 S 0.1i c 0.15i p300/12 0.25p 0.3i My circle
"""
# Parse the strings in the io.StringIO object.
# For simplicity, we make a few assumptions.
# - "#" indicates a comment line
# - ">" indicates a segment header
# - Only one table and one segment
header = None
string_arrays = []
for line in stringio.getvalue().splitlines():
Expand Down

0 comments on commit dece315

Please sign in to comment.