Skip to content

Commit 71ff162

Browse files
Merge branch 'main' into wrap-grdvolume
2 parents 7eb90b5 + 7a94b68 commit 71ff162

File tree

104 files changed

+3518
-1002
lines changed

Some content is hidden

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

104 files changed

+3518
-1002
lines changed

.github/ISSUE_TEMPLATE/release_checklist.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,24 +21,24 @@ assignees: ''
2121
- [ ] Add a new entry in `doc/_static/version_switch.js` for documentation switcher
2222
- [ ] Update citation information https://github.com/GenericMappingTools/pygmt#citing-pygmt
2323
- [ ] Add the documentation link https://github.com/GenericMappingTools/pygmt#documentation-for-other-versions
24-
- [ ] Add compatibility information https://github.com/GenericMappingTools/pygmt#compatibility-with-python-and-gmt-versions
25-
- [ ] Copy draft changelog from Release Drafter and edit it to look nice
24+
- [ ] Add compatibility information https://github.com/GenericMappingTools/pygmt#compatibility-with-gmt-and-pythonnumpy-versions
25+
- [ ] 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))
2626

2727
**Release**:
2828
- [ ] At the [PyGMT release page on GitHub](https://github.com/GenericMappingTools/pygmt/releases):
2929
- [ ] Edit the draft release notes with the finalized changelog
3030
- [ ] Set the tag version and release title to vX.Y.Z
3131
- [ ] Make a release by clicking the 'Publish Release' button, this will automatically create a tag too
32-
- [ ] Manually upload the pygmt-vX.Y.Z.zip file to https://zenodo.org/deposit, ensure that it is filed under the correct reserved DOI
32+
- [ ] 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
3333

3434
**After release**:
3535
- [ ] Update conda-forge [pygmt-feedstock](https://github.com/conda-forge/pygmt-feedstock) [Usually done automatically by conda-forge's bot]
36-
- [ ] Bump PyGMT version on https://github.com/GenericMappingTools/try-gmt
36+
- [ ] Bump PyGMT version on https://github.com/GenericMappingTools/try-gmt (after conda-forge update)
3737
- [ ] Announce the release on:
38-
- [ ] GMT [forum](https://forum.generic-mapping-tools.org/c/news/)
38+
- [ ] GMT [forum](https://forum.generic-mapping-tools.org/c/news/) (do this announcement first! draft on https://hackmd.io/@pygmt. requires moderator status)
3939
- [ ] [Major/Minor releases only] GMT [website](https://github.com/GenericMappingTools/website) (News)
40-
- [ ] [ResearchGate](https://www.researchgate.net/project/PyGMT-A-Python-interface-for-the-Generic-Mapping-Tools)
41-
- [ ] [Twitter](https://twitter.com/gmt_dev)
40+
- [ ] [ResearchGate](https://www.researchgate.net/project/PyGMT-A-Python-interface-for-the-Generic-Mapping-Tools) (after forum announcement)
41+
- [ ] [Twitter](https://twitter.com/gmt_dev) (after forum announcement)
4242
---
4343

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

.github/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
########################################################################################
33
# Comment to be posted to on first time issues
44
newIssueWelcomeComment: |
5-
👋 Thanks for opening your first issue here! Please make sure you filled out the template with as much detail as possible. You might also want to take a look at our [contributing guidelines](https://github.com/GenericMappingTools/pygmt/blob/master/CONTRIBUTING.md) and [code of conduct](https://github.com/GenericMappingTools/pygmt/blob/master/CODE_OF_CONDUCT.md).
5+
👋 Thanks for opening your first issue here! Please make sure you filled out the template with as much detail as possible. You might also want to take a look at our [contributing guidelines](https://github.com/GenericMappingTools/pygmt/blob/main/CONTRIBUTING.md) and [code of conduct](https://github.com/GenericMappingTools/pygmt/blob/main/CODE_OF_CONDUCT.md).
66
77
# Comment to be posted to on PRs from first time contributors in your repository
88
newPRWelcomeComment: |
99
💖 Thanks for opening this pull request! 💖
1010
11-
Please make sure you read our [contributing guidelines](https://github.com/GenericMappingTools/pygmt/blob/master/CONTRIBUTING.md) and abide by our [code of conduct](https://github.com/GenericMappingTools/pygmt/blob/master/CODE_OF_CONDUCT.md).
11+
Please make sure you read our [contributing guidelines](https://github.com/GenericMappingTools/pygmt/blob/main/CONTRIBUTING.md) and abide by our [code of conduct](https://github.com/GenericMappingTools/pygmt/blob/main/CODE_OF_CONDUCT.md).
1212
1313
A few things to keep in mind:
1414

.github/workflows/cache_data.yaml

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,34 +17,36 @@ jobs:
1717
shell: bash -l {0}
1818

1919
steps:
20+
# Checkout current git repository
21+
- name: Checkout
22+
uses: actions/checkout@v2.3.4
23+
with:
24+
# fecth all history so that setuptools-scm works
25+
fetch-depth: 0
26+
2027
# Setup Miniconda
2128
- name: Setup Miniconda
2229
uses: conda-incubator/setup-miniconda@v2.1.1
2330
with:
2431
channels: conda-forge
2532
miniconda-version: "latest"
2633

27-
# Install GMT
28-
- name: Install GMT
29-
run: conda install -c conda-forge/label/dev gmt=6.2.0rc2
34+
# Install GMT and other required dependencies from conda-forge
35+
- name: Install dependencies
36+
run: |
37+
conda install gmt=6.2.0 \
38+
numpy pandas xarray netCDF4 packaging matplotlib
39+
40+
# Install the package that we want to test
41+
- name: Install the package
42+
run: |
43+
python setup.py sdist --formats=zip
44+
pip install dist/*
3045
3146
# Download remote files
3247
- name: Download remote data
3348
run: |
34-
gmt which -Ga @earth_relief_10m_p @earth_relief_10m_g \
35-
@earth_relief_30m_p @earth_relief_30m_g \
36-
@earth_relief_01d_p @earth_relief_01d_g \
37-
@earth_relief_05m_p @earth_relief_05m_g
38-
# Download one tile of the 03s srtm data.
39-
# @N35E135.earth_relief_03s_g.nc is for internal use only.
40-
# The naming scheme may change.
41-
# DO NOT USE IT IN SCRIPTS.
42-
gmt which -Ga @N35E135.earth_relief_03s_g.nc
43-
# @srtm_tiles.nc is needed for 03s and 01s relief data
44-
gmt which -Ga @srtm_tiles.nc
45-
gmt which -Ga @ridge.txt @Table_5_11.txt @test.dat.nc \
46-
@tut_bathy.nc @tut_quakes.ngdc @tut_ship.xyz \
47-
@usgs_quakes_22.txt @fractures_06.txt
49+
python -c "from pygmt.helpers.testing import download_test_data; download_test_data()"
4850
4951
# Upload the downloaded files as artifacts to GitHub
5052
- name: Upload artifacts to GitHub

.github/workflows/ci_docs.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ name: Docs
44

55
on:
66
push:
7-
branches: [ master ]
7+
branches: [ main ]
88
pull_request:
99
types: [opened, reopened, synchronize, ready_for_review]
1010
paths-ignore:
@@ -43,7 +43,7 @@ jobs:
4343
steps:
4444
# Cancel previous runs that are not completed
4545
- name: Cancel Previous Runs
46-
uses: styfle/cancel-workflow-action@0.9.0
46+
uses: styfle/cancel-workflow-action@0.9.1
4747
with:
4848
access_token: ${{ github.token }}
4949

@@ -66,8 +66,7 @@ jobs:
6666
# Install GMT and other required dependencies from conda-forge
6767
- name: Install dependencies
6868
run: |
69-
conda install conda-forge/label/dev::gmt=6.2.0rc2 \
70-
numpy pandas xarray netCDF4 packaging \
69+
conda install gmt=6.2.0 numpy pandas xarray netCDF4 packaging \
7170
ipython make myst-parser \
7271
sphinx sphinx-copybutton sphinx-gallery sphinx_rtd_theme
7372
@@ -77,7 +76,7 @@ jobs:
7776

7877
# Download cached remote files (artifacts) from GitHub
7978
- name: Download remote data from GitHub
80-
uses: dawidd6/action-download-artifact@v2.14.0
79+
uses: dawidd6/action-download-artifact@v2.14.1
8180
with:
8281
workflow: cache_data.yaml
8382
workflow_conclusion: success
@@ -115,7 +114,7 @@ jobs:
115114

116115
- name: Push the built HTML to gh-pages
117116
run: |
118-
# Detect if this is a release or from the master branch
117+
# Detect if this is a release or from the main branch
119118
if [[ "${GITHUB_EVENT_NAME}" == "release" ]]; then
120119
# Get the tag name without the "refs/tags/" part
121120
version="${GITHUB_REF#refs/*/}"

.github/workflows/ci_tests.yaml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ name: Tests
44

55
on:
66
push:
7-
branches: [ master ]
7+
branches: [ main ]
88
pull_request:
99
types: [opened, reopened, synchronize, ready_for_review]
1010
paths-ignore:
@@ -44,15 +44,15 @@ jobs:
4444
# - os: ubuntu-latest
4545
# python-version: 3.7
4646
# isDraft: true
47-
# Pair Python 3.7 with NumPy 1.17 and Python 3.9 with NumPy 1.20
48-
# Only install optional packages on Python 3.9/NumPy 1.20
47+
# Pair Python 3.7 with NumPy 1.18 and Python 3.9 with NumPy 1.21
48+
# Only install optional packages on Python 3.9/NumPy 1.21
4949
include:
5050
- python-version: 3.7
51-
numpy-version: '1.17'
51+
numpy-version: '1.18'
5252
optional-packages: ''
5353
- python-version: 3.9
54-
numpy-version: '1.20'
55-
optional-packages: '' # 'geopandas'
54+
numpy-version: '1.21'
55+
optional-packages: 'geopandas'
5656
defaults:
5757
run:
5858
shell: bash -l {0}
@@ -66,7 +66,7 @@ jobs:
6666
steps:
6767
# Cancel previous runs that are not completed
6868
- name: Cancel Previous Runs
69-
uses: styfle/cancel-workflow-action@0.9.0
69+
uses: styfle/cancel-workflow-action@0.9.1
7070
with:
7171
access_token: ${{ github.token }}
7272

@@ -89,8 +89,7 @@ jobs:
8989
# Install GMT and other required dependencies from conda-forge
9090
- name: Install dependencies
9191
run: |
92-
conda install conda-forge/label/dev::gmt=6.2.0rc2 \
93-
numpy=${{ matrix.numpy-version }} \
92+
conda install gmt=6.2.0 numpy=${{ matrix.numpy-version }} \
9493
pandas xarray netCDF4 packaging \
9594
${{ matrix.optional-packages }} \
9695
codecov coverage[toml] dvc ipython make \
@@ -103,7 +102,7 @@ jobs:
103102

104103
# Download cached remote files (artifacts) from GitHub
105104
- name: Download remote data from GitHub
106-
uses: dawidd6/action-download-artifact@v2.14.0
105+
uses: dawidd6/action-download-artifact@v2.14.1
107106
with:
108107
workflow: cache_data.yaml
109108
workflow_conclusion: success
@@ -145,7 +144,7 @@ jobs:
145144

146145
# Upload coverage to Codecov
147146
- name: Upload coverage to Codecov
148-
uses: codecov/codecov-action@v1.5.0
147+
uses: codecov/codecov-action@v2.0.2
149148
with:
150149
file: ./coverage.xml # optional
151150
env_vars: OS,PYTHON,NUMPY

.github/workflows/ci_tests_dev.yaml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ name: GMT Dev Tests
44

55
on:
66
# push:
7-
# branches: [ master ]
7+
# branches: [ main ]
88
pull_request:
99
types: [ready_for_review]
1010
paths-ignore:
@@ -23,7 +23,7 @@ on:
2323
- cron: '0 0 * * *'
2424

2525
jobs:
26-
test_gmt_master:
26+
test_gmt_dev:
2727
name: ${{ matrix.os }} - GMT ${{ matrix.gmt_git_ref }}
2828
runs-on: ${{ matrix.os }}
2929
strategy:
@@ -39,7 +39,7 @@ jobs:
3939
steps:
4040
# Cancel previous runs that are not completed
4141
- name: Cancel Previous Runs
42-
uses: styfle/cancel-workflow-action@0.9.0
42+
uses: styfle/cancel-workflow-action@0.9.1
4343
with:
4444
access_token: ${{ github.token }}
4545

@@ -83,10 +83,11 @@ jobs:
8383
# Install dependencies from conda-forge
8484
- name: Install dependencies
8585
run: |
86-
conda install ninja cmake libblas libcblas liblapack fftw gdal=3.2 geopandas \
86+
conda install ninja cmake libblas libcblas liblapack fftw gdal geopandas \
8787
ghostscript libnetcdf hdf5 zlib curl pcre make dvc
8888
pip install --pre numpy pandas xarray netCDF4 packaging \
89-
ipython pytest-cov pytest-mpl pytest>=6.0 sphinx-gallery
89+
ipython pytest-cov pytest-mpl pytest>=6.0 sphinx-gallery \
90+
tomli
9091
9192
# Build and install latest GMT from GitHub
9293
- name: Install GMT ${{ matrix.gmt_git_ref }} branch (Linux/macOS)
@@ -102,7 +103,7 @@ jobs:
102103

103104
# Download cached remote files (artifacts) from GitHub
104105
- name: Download remote data from GitHub
105-
uses: dawidd6/action-download-artifact@v2.14.0
106+
uses: dawidd6/action-download-artifact@v2.14.1
106107
with:
107108
workflow: cache_data.yaml
108109
workflow_conclusion: success

.github/workflows/dvc-diff.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
uses: iterative/setup-dvc@v1.0.3
2323

2424
- name: Setup continuous machine learning (CML)
25-
uses: iterative/setup-cml@v1.0.0
25+
uses: iterative/setup-cml@v1.0.3
2626

2727
- name: Pull image data from cloud storage
2828
run: dvc pull --remote upstream
@@ -44,7 +44,7 @@ jobs:
4444
run: |
4545
echo -e "## Summary of changed images\n" > report.md
4646
echo -e "This is an auto-generated report of images that have changed on the DVC remote\n" >> report.md
47-
dvc diff --show-md master HEAD >> report.md
47+
dvc diff --show-md main HEAD >> report.md
4848
4949
# Get just the filename of the added and modified image from the report
5050
awk 'NF==5 && NR>=7 && $2=="added" {print $4}' report.md > added_files.txt
@@ -68,8 +68,8 @@ jobs:
6868
cml-publish --title $line --md "$line" >> modified_images_new.md < /dev/null
6969
done < modified_files.txt
7070
71-
# Pull images in the master branch from cloud storage
72-
git checkout master
71+
# Pull images in the main branch from cloud storage
72+
git checkout main
7373
dvc pull --remote upstream
7474
# Upload old images
7575
while IFS= read -r line; do

.github/workflows/publish-to-pypi.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
22

33
name: Publish to PyPI
44

5-
# Only run for pushes to the master branch and releases.
5+
# Only run for pushes to the main branch and releases.
66
on:
77
push:
88
branches:
9-
- master
9+
- main
1010
release:
1111
types:
1212
- published
1313
# Runs for pull requests should be disabled other than for testing purposes
1414
#pull_request:
1515
# branches:
16-
# - master
16+
# - main
1717

1818
jobs:
1919
publish-pypi:
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Upload the ZIP archive of baseline images as a release asset
2+
3+
name: Upload baseline images
4+
5+
# Only run for releases
6+
on:
7+
release:
8+
types:
9+
- published
10+
11+
jobs:
12+
upload-baseline:
13+
name: Upload baseline images
14+
runs-on: ubuntu-latest
15+
if: github.repository == 'GenericMappingTools/pygmt'
16+
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v2.3.4
20+
21+
- name: Setup data version control (DVC)
22+
uses: iterative/setup-dvc@v1.0.3
23+
24+
- name: Pull baseline image data from dvc remote
25+
run: |
26+
dvc pull
27+
ls -lhR pygmt/tests/baseline/
28+
29+
- name: Create the baseline image asset in zip format
30+
run: |
31+
mkdir baseline-images
32+
mv pygmt/tests/baseline/*.png baseline-images/
33+
zip -r baseline-images.zip baseline-images
34+
shasum -a 256 baseline-images.zip
35+
36+
- name: Upload baseline image as a release asset
37+
uses: shogo82148/actions-upload-release-asset@v1.3.1
38+
with:
39+
upload_url: ${{ github.event.release.upload_url }}
40+
asset_path: baseline-images.zip

.github/workflows/release-drafter.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ on:
44
push:
55
# branches to consider in the event; optional, defaults to all
66
branches:
7-
- master
7+
- main
88

99
jobs:
1010
update_release_draft:
1111
runs-on: ubuntu-latest
1212
steps:
13-
# Drafts your next Release notes as Pull Requests are merged into "master"
13+
# Drafts your next Release notes as Pull Requests are merged into "main"
1414
- uses: release-drafter/release-drafter@v5.15.0
1515
with:
1616
# (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml

0 commit comments

Comments
 (0)