Skip to content

Commit e17939e

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents 86e3d37 + 74a02ef commit e17939e

File tree

319 files changed

+3120
-1603
lines changed

Some content is hidden

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

319 files changed

+3120
-1603
lines changed

.github/workflows/cache_data.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
steps:
2020
# Setup Miniconda
2121
- name: Setup Miniconda
22-
uses: conda-incubator/setup-miniconda@v2.0.1
22+
uses: conda-incubator/setup-miniconda@v2.1.1
2323
with:
2424
channels: conda-forge
2525
miniconda-version: "latest"

.github/workflows/check-links.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
path: documentation
2727

2828
- name: Link Checker
29-
uses: lycheeverse/lychee-action@v1.0.6
29+
uses: lycheeverse/lychee-action@v1.0.7
3030
with:
3131
# 429: Too many requests
3232
args: >
@@ -52,7 +52,7 @@ jobs:
5252
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5353

5454
- name: Create Issue From File
55-
uses: peter-evans/create-issue-from-file@v2.3.2
55+
uses: peter-evans/create-issue-from-file@v3
5656
with:
5757
title: Link Checker Report
5858
content-filepath: ./lychee/out.md

.github/workflows/ci_docs.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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.8.0
46+
uses: styfle/cancel-workflow-action@0.9.0
4747
with:
4848
access_token: ${{ github.token }}
4949

@@ -56,7 +56,7 @@ jobs:
5656

5757
# Setup Miniconda
5858
- name: Setup Miniconda
59-
uses: conda-incubator/setup-miniconda@v2.0.1
59+
uses: conda-incubator/setup-miniconda@v2.1.1
6060
with:
6161
activate-environment: pygmt
6262
python-version: ${{ matrix.python-version }}
@@ -66,9 +66,10 @@ jobs:
6666
# Install GMT and other required dependencies from conda-forge
6767
- name: Install dependencies
6868
run: |
69-
conda install gmt=6.1.1 numpy pandas xarray netCDF4 packaging \
69+
conda install -c conda-forge/label/dev gmt=6.2.0rc1
70+
conda install numpy pandas xarray netCDF4 packaging \
7071
ipython make myst-parser \
71-
sphinx sphinx-copybutton sphinx-gallery sphinx_rtd_theme=0.4.3
72+
sphinx sphinx-copybutton sphinx-gallery sphinx_rtd_theme
7273
7374
# Show installed pkg information for postmortem diagnostic
7475
- name: List installed packages

.github/workflows/ci_tests.yaml

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ on:
2525

2626
jobs:
2727
test:
28-
name: ${{ matrix.os }} - Python ${{ matrix.python-version }}
28+
name: ${{ matrix.os }} - Python ${{ matrix.python-version }} / NumPy ${{ matrix.numpy-version }}
2929
runs-on: ${{ matrix.os }}
3030
strategy:
3131
fail-fast: false
3232
matrix:
33-
python-version: [3.7, 3.8, 3.9]
33+
python-version: [3.7, 3.9]
3434
os: [ubuntu-latest, macOS-latest, windows-latest]
3535
# Is it a draft Pull Request (true or false)?
3636
isDraft:
@@ -41,25 +41,29 @@ jobs:
4141
isDraft: true
4242
- os: windows-latest
4343
isDraft: true
44-
- os: ubuntu-latest
45-
python-version: 3.7
46-
isDraft: true
47-
- os: ubuntu-latest
48-
python-version: 3.8
49-
isDraft: true
44+
# - os: ubuntu-latest
45+
# python-version: 3.7
46+
# isDraft: true
47+
# Pair Python 3.7 with NumPy 1.17 and Python 3.9 with NumPy 1.20
48+
include:
49+
- python-version: 3.7
50+
numpy-version: '1.17'
51+
- python-version: 3.9
52+
numpy-version: '1.20'
5053
defaults:
5154
run:
5255
shell: bash -l {0}
5356

54-
# environmental variables used in coverage
57+
# Environment variables used by codecov
5558
env:
5659
OS: ${{ matrix.os }}
5760
PYTHON: ${{ matrix.python-version }}
61+
NUMPY: ${{ matrix.numpy-version }}
5862

5963
steps:
6064
# Cancel previous runs that are not completed
6165
- name: Cancel Previous Runs
62-
uses: styfle/cancel-workflow-action@0.8.0
66+
uses: styfle/cancel-workflow-action@0.9.0
6367
with:
6468
access_token: ${{ github.token }}
6569

@@ -72,7 +76,7 @@ jobs:
7276

