Skip to content

Commit 7b00248

Browse files
committed
Reduce diff from messy revert handling
1 parent a927202 commit 7b00248

File tree

2 files changed

+16
-17
lines changed

2 files changed

+16
-17
lines changed

pygmt/clib/session.py

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1001,31 +1001,30 @@ def put_vector(self, dataset: ctp.c_void_p, column: int, vector: np.ndarray):
10011001

10021002
def put_strings(self, dataset: ctp.c_void_p, family: str, strings: np.ndarray):
10031003
"""
1004-
Attach a numpy 1-D array of dtype str as a column on a GMT dataset.
1004+
Attach a 1-D numpy array of dtype str as a column on a GMT dataset.
10051005
1006-
Use this function to attach string type numpy array data to a GMT
1007-
dataset and pass it to GMT modules. Wraps ``GMT_Put_Strings``.
1006+
Use this function to attach string type numpy array data to a GMT dataset and
1007+
pass it to GMT modules. Wraps ``GMT_Put_Strings``.
10081008
1009-
The dataset must be created by :meth:`pygmt.clib.Session.create_data`
1010-
first.
1009+
The dataset must be created by :meth:`pygmt.clib.Session.create_data` first.
10111010
10121011
.. warning::
1013-
The numpy array must be C contiguous in memory. If it comes from a
1014-
column slice of a 2-D array, for example, you will have to make a
1015-
copy. Use :func:`numpy.ascontiguousarray` to make sure your vector
1016-
is contiguous (it won't copy if it already is).
1012+
The numpy array must be C contiguous in memory. If it comes from a column
1013+
slice of a 2-D array, for example, you will have to make a copy. Use
1014+
:func:`numpy.ascontiguousarray` to make sure your vector is contiguous (it
1015+
won't copy if it already is).
10171016
10181017
Parameters
10191018
----------
1020-
dataset : :class:`ctypes.c_void_p`
1021-
The ctypes void pointer to a ``GMT_Dataset``. Create it with
1022-
:meth:`pygmt.clib.Session.create_data`.
1023-
family : str
1019+
dataset
1020+
The ctypes void pointer to a ``GMT_VECTOR``/``GMT_MATRIX`` data container.
1021+
Create it with :meth:`pygmt.clib.Session.create_data`.
1022+
family
10241023
The family type of the dataset. Can be either ``GMT_IS_VECTOR`` or
10251024
``GMT_IS_MATRIX``.
1026-
strings : numpy 1-D array
1027-
The array that will be attached to the dataset. Must be a 1-D C
1028-
contiguous array.
1025+
strings
1026+
The array that will be attached to the dataset. Must be a 1-D C contiguous
1027+
array.
10291028
10301029
Raises
10311030
------

pygmt/tests/test_clib_put_strings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def test_put_strings():
2424
)
2525
x = np.array([1, 2, 3, 4, 5], dtype=np.int32)
2626
y = np.array([6, 7, 8, 9, 10], dtype=np.int32)
27-
strings = np.array(["a", "bc", "defg", "hijklmn", "opqrst"], dtype=str)
27+
strings = np.array(["a", "bc", "defg", "hijklmn", "opqrst"], dtype=np.str_)
2828
lib.put_vector(dataset, column=lib["GMT_X"], vector=x)
2929
lib.put_vector(dataset, column=lib["GMT_Y"], vector=y)
3030
lib.put_strings(

0 commit comments

Comments
 (0)