You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Consistent way to specify numpy dtype across the PyGMT codebase #3547
There are many different ways to specify the dtype argument in NumPy arrays, for example:
Using NumPy types (e.g., dtype=np.int32, dtype=np.float64)
Using strings (e.g., dtype="int32", dtype="float64")
Using Python builtin types (e.g, dtype=int, dtype=float)
Using NumPy Array-protocol type strings (e.g., dtype='i4')
maybe more
Currently, we're using both 1 and 2 (i.e., np.int32 and "int32") across the PyGMT codebase. It would be better if we could consistently use only one way, which can improve code maintainability and also reduce confusion for new contributors/maintainers.
I think "NumPy dtypes" like np.int32 is better:
Makes the code more readable by clearly indicating that the type is a NumPy-specific data type
Activity