Skip to content

_to_string: Fix the bug when a 2-D sequence is passed #4032

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 1 commit into from
Jul 31, 2025
Merged

Conversation

seisman
Copy link
Member

@seisman seisman commented Jul 30, 2025

Patches #3986.

When a 2-D sequence is passed to _to_string, we expect it to return a sequence of strings, and each element is the joined string of the 1-D sequence, but currently, _to_string always returns a string for this case. For example,

>>> from pygmt.alias import _to_string
>>> _to_string([[1, 2], [3, 4]], separator="/", ndim=2)
"['1/2', '3/4']"

The expected output is ['1/2', '3/4'].

This PR fixes the bug.

@seisman seisman added this to the 0.17.0 milestone Jul 30, 2025
@seisman seisman added bug Something isn't working needs review This PR has higher priority and needs review. labels Jul 30, 2025
@seisman seisman removed the needs review This PR has higher priority and needs review. label Jul 31, 2025
@seisman seisman merged commit 6c37041 into main Jul 31, 2025
33 of 37 checks passed
@seisman seisman deleted the fix/_to_stringg branch July 31, 2025 02:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants