Skip to content

Commit

Permalink
clib.Session: Add type hints and format docstrings for some Session m…
Browse files Browse the repository at this point in the history
…ethods (#3530)
  • Loading branch information
seisman authored Oct 19, 2024
1 parent 28bfaf9 commit 510e145
Show file tree
Hide file tree
Showing 2 changed files with 121 additions and 130 deletions.
4 changes: 2 additions & 2 deletions pygmt/clib/conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ def sequence_to_ctypes_array(
return (ctype * size)(*sequence)


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


def array_to_datetime(array: Sequence[Any]) -> np.ndarray:
def array_to_datetime(array: Sequence[Any] | np.ndarray) -> np.ndarray:
"""
Convert a 1-D datetime array from various types into numpy.datetime64.
Expand Down
Loading

0 comments on commit 510e145

Please sign in to comment.