From f91475d6611999e84c1e65a702db1d65b3e254a8 Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Tue, 5 Nov 2024 11:16:06 +0800 Subject: [PATCH] Support 1-D/2-D numpy arrays with longlong and ulonglong dtype (#3566) --- pygmt/clib/session.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/pygmt/clib/session.py b/pygmt/clib/session.py index 81afe6efb7c..10c8770adaa 100644 --- a/pygmt/clib/session.py +++ b/pygmt/clib/session.py @@ -88,10 +88,12 @@ np.int16: "GMT_SHORT", np.int32: "GMT_INT", np.int64: "GMT_LONG", + np.longlong: "GMT_LONG", np.uint8: "GMT_UCHAR", np.uint16: "GMT_USHORT", np.uint32: "GMT_UINT", np.uint64: "GMT_ULONG", + np.ulonglong: "GMT_ULONG", np.float32: "GMT_FLOAT", np.float64: "GMT_DOUBLE", np.timedelta64: "GMT_LONG", @@ -948,8 +950,9 @@ def put_vector(self, dataset: ctp.c_void_p, column: int, vector: np.ndarray): The dataset must be created by :meth:`pygmt.clib.Session.create_data` first with ``family="GMT_IS_DATASET|GMT_VIA_VECTOR"``. - Not all numpy dtypes are supported, only: int8, int16, int32, int64, uint8, - uint16, uint32, uint64, float32, float64, str\_, and datetime64. + Not all numpy dtypes are supported, only: int8, int16, int32, int64, longlong, + uint8, uint16, uint32, uint64, ulonglong, float32, float64, str\_, datetime64, + and timedelta64. .. warning:: The numpy array must be C contiguous in memory. Use @@ -1060,8 +1063,8 @@ def put_matrix(self, dataset: ctp.c_void_p, matrix: np.ndarray, pad: int = 0): The dataset must be created by :meth:`pygmt.clib.Session.create_data` first with ``family="GMT_IS_DATASET|GMT_VIA_MATRIX"``. - Not all numpy dtypes are supported, only: int8, int16, int32, int64, uint8, - uint16, uint32, uint64, float32, and float64. + Not all numpy dtypes are supported, only: int8, int16, int32, int64, longlong, + uint8, uint16, uint32, uint64, ulonglong, float32, and float64. .. warning:: The numpy array must be C contiguous in memory. Use