We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
put_vector
put_strings
1 parent 6390e04 commit 42af00eCopy full SHA for 42af00e
pygmt/tests/test_clib_put.py
@@ -18,9 +18,13 @@ def test_put_strings():
18
family="GMT_IS_DATASET|GMT_VIA_VECTOR",
19
geometry="GMT_IS_POINT",
20
mode="GMT_CONTAINER_ONLY",
21
- dim=[1, 5, 1, 0], # columns, rows, layers, dtype
+ dim=[2, 5, 1, 0], # columns, rows, layers, dtype
22
)
23
+ x = np.array([1, 2, 3, 4, 5], dtype=np.int32)
24
+ y = np.array([6, 7, 8, 9, 10], dtype=np.int32)
25
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)
28
lib.put_strings(dataset, family="GMT_IS_VECTOR", strings=s)
29
# Turns out wesn doesn't matter for Datasets
30
wesn = [0] * 6
@@ -36,6 +40,7 @@ def test_put_strings():
36
40
37
41
# Load the data and check that it's correct
38
42
news = tmp_file.loadtxt(unpack=True, dtype=np.str)
43
+ print(news)
39
44
npt.assert_allclose(news, s)
45
46
0 commit comments