Skip to content

Commit 42af00e

Browse files
committed
Do put_vector x and y before put_strings s, dim is 2 only
1 parent 6390e04 commit 42af00e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

pygmt/tests/test_clib_put.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,13 @@ def test_put_strings():
1818
family="GMT_IS_DATASET|GMT_VIA_VECTOR",
1919
geometry="GMT_IS_POINT",
2020
mode="GMT_CONTAINER_ONLY",
21-
dim=[1, 5, 1, 0], # columns, rows, layers, dtype
21+
dim=[2, 5, 1, 0], # columns, rows, layers, dtype
2222
)
23+
x = np.array([1, 2, 3, 4, 5], dtype=np.int32)
24+
y = np.array([6, 7, 8, 9, 10], dtype=np.int32)
2325
s = np.array(["a", "b", "c", "d", "e"], dtype=np.str)
26+
lib.put_vector(dataset, column=lib["GMT_X"], vector=x)
27+
lib.put_vector(dataset, column=lib["GMT_Y"], vector=y)
2428
lib.put_strings(dataset, family="GMT_IS_VECTOR", strings=s)
2529
# Turns out wesn doesn't matter for Datasets
2630
wesn = [0] * 6
@@ -36,6 +40,7 @@ def test_put_strings():
3640
)
3741
# Load the data and check that it's correct
3842
news = tmp_file.loadtxt(unpack=True, dtype=np.str)
43+
print(news)
3944
npt.assert_allclose(news, s)
4045

4146

0 commit comments

Comments
 (0)