From 2c59326fef0aba74f060e26cd922e308c595b340 Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Tue, 5 Nov 2024 15:44:18 +0800 Subject: [PATCH] Add docs for the supported numeric dtypes --- doc/techref/array_dtypes.md | 35 +++++++++++++++++++++++++++++++++++ doc/techref/index.md | 1 + 2 files changed, 36 insertions(+) create mode 100644 doc/techref/array_dtypes.md diff --git a/doc/techref/array_dtypes.md b/doc/techref/array_dtypes.md new file mode 100644 index 00000000000..6d9584b7d36 --- /dev/null +++ b/doc/techref/array_dtypes.md @@ -0,0 +1,35 @@ +# Supported Array Dtypes + +PyGMT uses NumPy arrays to store data and passes them to the GMT C library. In this way, +PyGMT can support a wide range of dtypes. This page documents array dtypes supported by +PyGMT. + +## Numeric Dtypes + +For 1-D and 2-D arrays, PyGMT supports most numeric dtypes provided by NumPy, pandas, and +PyArrow. + +**Signed Integers:** + +- `numpy.int8`, `numpy.int16`, `numpy.int32`, `numpy.int64` +- `pandas.Int8`, `pandas.Int16`, `pandas.Int32`, `pandas.Int64` +- `pyarrow.int8`, `pyarrow.int16`, `pyarrow.int32`, `pyarrow.int64` + +**Unsigned Integers:** + +- `numpy.uint8`, `numpy.uint16`, `numpy.uint32`, `numpy.uint64` +- `pandas.UInt8`, `pandas.UInt16`, `pandas.UInt32`, `pandas.UInt64` +- `pyarrow.uint8`, `pyarrow.uint16`, `pyarrow.uint32`, `pyarrow.uint64` + +**Floating-point numbers:** + +- `numpy.float32`, `numpy.float64` +- `pandas.Float32`, `pandas.Float64` +- `pyarrow.float32`, `pyarrow.float64` + +For 3-D {class}`xarray.DataArray` objects representing raster images, only 8-bit unsigned +intergers (i.e., `numpy.uint8`) are supported. + +## String Dtypes + +## Datetime Dtypes diff --git a/doc/techref/index.md b/doc/techref/index.md index bbba3ead6b4..96e75e0b493 100644 --- a/doc/techref/index.md +++ b/doc/techref/index.md @@ -8,6 +8,7 @@ visit the {gmt-docs}`GMT Technical Reference `. ```{toctree} :maxdepth: 1 +array_dtypes.md projections.md fonts.md patterns.md