7377
# Setup Miniconda
7478
- name: Setup Miniconda
75-
uses: conda-incubator/setup-miniconda@v2.0.1
79+
uses: conda-incubator/setup-miniconda@v2.1.1
7680
with:
7781
activate-environment: pygmt
7882
python-version: ${{ matrix.python-version }}
@@ -82,7 +86,9 @@ jobs:
8286
# Install GMT and other required dependencies from conda-forge
8387
- name: Install dependencies
8488
run: |
85-
conda install gmt=6.1.1 numpy pandas xarray netCDF4 packaging \
89+
conda install -c conda-forge/label/dev gmt=6.2.0rc1
90+
conda install numpy=${{ matrix.numpy-version }} \
91+
pandas xarray netCDF4 packaging \
8692
codecov coverage[toml] dvc ipython make \
8793
pytest-cov pytest-mpl pytest>=6.0 \
8894
sphinx-gallery
@@ -135,8 +141,8 @@ jobs:
135141

136142
# Upload coverage to Codecov
137143
- name: Upload coverage to Codecov
138-
uses: codecov/codecov-action@v1.2.2
144+
uses: codecov/codecov-action@v1.4.1
139145
with:
140146
file: ./coverage.xml # optional
141-
env_vars: OS,PYTHON
147+
env_vars: OS,PYTHON,NUMPY
142148
fail_ci_if_error: false

.github/workflows/ci_tests_dev.yaml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
# This workflow installs PyGMT dependencies, builds documentation and runs tests on GMT dev version
2-
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
1+
# This workflow installs PyGMT and runs tests on GMT dev version
32

43
name: GMT Dev Tests
54

@@ -10,10 +9,13 @@ on:
109
types: [ready_for_review]
1110
paths-ignore:
1211
- 'doc/**'
12+
- 'examples/**'
1313
- '*.md'
1414
- '*.json'
1515
- 'README.rst'
1616
- 'LICENSE.txt'
17+
- '.gitignore'
18+
- '.pylintrc'
1719
repository_dispatch:
1820
types: [test-gmt-dev-command]
1921
# Schedule daily tests
@@ -28,7 +30,7 @@ jobs:
2830
fail-fast: false
2931
matrix:
3032
python-version: [3.9]
31-
os: [ubuntu-20.04, macOS-10.15, windows-latest]
33+
os: [ubuntu-latest, macOS-11.0, windows-latest]
3234
gmt_git_ref: [master]
3335
defaults:
3436
run:
@@ -37,7 +39,7 @@ jobs:
3739
steps:
3840
# Cancel previous runs that are not completed
3941
- name: Cancel Previous Runs
40-
uses: styfle/cancel-workflow-action@0.8.0
42+
uses: styfle/cancel-workflow-action@0.9.0
4143
with:
4244
access_token: ${{ github.token }}
4345

@@ -71,8 +73,9 @@ jobs:
7173

7274
# Setup Miniconda
7375
- name: Setup Miniconda
74-
uses: conda-incubator/setup-miniconda@v2.0.1
76+
uses: conda-incubator/setup-miniconda@v2.1.1
7577
with:
78+
activate-environment: pygmt
7679
python-version: ${{ matrix.python-version }}
7780
channels: conda-forge
7881
miniconda-version: "latest"
@@ -81,8 +84,9 @@ jobs:
8184
- name: Install dependencies
8285
run: |
8386
conda install ninja cmake libblas libcblas liblapack fftw gdal \
84-
ghostscript libnetcdf hdf5 zlib curl pcre ipython \
85-
dvc pytest pytest-cov pytest-mpl
87+
ghostscript libnetcdf hdf5 zlib curl pcre make dvc
88+
pip install --pre numpy pandas xarray netCDF4 packaging \
89+
ipython pytest-cov pytest-mpl pytest>=6.0 sphinx-gallery
8690
8791
# Build and install latest GMT from GitHub
8892
- name: Install GMT ${{ matrix.gmt_git_ref }} branch (Linux/macOS)

