@@ -1738,7 +1738,7 @@ def read_virtualfile(
1738
1738
dtype = {"dataset" : _GMT_DATASET , "grid" : _GMT_GRID }[kind ]
1739
1739
return ctp .cast (pointer , ctp .POINTER (dtype ))
1740
1740
1741
- def return_dataset (
1741
+ def virtualfile_to_dataset (
1742
1742
self ,
1743
1743
output_type : Literal ["pandas" , "numpy" , "file" ],
1744
1744
vfile : str ,
@@ -1794,7 +1794,7 @@ def return_dataset(
1794
1794
... kind="dataset", fname=outtmp.name
1795
1795
... ) as vouttbl:
1796
1796
... lib.call_module("read", f"{tmpfile.name} {vouttbl} -Td")
1797
- ... result = lib.return_dataset (
1797
+ ... result = lib.virtualfile_to_dataset (
1798
1798
... output_type="file", vfile=vouttbl
1799
1799
... )
1800
1800
... assert result is None
@@ -1804,21 +1804,25 @@ def return_dataset(
1804
1804
... with Session() as lib:
1805
1805
... with lib.virtualfile_out(kind="dataset") as vouttbl:
1806
1806
... lib.call_module("read", f"{tmpfile.name} {vouttbl} -Td")
1807
- ... outnp = lib.return_dataset(output_type="numpy", vfile=vouttbl)
1807
+ ... outnp = lib.virtualfile_to_dataset(
1808
+ ... output_type="numpy", vfile=vouttbl
1809
+ ... )
1808
1810
... assert isinstance(outnp, np.ndarray)
1809
1811
...
1810
1812
... # pandas output
1811
1813
... with Session() as lib:
1812
1814
... with lib.virtualfile_out(kind="dataset") as vouttbl:
1813
1815
... lib.call_module("read", f"{tmpfile.name} {vouttbl} -Td")
1814
- ... outpd = lib.return_dataset(output_type="pandas", vfile=vouttbl)
1816
+ ... outpd = lib.virtualfile_to_dataset(
1817
+ ... output_type="pandas", vfile=vouttbl
1818
+ ... )
1815
1819
... assert isinstance(outpd, pd.DataFrame)
1816
1820
...
1817
1821
... # pandas output with specified column names
1818
1822
... with Session() as lib:
1819
1823
... with lib.virtualfile_out(kind="dataset") as vouttbl:
1820
1824
... lib.call_module("read", f"{tmpfile.name} {vouttbl} -Td")
1821
- ... outpd2 = lib.return_dataset (
1825
+ ... outpd2 = lib.virtualfile_to_dataset (
1822
1826
... output_type="pandas",
1823
1827
... vfile=vouttbl,
1824
1828
... column_names=["col1", "col2", "col3", "coltext"],
0 commit comments