Skip to content

Commit 63129e5

Browse files
authored
clib: Deprecate API function 'Session.virtualfile_from_data', use 'Session.virtualfile_in' instead (will be removed in v0.15.0) (#3225)
1 parent bfe033b commit 63129e5

File tree

1 file changed

+35
-2
lines changed

1 file changed

+35
-2
lines changed

pygmt/clib/session.py

+35-2
Original file line numberDiff line numberDiff line change
@@ -1644,8 +1644,41 @@ def virtualfile_in( # noqa: PLR0912
16441644

16451645
return file_context
16461646

1647-
# virtualfile_from_data was renamed to virtualfile_in since v0.12.0.
1648-
virtualfile_from_data = virtualfile_in
1647+
def virtualfile_from_data(
1648+
self,
1649+
check_kind=None,
1650+
data=None,
1651+
x=None,
1652+
y=None,
1653+
z=None,
1654+
extra_arrays=None,
1655+
required_z=False,
1656+
required_data=True,
1657+
):
1658+
"""
1659+
Store any data inside a virtual file.
1660+
1661+
.. deprecated: 0.13.0
1662+
1663+
Will be removed in v0.15.0. Use :meth:`pygmt.clib.Session.virtualfile_in`
1664+
instead.
1665+
"""
1666+
msg = (
1667+
"API function 'Session.virtualfile_from_datae()' has been deprecated since "
1668+
"v0.13.0 and will be removed in v0.15.0. Use 'Session.virtualfile_in()' "
1669+
"instead."
1670+
)
1671+
warnings.warn(msg, category=FutureWarning, stacklevel=2)
1672+
return self.virtualfile_in(
1673+
check_kind=check_kind,
1674+
data=data,
1675+
x=x,
1676+
y=y,
1677+
z=z,
1678+
extra_arrays=extra_arrays,
1679+
required_z=required_z,
1680+
required_data=required_data,
1681+
)
16491682

16501683
@contextlib.contextmanager
16511684
def virtualfile_out(

0 commit comments

Comments
 (0)