.github/workflows/dvc-diff.yml

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
# Checks for image diffs in a Pull Request and adds a GitHub comment showing the diff
2+
name: DVC image diff
3+
4+
on:
5+
pull_request:
6+
paths:
7+
- 'pygmt/tests/baseline/*.png.dvc'
8+
9+
jobs:
10+
dvc-diff:
11+
name: DVC image diff
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v2.3.4
17+
with:
18+
# fetch all history so that dvc diff works
19+
fetch-depth: 0
20+
21+
- name: Setup data version control (DVC)
22+
uses: iterative/setup-dvc@v1.0.2
23+
24+
- name: Setup continuous machine learning (CML)
25+
uses: iterative/setup-cml@v1.0.0
26+
27+
- name: Pull image data from cloud storage
28+
run: dvc pull --remote upstream
29+
30+
# Produce the markdown diff report, which should look like:
31+
# ## Summary of changed images
32+
#
33+
# This is an auto-generated report of images that have changed on the DVC remote
34+
#
35+
# | Status | Path |
36+
# |----------|-------------------------------------|
37+
# | added | pygmt/tests/baseline/test_image.png |
38+
# | deleted | pygmt/tests/baseline/test_image2.png |
39+
# | modified | pygmt/tests/baseline/test_image3.png |
40+
- name: Generate the image diff report
41+
env:
42+
repo_token: ${{ secrets.GITHUB_TOKEN }}
43+
id: image-diff
44+
run: |
45+
echo -e "## Summary of changed images\n" > report.md
46+
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
48+
49+
# Get just the filename of the added and modified image from the report
50+
awk 'NF==5 && NR>=7 && $2=="added" {print $4}' report.md > added_files.txt
51+
awk 'NF==5 && NR>=7 && $2=="modified" {print $4}' report.md > modified_files.txt
52+
53+
# Append each image to the markdown report
54+
echo -e "## Image diff(s)\n" >> report.md
55+
echo -e "<details>\n" >> report.md
56+
57+
# Added images
58+
echo -e "### Added images\n" >> report.md
59+
while IFS= read -r line; do
60+
echo -e "- $line \n" >> report.md
61+
cml-publish --title $line --md "$line" >> report.md < /dev/null
62+
done < added_files.txt
63+
64+
# Modified images
65+
echo -e "### Modified images\n" >> report.md
66+
# Upload new images
67+
while IFS= read -r line; do
68+
cml-publish --title $line --md "$line" >> modified_images_new.md < /dev/null
69+
done < modified_files.txt
70+
71+
# Pull images in the master branch from cloud storage
72+
git checkout master
73+
dvc pull --remote upstream
74+
# Upload old images
75+
while IFS= read -r line; do
76+
cml-publish --title $line --md "$line" >> modified_images_old.md < /dev/null
77+
done < modified_files.txt
78+
79+
# Append image report for modified images
80+
echo -e "| Path | Old | New |" >> report.md
81+
echo -e "|---|---|---|" >> report.md
82+
paste modified_files.txt modified_images_old.md modified_images_new.md -d"|" |
83+
awk -F"|" 'function basename(file) {sub(".*/", "", file); return file} {printf("| %s | %s | %s |\n", basename($1), $2, $3)}' >> report.md
84+
85+
echo -e "</details>\n" >> report.md
86+
87+
# Mention git commit SHA in the report
88+
echo -e "Report last updated at commit ${{ github.event.pull_request.head.sha }}" >> report.md
89+
90+
# Format report to escape newlines before publishing as GitHub comment
91+
report=$(cat report.md)
92+
report="${report//'%'/'%25'}"
93+
report="${report//$'\n'/'%0A'}"
94+
report="${report//$'\r'/'%0D'}"
95+
echo ::set-output name=report::$report
96+
97+
- name: Find comment with image diff report
98+
uses: peter-evans/find-comment@v1.2.0
99+
id: fc
100+
with:
101+
issue-number: ${{ github.event.pull_request.number }}
102+
comment-author: 'github-actions[bot]'
103+
body-includes: 'This is an auto-generated report of images that have changed on the DVC remote'
104+
105+
- name: Create comment with image diff report
106+
if: steps.fc.outputs.comment-id == ''
107+
uses: peter-evans/create-or-update-comment@v1.4.4
108+
with:
109+
issue-number: ${{ github.event.pull_request.number }}
110+
body: ${{ steps.image-diff.outputs.report }}
111+
112+
- name: Update comment with new image diff report
113+
if: steps.fc.outputs.comment-id != ''
114+
uses: peter-evans/create-or-update-comment@v1.4.4
115+
with:
116+
comment-id: ${{ steps.fc.outputs.comment-id }}
117+
body: ${{ steps.image-diff.outputs.report }}
118+
edit-mode: replace

.github/workflows/format-command.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
ref: ${{ github.event.client_payload.pull_request.head.ref }}
2222

2323
# Setup Python environment
24-
- uses: actions/setup-python@v2.2.1
24+
- uses: actions/setup-python@v2.2.2
2525

2626
# Install formatting tools
2727
- name: Install formatting tools

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
fetch-depth: 0
3030

3131
- name: Set up Python
32-
uses: actions/setup-python@v2.2.1
32+
uses: actions/setup-python@v2.2.2
3333
with:
3434
python-version: 3.9
3535

.github/workflows/style_checks.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020

2121
# Setup Miniconda
2222
- name: Set up Python
23-
uses: actions/setup-python@v2.2.1
23+
uses: actions/setup-python@v2.2.2
2424
with:
2525
python-version: 3.9
2626

AUTHORS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Manoa.
88
The following people have contributed code and/or documentation to the project
99
(alphabetical by name) and are considered to be "PyGMT Developers":
1010

11+
* [Abhishek Anant](https://twitter.com/itsabhianant) | [0000-0002-5751-2010](https://orcid.org/0000-0002-5751-2010) | Unaffiliated
1112
* [Dongdong Tian](https://seisman.info/) | [0000-0001-7967-1197](https://orcid.org/0000-0001-7967-1197) | Michigan State University
1213
* [Jiayuan Yao](https://github.com/core-man) | [0000-0001-7036-4238](https://orcid.org/0000-0001-7036-4238) | Nanyang Technological University
1314
* [Kathryn Materna](https://github.com/kmaterna) | [0000-0002-6687-980X](https://orcid.org/0000-0002-6687-980X) | US Geological Survey

0 commit comments

Comments
 (0)