Skip to content

Commit 510e145

Browse files
authored
clib.Session: Add type hints and format docstrings for some Session methods (#3530)
1 parent 28bfaf9 commit 510e145

File tree

2 files changed

+121
-130
lines changed

2 files changed

+121
-130
lines changed

pygmt/clib/conversion.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ def sequence_to_ctypes_array(
281281
return (ctype * size)(*sequence)
282282

283283

284-
def strings_to_ctypes_array(strings: Sequence[str]) -> ctp.Array:
284+
def strings_to_ctypes_array(strings: Sequence[str] | np.ndarray) -> ctp.Array:
285285
"""
286286
Convert a sequence (e.g., a list) of strings into a ctypes array.
287287
@@ -307,7 +307,7 @@ def strings_to_ctypes_array(strings: Sequence[str]) -> ctp.Array:
307307
return (ctp.c_char_p * len(strings))(*[s.encode() for s in strings])
308308

309309

310-
def array_to_datetime(array: Sequence[Any]) -> np.ndarray:
310+
def array_to_datetime(array: Sequence[Any] | np.ndarray) -> np.ndarray:
311311
"""
312312
Convert a 1-D datetime array from various types into numpy.datetime64.
313313

0 commit comments

Comments
 (0)