Skip to content

Commit af3ea38

Browse files
committed
Change the way converting matrix to a list of arrays
1 parent d75eb78 commit af3ea38

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pygmt/clib/session.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1745,14 +1745,14 @@ def virtualfile_in( # noqa: PLR0912
17451745
else:
17461746
# Python list, tuple, and pandas.Series types
17471747
_data = np.atleast_2d(np.asanyarray(data).T)
1748-
elif kind == "matrix":
1748+
elif kind == "matrix": # 2-D numpy.ndarray
17491749
if data.dtype.kind in "iuf":
17501750
# virtualfile_from_matrix only support 2-D numpy.ndarray which are
17511751
# signed integer (i), unsigned integer (u) or floating point (f) types
17521752
_data = (data,)
1753-
else: # turn 2-D numpy.ndarray into list of vectors
1753+
else: # turn 2-D numpy.ndarray into list of arrays
17541754
_virtualfile_from = self.virtualfile_from_vectors
1755-
_data = np.atleast_2d(np.asanyarray(data).T)
1755+
_data = list(data.T)
17561756

17571757
# Finally create the virtualfile from the data, to be passed into GMT
17581758
file_context = _virtualfile_from(*_data)

0 commit comments

Comments
 (0)