Skip to content

Commit d5538c6

Browse files
committed
Merge branch 'feature/read' into dep/netcdf
2 parents 337dcb3 + 4dc7974 commit d5538c6

File tree

134 files changed

+2302
-1319
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

134 files changed

+2302
-1319
lines changed

.github/ISSUE_TEMPLATE/4-release_checklist.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ assignees: ''
1111
**Scheduled Date**: 20YY/MM/DD
1212
**Pull request due date**: 20YY/MM/DD
1313
**DOI**: `10.5281/zenodo.XXXXXXX`
14+
**Announcement draft**: https://hackmd.io/@pygmt/xxxxxxxx
1415

1516
**Priority PRs/issues to complete prior to release**
1617

@@ -39,11 +40,15 @@ assignees: ''
3940
- [ ] Edit the draft release notes with the finalized changelog
4041
- [ ] Set the tag version and release title to vX.Y.Z
4142
- [ ] Make a release by clicking the 'Publish Release' button, this will automatically create a tag too
43+
- [ ] Verify that [all workflows triggered by the release](https://github.com/GenericMappingTools/pygmt/actions?query=event%3Arelease) pass
44+
- [ ] The latest version is correct on [PyPI](https://pypi.org/project/pygmt/)
45+
- [ ] The latest version is correct on https://www.pygmt.org/latest/
46+
- [ ] The [release page](https://github.com/GenericMappingTools/pygmt/releases) has five assets, including `baseline-images.zip`, `pygmt-docs.zip` and `pygmt-docs.pdf`
4247
- [ ] Download pygmt-X.Y.Z.zip (rename to pygmt-vX.Y.Z.zip) and baseline-images.zip from the release page, and upload the two zip files to https://zenodo.org/deposit, ensure that they are filed under the correct reserved DOI
4348

4449
**After release**:
4550

46-
- [ ] Update conda-forge [pygmt-feedstock](https://github.com/conda-forge/pygmt-feedstock) [Done automatically by conda-forge's bot. Remember to pin GMT, Python and SPEC0 versions]
51+
- [ ] Update conda-forge [pygmt-feedstock](https://github.com/conda-forge/pygmt-feedstock) (Done automatically by conda-forge's bot. If you don't want to wait, open a new issue in the `conda-forge/pygmt-feedstock` repository with the title `@conda-forge-admin, please update version`. This will trigger the bot immediately. Remember to pin GMT, Python and SPEC0 versions)
4752
- [ ] Bump PyGMT version on https://github.com/GenericMappingTools/try-gmt (after conda-forge update)
4853
- [ ] Announce the release on:
4954
- [ ] GMT [forum](https://forum.generic-mapping-tools.org/c/news/) (do this announcement first! Requires moderator status)

.github/workflows/benchmarks.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ concurrency:
2323
group: ${{ github.workflow }}-${{ github.ref }}
2424
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
2525

26+
permissions: {}
27+
2628
jobs:
2729
benchmarks:
2830
runs-on: ubuntu-latest
@@ -38,6 +40,7 @@ jobs:
3840
with:
3941
# fetch all history so that setuptools-scm works
4042
fetch-depth: 0
43+
persist-credentials: false
4144

4245
- name: Get current week number of year
4346
id: date
@@ -81,7 +84,7 @@ jobs:
8184

8285
# Run the benchmark tests
8386
- name: Run benchmarks
84-
uses: CodSpeedHQ/action@v3.2.0
87+
uses: CodSpeedHQ/action@v3.5.0
8588
with:
8689
# 'bash -el -c' is needed to use the custom shell.
8790
# See https://github.com/CodSpeedHQ/action/issues/65.

.github/workflows/cache_data.yaml

+4-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ on:
2525
schedule:
2626
- cron: '0 12 * * 0'
2727

28+
permissions: {}
29+
2830
jobs:
2931
gmt_cache:
3032
name: Cache GMT artifacts
@@ -40,6 +42,7 @@ jobs:
4042
with:
4143
# fetch all history so that setuptools-scm works
4244
fetch-depth: 0
45+
persist-credentials: false
4346

4447
# Install Micromamba with conda-forge dependencies
4548
- name: Setup Micromamba
@@ -71,7 +74,7 @@ jobs:
7174

7275
# Upload the downloaded files as artifacts to GitHub
7376
- name: Upload artifacts to GitHub
74-
uses: actions/[email protected].0
77+
uses: actions/[email protected].2
7578
with:
7679
name: gmt-cache
7780
include-hidden-files: true

.github/workflows/check-links.yml

+15-7
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Check links in the repository and documentation
22
#
3-
# This workflow runs the lychee tool to check all external links in plaintext
4-
# and HTML files. It will create an issue if broken links are found.
3+
# This workflow runs the lychee tool to check all external links in plaintext and HTML
4+
# files. It will create an issue if broken links are found.
55
#
66
# It is scheduled to run weekly at 12 noon every Sunday.
77
#
@@ -15,6 +15,9 @@ on:
1515
schedule:
1616
- cron: '0 12 * * 0'
1717

18+
permissions:
19+
issues: write
20+
1821
jobs:
1922
check_links:
2023
name: Check Links
@@ -26,16 +29,18 @@ jobs:
2629
uses: actions/[email protected]
2730
with:
2831
path: repository
32+
persist-credentials: false
2933

3034
- name: Checkout the documentation
3135
uses: actions/[email protected]
3236
with:
3337
ref: gh-pages
3438
path: documentation
39+
persist-credentials: false
3540

3641
- name: Link Checker
3742
id: lychee
38-
uses: lycheeverse/lychee-action@v2.3.0
43+
uses: lycheeverse/lychee-action@v2.4.0
3944
with:
4045
fail: false # Don't fail action on broken links
4146
output: /tmp/lychee-out.md
@@ -45,11 +50,14 @@ jobs:
4550
--exclude "^https://docs.generic-mapping-tools.org/6.[0-9]?/%s$"
4651
--exclude "^https://docs.generic-mapping-tools.org/6.[0-9]?/%3Cmodule-name%3E.html$"
4752
--exclude "^https://doi.org"
53+
--exclude "^https://github.com/%7Brepository%7D"
4854
--exclude "^https://github.com/GenericMappingTools/gmt/releases/tag/X.Y.Z$"
4955
--exclude "^https://github.com/GenericMappingTools/pygmt/edit"
5056
--exclude "^https://github.com/GenericMappingTools/pygmt/issues/new"
5157
--exclude "^https://github.com/GenericMappingTools/pygmt/pull/[0-9]*$"
5258
--exclude "^https://github.com/GenericMappingTools/pygmt/issues/[0-9]*$"
59+
--exclude "^https://github.com/GenericMappingTools/pygmt/releases/download/%7B%7Bpath%7D%7D/pygmt-docs.pdf"
60+
--exclude "^https://github.com/GenericMappingTools/pygmt/releases/download/%7B%7Bpath%7D%7D/pygmt-docs.zip"
5361
--exclude "^https://github.com/GenericMappingTools/pygmt/releases/tag/%7B%7Bpath%7D%7D"
5462
--exclude "^https://hackmd.io/@pygmt"
5563
--exclude "^https://test.pypi.org/simple/"
@@ -59,8 +67,7 @@ jobs:
5967
--exclude "^https://www.researchgate.net/"
6068
--exclude "^https://zenodo.org/badge/DOI/"
6169
--verbose
62-
"repository/**/*.rst"
63-
"repository/**/*.md"
70+
"repository/*.md"
6471
"repository/**/*.py"
6572
"documentation/dev/**/*.html"
6673
@@ -69,10 +76,11 @@ jobs:
6976
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
7077

7178
- name: Create Issue From File
72-
if: env.lychee_exit_code != 0
79+
if: steps.lychee.outputs.exit_code != 0
7380
run: |
7481
cd repository/
75-
title="Link Checker Report on ${{ steps.date.outputs.date }}"
82+
title="Link Checker Report on ${CURRENT_DATE}"
7683
gh issue create --title "$title" --body-file /tmp/lychee-out.md
7784
env:
7885
GH_TOKEN: ${{ github.token }}
86+
CURRENT_DATE: ${{ steps.date.outputs.date }}

.github/workflows/ci_docs.yml

+20-8
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,14 @@
22
#
33
# This workflow builds the documentation on Linux/macOS/Windows.
44
#
5-
# It is run on every commit to the main and pull request branches, and also
6-
# when a new release is published.
7-
# In draft pull requests, only the job on Linux is triggered to save on
8-
# Continuous Integration resources.
5+
# It is run on every commit to the main and pull request branches, and also when a new
6+
# release is published. In draft pull requests, only the job on Linux is triggered to
7+
# save on Continuous Integration resources.
98
#
109
# On the main branch, the workflow also handles the documentation deployment:
1110
#
12-
# * Updating the development documentation by pushing the built HTML pages
13-
# from the main branch onto the dev folder of the gh-pages branch.
11+
# * Updating the development documentation by pushing the built HTML pages from the main
12+
# branch onto the dev folder of the gh-pages branch.
1413
# * Updating the latest documentation link to the new release.
1514
#
1615
name: Docs
@@ -43,6 +42,9 @@ concurrency:
4342
group: ${{ github.workflow }}-${{ github.ref }}
4443
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
4544

45+
permissions:
46+
contents: write
47+
4648
jobs:
4749
docs:
4850
name: ${{ matrix.os }}
@@ -73,6 +75,7 @@ jobs:
7375
with:
7476
# fetch all history so that setuptools-scm works
7577
fetch-depth: 0
78+
persist-credentials: false
7679

7780
- name: Get current week number of year
7881
id: date
@@ -110,7 +113,7 @@ jobs:
110113
sphinx-copybutton
111114
sphinx-design
112115
sphinx-gallery
113-
sphinx_rtd_theme<3.0
116+
sphinx_rtd_theme
114117
cairosvg
115118
sphinxcontrib-svg2pdfconverter
116119
tectonic
@@ -146,15 +149,23 @@ jobs:
146149
mv latex/pygmt.pdf pygmt-docs.pdf
147150
cd ../..
148151
152+
- name: Upload PDF as artifact for previewing on pull requests
153+
uses: actions/[email protected]
154+
if: github.event_name == 'pull_request' && matrix.os == 'ubuntu-latest'
155+
with:
156+
name: artifact-pygmt-docs-pdf
157+
path: doc/_build/pygmt-docs.pdf
158+
149159
- name: Copy the HTML ZIP archive and PDF to the html folder for dev version
150160
run: cp -v doc/_build/pygmt-docs.zip doc/_build/pygmt-docs.pdf doc/_build/html/
151161
if: github.event_name == 'push' && matrix.os == 'ubuntu-latest'
152162

153163
- name: Upload the HTML ZIP archive and PDF as release assets
154-
run: gh release upload ${{ github.ref_name }} doc/_build/pygmt-docs.zip doc/_build/pygmt-docs.pdf
164+
run: gh release upload ${REF_NAME} doc/_build/pygmt-docs.zip doc/_build/pygmt-docs.pdf
155165
if: github.event_name == 'release' && matrix.os == 'ubuntu-latest'
156166
env:
157167
GH_TOKEN: ${{ github.token }}
168+
REF_NAME: ${{ github.ref_name }}
158169

159170
- name: Checkout the gh-pages branch
160171
uses: actions/[email protected]
@@ -164,6 +175,7 @@ jobs:
164175
path: deploy
165176
# Download the entire history
166177
fetch-depth: 0
178+
persist-credentials: true
167179
if: (github.event_name == 'release' || github.event_name == 'push') && (matrix.os == 'ubuntu-latest')
168180

169181
- name: Push the built HTML to gh-pages

.github/workflows/ci_doctests.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ concurrency:
1818
group: ${{ github.workflow }}-${{ github.ref }}
1919
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
2020

21+
permissions: {}
22+
2123
jobs:
2224
test:
2325
name: ${{ matrix.os }}
@@ -39,6 +41,7 @@ jobs:
3941
with:
4042
# fetch all history so that setuptools-scm works
4143
fetch-depth: 0
44+
persist-credentials: false
4245

4346
# Install Micromamba with conda-forge dependencies
4447
- name: Setup Micromamba

.github/workflows/ci_tests.yaml

+10-9
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ concurrency:
4949

5050
jobs:
5151
test:
52-
name: ${{ matrix.os }} - Python ${{ matrix.python-version }} / NumPy ${{ matrix.numpy-version }}
52+
name: ${{ matrix.os }} - Python ${{ matrix.python-version }}
5353
runs-on: ${{ matrix.os }}
5454
permissions:
5555
id-token: write # This is required for requesting OIDC token for codecov
@@ -72,16 +72,16 @@ jobs:
7272
include:
7373
# Python 3.11 + core packages (minimum supported versions) + optional packages (minimum supported versions if any)
7474
- python-version: '3.11'
75-
numpy-version: '1.25'
76-
pandas-version: '=2.0'
77-
xarray-version: '=2023.04'
78-
optional-packages: ' contextily geopandas<1 ipython pyarrow-core rioxarray sphinx-gallery'
75+
numpy-version: '1.26'
76+
pandas-version: '=2.1'
77+
xarray-version: '=2023.07'
78+
optional-packages: ' contextily geopandas ipython pyarrow-core rioxarray sphinx-gallery'
7979
# Python 3.13 + core packages (latest versions) + optional packages
8080
- python-version: '3.13'
8181
numpy-version: '2.2'
8282
pandas-version: ''
8383
xarray-version: ''
84-
optional-packages: ' contextily geopandas>=1.0 ipython pyarrow-core rioxarray sphinx-gallery'
84+
optional-packages: ' contextily geopandas ipython pyarrow-core rioxarray sphinx-gallery'
8585
# Python 3.12 + core packages (Linux only)
8686
- os: 'ubuntu-latest'
8787
python-version: '3.12'
@@ -108,6 +108,7 @@ jobs:
108108
with:
109109
# fetch all history so that setuptools-scm works
110110
fetch-depth: 0
111+
persist-credentials: false
111112

112113
- name: Get current week number of year
113114
id: date
@@ -150,7 +151,7 @@ jobs:
150151
GH_TOKEN: ${{ github.token }}
151152

152153
- name: Install uv
153-
uses: astral-sh/setup-uv@v5.2.2
154+
uses: astral-sh/setup-uv@v5.4.1
154155
with:
155156
python-version: ${{ matrix.python-version }}
156157

@@ -173,15 +174,15 @@ jobs:
173174

174175
# Upload diff images on test failure
175176
- name: Upload diff images if any test fails
176-
uses: actions/[email protected].0
177+
uses: actions/[email protected].2
177178
if: failure()
178179
with:
179180
name: artifact-${{ matrix.os }}-${{ matrix.python-version }}
180181
path: tmp-test-dir-with-unique-name
181182

182183
# Upload coverage to Codecov
183184
- name: Upload coverage to Codecov
184-
uses: codecov/codecov-action@v5.3.1
185+
uses: codecov/codecov-action@v5.4.0
185186
if: success() || failure()
186187
with:
187188
use_oidc: true

.github/workflows/ci_tests_dev.yaml

+7-3
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ concurrency:
2828
group: ${{ github.workflow }}-${{ github.ref }}
2929
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
3030

31+
permissions: {}
32+
3133
jobs:
3234
test_gmt_dev:
3335
name: ${{ matrix.os }} - GMT ${{ matrix.gmt_git_ref }}
@@ -50,6 +52,7 @@ jobs:
5052
with:
5153
# fetch all history so that setuptools-scm works
5254
fetch-depth: 0
55+
persist-credentials: false
5356

5457
- name: Get current week number of year
5558
id: date
@@ -96,6 +99,7 @@ jobs:
9699
repository: 'GenericMappingTools/gmt'
97100
ref: ${{ matrix.gmt_git_ref }}
98101
path: 'gmt'
102+
persist-credentials: false
99103

100104
# Build GMT from source on Linux/macOS, script is adapted from
101105
# https://github.com/GenericMappingTools/gmt/blob/6.5.0/ci/build-gmt.sh
@@ -105,7 +109,7 @@ jobs:
105109
mkdir build
106110
cd build
107111
cmake -G Ninja .. \
108-
-DCMAKE_INSTALL_PREFIX=${{ env.GMT_INSTALL_DIR }} \
112+
-DCMAKE_INSTALL_PREFIX=${GMT_INSTALL_DIR} \
109113
-DCMAKE_BUILD_TYPE=Release \
110114
-DGMT_ENABLE_OPENMP=TRUE \
111115
-DGMT_USE_THREADS=TRUE
@@ -125,7 +129,7 @@ jobs:
125129
cd build
126130
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
127131
cmake -G Ninja .. ^
128-
-DCMAKE_INSTALL_PREFIX=${{ env.GMT_INSTALL_DIR }} ^
132+
-DCMAKE_INSTALL_PREFIX=%GMT_INSTALL_DIR% ^
129133
-DCMAKE_BUILD_TYPE=Release ^
130134
-DCMAKE_PREFIX_PATH=${{ env.MAMBA_ROOT_PREFIX }}\envs\pygmt\Library ^
131135
-DGMT_ENABLE_OPENMP=TRUE ^
@@ -182,7 +186,7 @@ jobs:
182186

183187
# Upload diff images on test failure
184188
- name: Upload diff images if any test fails
185-
uses: actions/[email protected].0
189+
uses: actions/[email protected].2
186190
if: ${{ failure() }}
187191
with:
188192
name: artifact-${{ matrix.os }}-GMT-${{ matrix.gmt_git_ref }}

0 commit comments

Comments
 (0)