Skip to content

Commit 3161963

Browse files
committed
Update docstrings
1 parent 640e9a9 commit 3161963

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pygmt/clib/session.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1618,11 +1618,10 @@ 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
1621+
For simplicity, currently we make following assumptions in the StringIO object
16221622
16231623
- ``"#"`` indicates a comment line.
16241624
- ``">"`` indicates a segment header.
1625-
- The object only contains one table.
16261625
16271626
Parameters
16281627
----------
@@ -1654,7 +1653,7 @@ def virtualfile_from_stringio(self, stringio: io.StringIO):
16541653
1 N 2
16551654
2 S 0.1i c 0.15i p300/12 0.25p 0.3i My circle
16561655
"""
1657-
# Parse the strings in the io.StringIO object.
1656+
# Parse the io.StringIO object.
16581657
segments = []
16591658
current_segment = {"header": "", "data": []}
16601659
for line in stringio.getvalue().splitlines():
@@ -1664,7 +1663,7 @@ def virtualfile_from_stringio(self, stringio: io.StringIO):
16641663
if current_segment["data"]: # If we have data, start a new segment
16651664
segments.append(current_segment)
16661665
current_segment = {"header": "", "data": []}
1667-
current_segment["header"] = line.strip(">").strip()
1666+
current_segment["header"] = line.strip(">").lstrip()
16681667
else:
16691668
current_segment["data"].append(line)
16701669
if current_segment["data"]: # Add the last segment if it has data
@@ -1676,6 +1675,7 @@ def virtualfile_from_stringio(self, stringio: io.StringIO):
16761675
n_rows = sum(len(segment["data"]) for segment in segments)
16771676
n_columns = 0
16781677

1678+
# Create the GMT_DATASET container
16791679
family, geometry = "GMT_IS_DATASET", "GMT_IS_TEXT"
16801680
dataset = self.create_data(
16811681
family,

0 commit comments

Comments
 (0)