Skip to content

Commit 9f30479

Browse files
committed
Deal with nested lists/tuples
1 parent 69b681a commit 9f30479

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pygmt/clib/session.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
from pygmt.helpers import (
3131
_validate_data_input,
3232
data_kind,
33+
is_nonstr_iter,
3334
tempfile_from_geojson,
3435
tempfile_from_image,
3536
)
@@ -1730,6 +1731,9 @@ def virtualfile_in( # noqa: PLR0912
17301731
# Dict, pandas.DataFrame or xarray.Dataset types.
17311732
# pandas.Series will be handled below like a 1-D numpy.ndarray.
17321733
_data = [array for _, array in data.items()]
1734+
elif is_nonstr_iter(data) and all(is_nonstr_iter(arr) for arr in data):
1735+
# Nested sequences (list/tuple)
1736+
_data = data
17331737
else:
17341738
# Python list, tuple, and pandas.Series types
17351739
_data = np.atleast_2d(np.asanyarray(data).T)

0 commit comments

Comments
 (0)