@@ -1741,7 +1741,7 @@ def read_virtualfile(
1741
1741
def virtualfile_to_dataset (
1742
1742
self ,
1743
1743
output_type : Literal ["pandas" , "numpy" , "file" ],
1744
- vfile : str ,
1744
+ vfname : str ,
1745
1745
column_names : list [str ] | None = None ,
1746
1746
) -> pd .DataFrame | np .ndarray | None :
1747
1747
"""
@@ -1757,7 +1757,7 @@ def virtualfile_to_dataset(
1757
1757
- ``"pandas"`` will return a :class:`pandas.DataFrame` object.
1758
1758
- ``"numpy"`` will return a :class:`numpy.ndarray` object.
1759
1759
- ``"file"`` means the result was saved to a file and will return ``None``.
1760
- vfile
1760
+ vfname
1761
1761
The virtual file name that stores the result data. Required for ``"pandas"``
1762
1762
and ``"numpy"`` output type.
1763
1763
column_names
@@ -1795,7 +1795,7 @@ def virtualfile_to_dataset(
1795
1795
... ) as vouttbl:
1796
1796
... lib.call_module("read", f"{tmpfile.name} {vouttbl} -Td")
1797
1797
... result = lib.virtualfile_to_dataset(
1798
- ... output_type="file", vfile =vouttbl
1798
+ ... output_type="file", vfname =vouttbl
1799
1799
... )
1800
1800
... assert result is None
1801
1801
... assert Path(outtmp.name).stat().st_size > 0
@@ -1805,7 +1805,7 @@ def virtualfile_to_dataset(
1805
1805
... with lib.virtualfile_out(kind="dataset") as vouttbl:
1806
1806
... lib.call_module("read", f"{tmpfile.name} {vouttbl} -Td")
1807
1807
... outnp = lib.virtualfile_to_dataset(
1808
- ... output_type="numpy", vfile =vouttbl
1808
+ ... output_type="numpy", vfname =vouttbl
1809
1809
... )
1810
1810
... assert isinstance(outnp, np.ndarray)
1811
1811
...
@@ -1814,7 +1814,7 @@ def virtualfile_to_dataset(
1814
1814
... with lib.virtualfile_out(kind="dataset") as vouttbl:
1815
1815
... lib.call_module("read", f"{tmpfile.name} {vouttbl} -Td")
1816
1816
... outpd = lib.virtualfile_to_dataset(
1817
- ... output_type="pandas", vfile =vouttbl
1817
+ ... output_type="pandas", vfname =vouttbl
1818
1818
... )
1819
1819
... assert isinstance(outpd, pd.DataFrame)
1820
1820
...
@@ -1824,7 +1824,7 @@ def virtualfile_to_dataset(
1824
1824
... lib.call_module("read", f"{tmpfile.name} {vouttbl} -Td")
1825
1825
... outpd2 = lib.virtualfile_to_dataset(
1826
1826
... output_type="pandas",
1827
- ... vfile =vouttbl,
1827
+ ... vfname =vouttbl,
1828
1828
... column_names=["col1", "col2", "col3", "coltext"],
1829
1829
... )
1830
1830
... assert isinstance(outpd2, pd.DataFrame)
@@ -1850,7 +1850,7 @@ def virtualfile_to_dataset(
1850
1850
return None
1851
1851
1852
1852
# Read the virtual file as a GMT dataset and convert to pandas.DataFrame
1853
- result = self .read_virtualfile (vfile , kind = "dataset" ).contents .to_dataframe ()
1853
+ result = self .read_virtualfile (vfname , kind = "dataset" ).contents .to_dataframe ()
1854
1854
if output_type == "numpy" : # numpy.ndarray output
1855
1855
return result .to_numpy ()
1856
1856
0 commit comments