Skip to content

Commit cd5b31d

Browse files
committed
Change parameter name vfile to vfname
1 parent aee0499 commit cd5b31d

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

pygmt/clib/session.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -1741,7 +1741,7 @@ def read_virtualfile(
17411741
def virtualfile_to_dataset(
17421742
self,
17431743
output_type: Literal["pandas", "numpy", "file"],
1744-
vfile: str,
1744+
vfname: str,
17451745
column_names: list[str] | None = None,
17461746
) -> pd.DataFrame | np.ndarray | None:
17471747
"""
@@ -1757,7 +1757,7 @@ def virtualfile_to_dataset(
17571757
- ``"pandas"`` will return a :class:`pandas.DataFrame` object.
17581758
- ``"numpy"`` will return a :class:`numpy.ndarray` object.
17591759
- ``"file"`` means the result was saved to a file and will return ``None``.
1760-
vfile
1760+
vfname
17611761
The virtual file name that stores the result data. Required for ``"pandas"``
17621762
and ``"numpy"`` output type.
17631763
column_names
@@ -1795,7 +1795,7 @@ def virtualfile_to_dataset(
17951795
... ) as vouttbl:
17961796
... lib.call_module("read", f"{tmpfile.name} {vouttbl} -Td")
17971797
... result = lib.virtualfile_to_dataset(
1798-
... output_type="file", vfile=vouttbl
1798+
... output_type="file", vfname=vouttbl
17991799
... )
18001800
... assert result is None
18011801
... assert Path(outtmp.name).stat().st_size > 0
@@ -1805,7 +1805,7 @@ def virtualfile_to_dataset(
18051805
... with lib.virtualfile_out(kind="dataset") as vouttbl:
18061806
... lib.call_module("read", f"{tmpfile.name} {vouttbl} -Td")
18071807
... outnp = lib.virtualfile_to_dataset(
1808-
... output_type="numpy", vfile=vouttbl
1808+
... output_type="numpy", vfname=vouttbl
18091809
... )
18101810
... assert isinstance(outnp, np.ndarray)
18111811
...
@@ -1814,7 +1814,7 @@ def virtualfile_to_dataset(
18141814
... with lib.virtualfile_out(kind="dataset") as vouttbl:
18151815
... lib.call_module("read", f"{tmpfile.name} {vouttbl} -Td")
18161816
... outpd = lib.virtualfile_to_dataset(
1817-
... output_type="pandas", vfile=vouttbl
1817+
... output_type="pandas", vfname=vouttbl
18181818
... )
18191819
... assert isinstance(outpd, pd.DataFrame)
18201820
...
@@ -1824,7 +1824,7 @@ def virtualfile_to_dataset(
18241824
... lib.call_module("read", f"{tmpfile.name} {vouttbl} -Td")
18251825
... outpd2 = lib.virtualfile_to_dataset(
18261826
... output_type="pandas",
1827-
... vfile=vouttbl,
1827+
... vfname=vouttbl,
18281828
... column_names=["col1", "col2", "col3", "coltext"],
18291829
... )
18301830
... assert isinstance(outpd2, pd.DataFrame)
@@ -1850,7 +1850,7 @@ def virtualfile_to_dataset(
18501850
return None
18511851

18521852
# 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()
18541854
if output_type == "numpy": # numpy.ndarray output
18551855
return result.to_numpy()
18561856

0 commit comments

Comments
 (0)