From c826b6b2614c8aa35f1cec6b0e4e33e0b7534a8c Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Mon, 6 May 2024 08:45:12 +0800 Subject: [PATCH 1/4] CI: Unpin NumPy in the "GMT Dev Tests" workflow (#3208)" This reverts commit 8605895eea8530d418f84c6ba4a7fe9368a9a139. --- .github/workflows/ci_tests_dev.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci_tests_dev.yaml b/.github/workflows/ci_tests_dev.yaml index 7e1fd7a7763..0d86f32162f 100644 --- a/.github/workflows/ci_tests_dev.yaml +++ b/.github/workflows/ci_tests_dev.yaml @@ -120,7 +120,7 @@ jobs: run: | python -m pip install --pre --prefer-binary \ --extra-index https://pypi.anaconda.org/scientific-python-nightly-wheels/simple \ - 'numpy<2' pandas xarray netCDF4 packaging \ + numpy pandas xarray netCDF4 packaging \ build contextily dvc geopandas ipython pyarrow rioxarray \ 'pytest>=6.0' pytest-cov pytest-doctestplus pytest-mpl \ sphinx-gallery From 3fc015642a332ed3735df1435296cf8e1de1e8fe Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Mon, 17 Jun 2024 00:28:01 +0800 Subject: [PATCH 2/4] Use NumPy 2.0 --- .github/workflows/ci_tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci_tests.yaml b/.github/workflows/ci_tests.yaml index 5ce46dd2e93..ea166672193 100644 --- a/.github/workflows/ci_tests.yaml +++ b/.github/workflows/ci_tests.yaml @@ -75,7 +75,7 @@ jobs: xarray-version: '=2022.06' optional-packages: '' - python-version: '3.12' - numpy-version: '1.26' + numpy-version: '2.0' pandas-version: '' xarray-version: '' optional-packages: ' contextily geopandas ipython pyarrow rioxarray sphinx-gallery' From 92a69e0a9c40d212f02c750f3780c663ca62508a Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Mon, 17 Jun 2024 18:21:37 +0800 Subject: [PATCH 3/4] Revert "Use NumPy 2.0" This reverts commit 3fc015642a332ed3735df1435296cf8e1de1e8fe. --- .github/workflows/ci_tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci_tests.yaml b/.github/workflows/ci_tests.yaml index fbc15a92612..220e1f1e03b 100644 --- a/.github/workflows/ci_tests.yaml +++ b/.github/workflows/ci_tests.yaml @@ -75,7 +75,7 @@ jobs: xarray-version: '=2022.06' optional-packages: '' - python-version: '3.12' - numpy-version: '2.0' + numpy-version: '1.26' pandas-version: '' xarray-version: '' optional-packages: ' contextily geopandas ipython pyarrow rioxarray sphinx-gallery' From 62194d95e1fc8cacb2aee5f29a3836e1e869eee2 Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Mon, 17 Jun 2024 18:29:31 +0800 Subject: [PATCH 4/4] dataarray_to_matrix: Make sure that the returned region/inc is a list of scalar values --- pygmt/clib/conversion.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pygmt/clib/conversion.py b/pygmt/clib/conversion.py index eb8daa61da1..95f2f08aa51 100644 --- a/pygmt/clib/conversion.py +++ b/pygmt/clib/conversion.py @@ -124,6 +124,8 @@ def dataarray_to_matrix(grid): grid = grid.sortby(variables=list(grid.dims), ascending=True) matrix = as_c_contiguous(grid[::-1].to_numpy()) + region = [float(i) for i in region] + inc = [float(i) for i in inc] return matrix, region, inc