Skip to content

clib: Fix the bug when passing multiple columns of strings with variable lengths to the GMT C API #2719

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 9, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions pygmt/clib/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -1291,9 +1291,7 @@ def virtualfile_from_vectors(self, *vectors):
if len(string_arrays) == 1:
strings = string_arrays[0]
elif len(string_arrays) > 1:
strings = np.apply_along_axis(
func1d=" ".join, axis=0, arr=string_arrays
)
strings = np.array([" ".join(vals) for vals in zip(*string_arrays)])
strings = np.asanyarray(a=strings, dtype=str)
self.put_strings(
dataset, family="GMT_IS_VECTOR|GMT_IS_DUPLICATE", strings=strings
Expand Down