Skip to content

Commit 7785566

Browse files
authored
Test if is_nonstr_iter works for numpy arrays (#623)
Test if is_nonstr_iter works for numpy numerical and string arrays
1 parent a57685e commit 7785566

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pygmt/helpers/utils.py

+5
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,11 @@ def is_nonstr_iter(value):
172172
True
173173
>>> is_nonstr_iter((1, 2, 3))
174174
True
175+
>>> import numpy as np
176+
>>> is_nonstr_iter(np.array([1.0, 2.0, 3.0]))
177+
True
178+
>>> is_nonstr_iter(np.array(["abc", "def", "ghi"]))
179+
True
175180
176181
"""
177182
return isinstance(value, Iterable) and not isinstance(value, str)

0 commit comments

Comments
 (0)