Skip to content

Commit 07fbca6

Browse files
committed
Merge branch 'main' into pyarrow/string
2 parents 4c4e064 + 1d7cf5c commit 07fbca6

File tree

525 files changed

+12353
-7343
lines changed

Some content is hidden

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

525 files changed

+12353
-7343
lines changed

.github/ISSUE_TEMPLATE/bug_report.yaml renamed to .github/ISSUE_TEMPLATE/1-bug_report.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ body:
2323
For more details, check out:
2424
2525
- [Minimal Complete Verifiable Examples](https://stackoverflow.com/help/mcve)
26-
- [Craft Minimal Bug Reports](http://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports)
26+
- [Craft Minimal Bug Reports](https://matthewrocklin.com/minimal-bug-reports)
2727
2828
placeholder: "PASTE CODE HERE"
2929
render: python

.github/ISSUE_TEMPLATE/release_checklist.md renamed to .github/ISSUE_TEMPLATE/4-release_checklist.md

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,46 +8,51 @@ assignees: ''
88
---
99

1010
**Release**: [v0.x.x](https://github.com/GenericMappingTools/pygmt/milestones/?)
11-
**Scheduled Date**: YYYY/MM/DD
12-
**Pull request due date**: YYYY/MM/DD
11+
**Scheduled Date**: 20YY/MM/DD
12+
**Pull request due date**: 20YY/MM/DD
13+
**DOI**: `10.5281/zenodo.XXXXXXX`
1314

1415
**Priority PRs/issues to complete prior to release**
16+
1517
- [ ] Wrap X ()
1618
- [ ] Wrap Y ()
1719

1820
**Before release**:
19-
- [ ] Check [NEP29](https://numpy.org/neps/nep-0029-deprecation_policy.html) to see if we need to bump the minimum Python and NumPy versions
20-
- [ ] Run `make codespell` to check common misspellings. If there are any, either fix them or add them to `ignore-words-list` in `pyproject.toml`
21+
22+
- [ ] Check [SPEC 0](https://scientific-python.org/specs/spec-0000/) to see if we need to bump the minimum supported versions of GMT, Python and core package dependencies (NumPy/Pandas/Xarray)
23+
- [ ] Review the ["PyGMT Team" page](https://www.pygmt.org/dev/team.html)
2124
- [ ] Check to ensure that:
25+
- [ ] Deprecations and related tests are removed for this version by running `grep --include="*.py" -r vX.Y.Z` from the base of the repository
2226
- [ ] All tests pass in the ["GMT Legacy Tests" workflow](https://github.com/GenericMappingTools/pygmt/actions/workflows/ci_tests_legacy.yaml)
2327
- [ ] All tests pass in the ["GMT Dev Tests" workflow](https://github.com/GenericMappingTools/pygmt/actions/workflows/ci_tests_dev.yaml)
24-
- [ ] Deprecations and related tests are removed for this version by running `grep --include="*.py" -r 'remove_version="vX.Y.Z"' pygmt` from the base of the repository
28+
- [ ] All tests pass in the ["Doctests" workflow](https://github.com/GenericMappingTools/pygmt/actions/workflows/ci_doctests.yaml)
29+
- [ ] Update warnings in `pygmt/_show_versions.py` as well as notes in
30+
[Not working transparency](https://www.pygmt.org/dev/install.html#not-working-transparency)
31+
regarding GMT-Ghostscript incompatibility
2532
- [ ] Reserve a DOI on [Zenodo](https://zenodo.org) by clicking on "New Version"
26-
- [ ] Finish up 'Changelog entry for v0.x.x' Pull Request:
27-
- [ ] Add a new entry in `doc/_static/version_switch.js` for documentation switcher
28-
- [ ] Update `CITATION.cff` and BibTeX at https://github.com/GenericMappingTools/pygmt#citing-pygmt
29-
- [ ] Update authorship list
30-
- [ ] Update DOI (and url for BibTeX)
31-
- [ ] Update version
32-
- [ ] Update date released
33-
- [ ] Add the documentation link https://github.com/GenericMappingTools/pygmt#compatibility-with-gmtpythonnumpy-versions
34-
- [ ] Add compatibility information https://github.com/GenericMappingTools/pygmt#compatibility-with-gmtpythonnumpy-versions
35-
- [ ] Copy draft changelog from Release Drafter and edit it to look nice ([see maintainers guide for details](https://www.pygmt.org/dev/maintenance.html#updating-the-changelog))
33+
- [ ] Finish up the "Changelog entry for v0.x.x" Pull Request (Use the previous changelog PR as a reference)
34+
- [ ] Run `make codespell` to check common misspellings. If there are any, either fix them or add them to `ignore-words-list` in `pyproject.toml`
35+
- [ ] Draft the announcement on https://hackmd.io/@pygmt
3636

3737
**Release**:
38+
3839
- [ ] At the [PyGMT release page on GitHub](https://github.com/GenericMappingTools/pygmt/releases):
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
42-
- [ ] Manually upload the pygmt-vX.Y.Z.zip and baseline-images.zip files to https://zenodo.org/deposit, ensure that it is filed under the correct reserved DOI
43+
- [ ] Download pygmt-X.Y.Z.zip (rename to pygmt-vX.Y.Z.zip) and baseline-images.zip from
44+
the release page, and upload the two zip files to https://zenodo.org/deposit,
45+
ensure that they are filed under the correct reserved DOI
4346

4447
**After release**:
45-
- [ ] Update conda-forge [pygmt-feedstock](https://github.com/conda-forge/pygmt-feedstock) [Done automatically by conda-forge's bot, but remember to pin NEP29 versions]
48+
49+
- [ ] Update conda-forge [pygmt-feedstock](https://github.com/conda-forge/pygmt-feedstock)
50+
[Done automatically by conda-forge's bot. Remember to pin Python and SPEC0 versions]
4651
- [ ] Bump PyGMT version on https://github.com/GenericMappingTools/try-gmt (after conda-forge update)
4752
- [ ] Announce the release on:
48-
- [ ] GMT [forum](https://forum.generic-mapping-tools.org/c/news/) (do this announcement first! draft on https://hackmd.io/@pygmt. requires moderator status)
53+
- [ ] GMT [forum](https://forum.generic-mapping-tools.org/c/news/) (do this announcement first! Requires moderator status)
4954
- [ ] [ResearchGate](https://www.researchgate.net) (after forum announcement, add new version as research item via the **code** category, be sure to include the corresponding new Zenodo DOI)
50-
- [ ] [Twitter](https://twitter.com/gmt_dev) (after forum announcement)
55+
5156
---
5257

5358
- [ ] Party :tada: (don't tick before all other checkboxes are ticked!)

.github/ISSUE_TEMPLATE/bump_gmt_checklist.md renamed to .github/ISSUE_TEMPLATE/5-bump_gmt_checklist.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ assignees: ''
77

88
---
99

10-
:tada: [GMT X.Y.Z](https://github.com/GenericMappingTools/gmt/releases/tag/X.Y.Z) has been released! It is installable from the
11-
[conda-forge channel](https://anaconda.org/conda-forge/gmt/files) using the following command:
10+
:tada: [GMT X.Y.Z](https://github.com/GenericMappingTools/gmt/releases/tag/X.Y.Z) has been released!
11+
It is installable from the [conda-forge channel](https://anaconda.org/conda-forge/gmt/files)
12+
using the following command:
1213

1314
`mamba install -c conda-forge gmt=X.Y.Z`
1415

@@ -28,14 +29,15 @@ assignees: ''
2829
- [ ] Update GMT 6.x minor version for `extlinks` urls in `doc/conf.py`
2930
- [ ] Update GMT 6.x minor version in `.github/workflows/check-links.yml`
3031
- [ ] Fix failing tests (1 or more PRs)
32+
- [ ] Fix failing doctests reported in the ["Doctest" workflow](https://github.com/GenericMappingTools/pygmt/actions/workflows/ci_doctests.yaml)
3133
- [ ] Fix [xfail](https://docs.pytest.org/en/stable/skipping.html#xfail-mark-test-functions-as-expected-to-fail) pytest markers on tests that are now xpass
3234

3335
**To-Do for bumping the minimum required GMT version**:
3436

3537
- [ ] Bump the minimum required GMT version (1 PR)
36-
- [ ] Update `required_version` in `pygmt/clib/session.py`
38+
- [ ] Update `required_gmt_version` in `pygmt/clib/__init__.py`
3739
- [ ] Update `test_get_default` in `pygmt/tests/test_clib.py`
38-
- [ ] Update compatibility table in `README.rst`
40+
- [ ] Update minimum required versions in `doc/minversions.md`
3941
- [ ] Remove unsupported GMT version from `.github/workflows/ci_tests_legacy.yaml`
4042
- [ ] Remove [xfail](https://docs.pytest.org/en/stable/skipping.html#xfail-mark-test-functions-as-expected-to-fail) pytest markers on tests that are now xpass
4143
- [ ] Update deprecated syntax in source code and examples based on the [GMT Changelog](https://docs.generic-mapping-tools.org/latest/changes.html)

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ Fixes #
2121
**Slash Commands**
2222

2323
You can write slash commands (`/command`) in the first line of a comment to perform
24-
specific operations. Supported slash commands are:
24+
specific operations. Supported slash command is:
2525

2626
- `/format`: automatically format and lint the code
27-
- `/test-gmt-dev`: run full tests on the latest GMT development version

.github/dependabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ updates:
66
- package-ecosystem: "github-actions"
77
directory: "/"
88
schedule:
9-
# Check for updates to GitHub Actions every weekday
9+
# Check for updates to GitHub Actions on Tuesdays
1010
interval: "weekly"
1111
day: "tuesday"
1212
# Allow up to 2 open pull requests at a time

.github/release-drafter.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ template: |
5353
5454
$CHANGES
5555
56-
**Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION
56+
**Full Changelog**: <https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION>
5757
5858
### Contributors
5959

.github/workflows/benchmarks.yml

Lines changed: 46 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Run performance benchmarks
22
#
3-
# Continuous benchmarking using pytest-codspeed. Measures the execution speed
4-
# of tests marked with @pytest.mark.benchmark decorator.
3+
# Continuous benchmarking using pytest-codspeed. Measures the execution speed of tests
4+
# marked with @pytest.mark.benchmark decorator.
55

66
name: Benchmarks
77

@@ -11,19 +11,13 @@ on:
1111
branches: [ main ]
1212
paths:
1313
- 'pygmt/**/*.py'
14-
- '!pygmt/tests/**'
1514
- '.github/workflows/benchmarks.yml'
15+
# Run in PRs but only if the PR has the 'run/benchmark' label
1616
pull_request:
17-
paths:
18-
- 'pygmt/**/*.py'
19-
- '!pygmt/tests/**'
20-
- '.github/workflows/benchmarks.yml'
21-
# `workflow_dispatch` allows CodSpeed to trigger backtest
22-
# performance analysis in order to generate initial data.
17+
types: [ opened, reopened, labeled, synchronize ]
18+
# 'workflow_dispatch' allows CodSpeed to trigger backtest performance analysis
19+
# in order to generate initial data.
2320
workflow_dispatch:
24-
release:
25-
types:
26-
- published
2721

2822
concurrency:
2923
group: ${{ github.workflow }}-${{ github.ref }}
@@ -32,66 +26,69 @@ concurrency:
3226
jobs:
3327
benchmarks:
3428
runs-on: ubuntu-22.04
29+
if: github.repository == 'GenericMappingTools/pygmt' && (github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'run/benchmark'))
3530
defaults:
3631
run:
3732
shell: bash -l {0}
3833

3934
steps:
4035
# Checkout current git repository
4136
- name: Checkout
42-
uses: actions/checkout@v4.1.1
37+
uses: actions/checkout@v4.2.0
4338
with:
4439
# fetch all history so that setuptools-scm works
4540
fetch-depth: 0
4641

47-
# Install Miniconda with conda-forge dependencies
48-
- name: Setup Miniconda
49-
uses: conda-incubator/[email protected]
50-
with:
51-
auto-activate-base: true
52-
activate-environment: "" # base environment
53-
channels: conda-forge,nodefaults
54-
channel-priority: strict
42+
- name: Get current week number of year
43+
id: date
44+
run: echo "date=$(date +%Y-W%W)" >> $GITHUB_OUTPUT # e.g., 2024-W19
5545

56-
# Install GMT and dependencies from conda-forge
57-
- name: Install dependencies
58-
run: |
59-
# $CONDA is an environment variable pointing to the root of the miniconda directory
60-
# Preprend $CONDA/bin to $PATH so that conda's python is used over system python
61-
echo $CONDA/bin >> $GITHUB_PATH
62-
conda install --solver=libmamba gmt=6.4.0 python=3.12 \
63-
numpy pandas xarray netCDF4 packaging \
64-
geopandas pytest pytest-benchmark pytest-mpl
65-
python -m pip install -U pytest-codspeed setuptools
46+
# Install Micromamba with conda-forge dependencies
47+
- name: Setup Micromamba
48+
uses: mamba-org/[email protected]
49+
with:
50+
environment-name: pygmt
51+
condarc: |
52+
channels:
53+
- conda-forge
54+
- nodefaults
55+
cache-downloads: false
56+
cache-environment: true
57+
# environment cache is persistent for one week.
58+
cache-environment-key: micromamba-environment-${{ steps.date.outputs.date }}
59+
create-args: >-
60+
gmt=6.5.0
61+
python=3.12
62+
numpy
63+
pandas
64+
xarray
65+
netCDF4
66+
packaging
67+
geopandas
68+
pyarrow
69+
pytest
70+
pytest-codspeed
71+
pytest-mpl
6672
6773
# Download cached remote files (artifacts) from GitHub
6874
- name: Download remote data from GitHub
69-
uses: dawidd6/[email protected]
70-
with:
71-
workflow: cache_data.yaml
72-
workflow_conclusion: success
73-
name: gmt-cache
74-
path: .gmt
75-
76-
# Move downloaded files to ~/.gmt directory and list them
77-
- name: Move and list downloaded remote files
7875
run: |
79-
mkdir -p ~/.gmt
80-
mv .gmt/* ~/.gmt
76+
# Download cached files to ~/.gmt directory and list them
77+
gh run download --name gmt-cache --dir ~/.gmt/
8178
# Change modification times of the two files, so GMT won't refresh it
82-
touch ~/.gmt/server/gmt_data_server.txt ~/.gmt/server/gmt_hash_server.txt
79+
touch ~/.gmt/gmt_data_server.txt ~/.gmt/gmt_hash_server.txt
8380
ls -lhR ~/.gmt
81+
env:
82+
GH_TOKEN: ${{ github.token }}
8483

8584
# Install the package that we want to test
8685
- name: Install the package
8786
run: make install
8887

8988
# Run the benchmark tests
9089
- name: Run benchmarks
91-
uses: CodSpeedHQ/action@v2.0.2
90+
uses: CodSpeedHQ/action@v3.0.0
9291
with:
93-
run: |
94-
python -c "import pygmt; pygmt.show_versions()"
95-
PYGMT_USE_EXTERNAL_DISPLAY="false" python -m pytest -r P --pyargs pygmt --codspeed
96-
env:
97-
GMT_LIBRARY_PATH: /usr/share/miniconda/lib/
92+
# 'bash -el -c' is needed to use the custom shell.
93+
# See https://github.com/CodSpeedHQ/action/issues/65.
94+
run: bash -el -c "python -c \"import pygmt; pygmt.show_versions()\"; PYGMT_USE_EXTERNAL_DISPLAY=false python -m pytest -r P --pyargs pygmt --codspeed"

.github/workflows/cache_data.yaml

Lines changed: 31 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,26 @@
1-
# Cache GMT remote data files and uploads as artifacts
1+
# Cache GMT remote data files and upload as artifacts
22
#
3-
# This workflow downloads data files needed by PyGMT tests/documentation from
4-
# the GMT data server and uploads as workflow artifacts which can be accessed
5-
# by other GitHub Actions workflows.
3+
# This workflow downloads data files needed by PyGMT tests/documentation from the GMT
4+
# data server and uploads them as workflow artifacts, which can then be accessed by other
5+
# GitHub Actions workflows.
66
#
7-
# It is scheduled to run every Sunday at 12:00 (UTC). If new remote files are
8-
# needed urgently, maintainers can manually uncomment the 'pull_request:' line
9-
# below to refresh the cache.
7+
# It is scheduled to run every Sunday at 12:00 (UTC). If new remote files are needed
8+
# urgently, maintainers can refresh the cache by one of the following methods:
9+
#
10+
# 1. Update this workflow file
11+
# 2. Update the `pygmt/helpers/caching.py` file
12+
# 3. Go to https://github.com/GenericMappingTools/pygmt/actions/workflows/cache_data.yaml
13+
# and click the "Run workflow" button
1014
#
1115
name: Cache data
1216

1317
on:
14-
# Uncomment the 'pull_request' line below to manually re-cache data artifacts
15-
# pull_request:
18+
pull_request:
19+
# Make any changes to the following files to refresh the cache in PRs
20+
paths:
21+
- 'pygmt/helpers/caching.py'
22+
- '.github/workflows/cache_data.yaml'
23+
workflow_dispatch:
1624
# Schedule runs on 12 noon every Sunday
1725
schedule:
1826
- cron: '0 12 * * 0'
@@ -28,14 +36,14 @@ jobs:
2836
steps:
2937
# Checkout current git repository
3038
- name: Checkout
31-
uses: actions/checkout@v4.1.1
39+
uses: actions/checkout@v4.2.0
3240
with:
3341
# fetch all history so that setuptools-scm works
3442
fetch-depth: 0
3543

3644
# Install Micromamba with conda-forge dependencies
3745
- name: Setup Micromamba
38-
uses: mamba-org/setup-micromamba@v1.7.3
46+
uses: mamba-org/setup-micromamba@v2.0.0
3947
with:
4048
environment-name: pygmt
4149
condarc: |
@@ -44,13 +52,13 @@ jobs:
4452
- nodefaults
4553
create-args: >-
4654
python=3.12
47-
gmt=6.4.0
55+
gmt=6.5.0
4856
numpy
4957
pandas
5058
xarray
5159
netCDF4
5260
packaging
53-
build
61+
python-build
5462
5563
# Install the package that we want to test
5664
- name: Install the package
@@ -61,13 +69,19 @@ jobs:
6169
# Download remote files
6270
- name: Download remote data
6371
run: |
64-
python -c "from pygmt.helpers.testing import download_test_data; download_test_data()"
72+
python -c "from pygmt.helpers.caching import cache_data; cache_data()"
73+
74+
- name: List downloaded remote files
75+
run: ls -lhR ~/.gmt
6576

6677
# Upload the downloaded files as artifacts to GitHub
6778
- name: Upload artifacts to GitHub
68-
uses: actions/upload-artifact@v4
79+
uses: actions/upload-artifact@v4.4.0
6980
with:
7081
name: gmt-cache
82+
include-hidden-files: true
7183
path: |
72-
~/.gmt/cache
73-
~/.gmt/server
84+
~/.gmt/cache
85+
~/.gmt/server
86+
~/.gmt/gmt_data_server.txt
87+
~/.gmt/gmt_hash_server.txt

0 commit comments

Comments
 (0)