From b7d263588a6a7ef2b5a12676df0ee8e51103156b Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Wed, 24 Jul 2024 15:04:02 +0800 Subject: [PATCH] Session.virtualfile_in: Remove the extra_arrays parameter --- pygmt/clib/session.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pygmt/clib/session.py b/pygmt/clib/session.py index 7e74219937f..a726a013966 100644 --- a/pygmt/clib/session.py +++ b/pygmt/clib/session.py @@ -1605,7 +1605,6 @@ def virtualfile_in( # noqa: PLR0912 x=None, y=None, z=None, - extra_arrays=None, required_z=False, required_data=True, ): @@ -1627,9 +1626,6 @@ def virtualfile_in( # noqa: PLR0912 data input. x/y/z : 1-D arrays or None x, y, and z columns as numpy arrays. - extra_arrays : list of 1-D arrays - Optional. A list of numpy arrays in addition to x, y, and z. - All of these arrays must be of the same size as the x/y/z arrays. required_z : bool State whether the 'z' column is required. required_data : bool @@ -1723,8 +1719,6 @@ def virtualfile_in( # noqa: PLR0912 _data = [np.atleast_1d(x), np.atleast_1d(y)] if z is not None: _data.append(np.atleast_1d(z)) - if extra_arrays: - _data.extend(extra_arrays) case "vectors": if hasattr(data, "items") and not hasattr(data, "to_frame"): # Dict, pandas.DataFrame or xarray.Dataset types. @@ -1757,18 +1751,24 @@ def virtualfile_from_data( instead. """ msg = ( - "API function 'Session.virtualfile_from_datae()' has been deprecated since " + "API function 'Session.virtualfile_from_data()' has been deprecated since " "v0.13.0 and will be removed in v0.15.0. Use 'Session.virtualfile_in()' " "instead." ) warnings.warn(msg, category=FutureWarning, stacklevel=2) + # Session.virtualfile_in no longer has the 'extra_arrays' parameter. + if data is None and extra_arrays is not None: + data = [np.atleast_1d(x), np.atleast_1d(y)] + if z is not None: + data.append(np.atleast_1d(z)) + data.extend(extra_arrays) + x, y, z = None, None, None return self.virtualfile_in( check_kind=check_kind, data=data, x=x, y=y, z=z, - extra_arrays=extra_arrays, required_z=required_z, required_data=required_data, )