Skip to content

Commit 154d05e

Browse files
authored
Merge branch 'master' into hlines-module
2 parents 4fdc984 + 3414f69 commit 154d05e

File tree

333 files changed

+4924
-2156
lines changed

Some content is hidden

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

333 files changed

+4924
-2156
lines changed

.codecov.yml

Lines changed: 0 additions & 14 deletions
This file was deleted.

.dvc/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/config.local
2+
/tmp
3+
/cache

.dvc/config

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[core]
2+
remote = upstream
3+
['remote "upstream"']
4+
url = https://dagshub.com/GenericMappingTools/pygmt.dvc

.dvcignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Add patterns of files dvc should ignore, which could improve
2+
# the performance. Learn more at
3+
# https://dvc.org/doc/user-guide/dvcignore
Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,35 @@
11
---
22
name: PyGMT release checklist
33
about: Checklist for a new PyGMT release.
4-
title: Release PyGMT x.x.x
4+
title: Release PyGMT vX.Y.Z
55
labels: maintenance
66
assignees: ''
77

88
---
99

10-
**Release**: [v0.x.x](https://github.com/GenericMappingTools/pygmt/milestones/0.x.x)
10+
**Release**: [v0.x.x](https://github.com/GenericMappingTools/pygmt/milestones/?)
1111
**Scheduled Date**: YYYY/MM/DD
12+
**Pull request due date**: YYYY/MM/DD
13+
14+
**Priority PRs/issues to complete prior to release**
15+
- [ ] Wrap X ()
16+
- [ ] Wrap Y ()
1217

1318
**Before release**:
1419
- [ ] Reserve a DOI on [Zenodo](https://zenodo.org) by clicking on "New Version"
15-
- [ ] Update Changelog
16-
- [ ] Add a new entry in `doc/_static/version_switch.js` for documentation switcher
17-
- [ ] Update citation information https://github.com/GenericMappingTools/pygmt#citing-pygmt
20+
- [ ] Finish up 'Changelog entry for v0.x.x' Pull Request:
21+
- [ ] Add a new entry in `doc/_static/version_switch.js` for documentation switcher
22+
- [ ] Update citation information https://github.com/GenericMappingTools/pygmt#citing-pygmt
23+
- [ ] 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
1826

1927
**Release**:
20-
- [ ] Go to [GitHub Release](https://github.com/GenericMappingTools/pygmt/releases) and make a release, this will automatically create a tag too
21-
- [ ] Manually upload the pygmt-vX.Y.Z.zip file to https://zenodo.org/deposit, make sure you file it under the correct reserved DOI
28+
- [ ] At the [PyGMT release page on GitHub](https://github.com/GenericMappingTools/pygmt/releases):
29+
- [ ] Edit the draft release notes with the finalized changelog
30+
- [ ] Set the tag version and release title to vX.Y.Z
31+
- [ ] 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
2233

2334
**After release**:
2435
- [ ] Update conda-forge [pygmt-feedstock](https://github.com/conda-forge/pygmt-feedstock) [Usually done automatically by conda-forge's bot]
@@ -27,7 +38,7 @@ assignees: ''
2738
- [ ] GMT [forum](https://forum.generic-mapping-tools.org/c/news/)
2839
- [ ] [Major/Minor releases only] GMT [website](https://github.com/GenericMappingTools/website) (News)
2940
- [ ] [ResearchGate](https://www.researchgate.net/project/PyGMT-A-Python-interface-for-the-Generic-Mapping-Tools)
30-
41+
- [ ] [Twitter](https://twitter.com/gmt_dev)
3142
---
3243

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

.github/codecov.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
codecov:
2+
notify:
3+
require_ci_to_pass: no
4+
5+
coverage:
6+
status:
7+
project:
8+
default:
9+
target: auto # increase overall coverage on each pull request
10+
threshold: 0.25% # Allow the coverage to drop by X%
11+
if_not_found: success
12+
if_ci_failed: failure
13+
patch:
14+
default:
15+
target: 90% # >=90% of new changes should be tested
16+
if_not_found: success
17+
if_ci_failed: failure
18+
19+
comment: off

.github/release-drafter.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1-
name-template: 'v$NEXT_PATCH_VERSION'
2-
tag-template: 'v$NEXT_PATCH_VERSION'
1+
name-template: 'v$RESOLVED_VERSION'
2+
tag-template: 'v$RESOLVED_VERSION'
3+
version-resolver:
4+
minor:
5+
labels:
6+
- 'feature'
7+
default: patch
38
categories:
49
- title: 'New Features'
510
label: 'feature'
@@ -18,9 +23,9 @@ exclude-labels:
1823
category-template: '### $TITLE'
1924
change-template: '* $TITLE ([#$NUMBER]($URL))'
2025
template: |
21-
## Release v$NEXT_PATCH_VERSION (20YY/MM/DD)
26+
## Release v$RESOLVED_VERSION (20YY/MM/DD)
2227
23-
[![Digital Object Identifier for PyGMT v$NEXT_PATCH_VERSION](https://zenodo.org/badge/DOI/10.5281/zenodo.3781524.svg)](https://doi.org/10.5281/zenodo.3781524)
28+
[![Digital Object Identifier for PyGMT v$RESOLVED_VERSION](https://zenodo.org/badge/DOI/10.5281/zenodo.3781524.svg)](https://doi.org/10.5281/zenodo.3781524)
2429
2530
### Highlights
2631

.github/workflows/cache_data.yaml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,31 +12,39 @@ jobs:
1212
gmt_cache:
1313
name: Cache GMT artifacts
1414
runs-on: macOS-latest
15+
defaults:
16+
run:
17+
shell: bash -l {0}
1518

1619
steps:
1720
# Setup Miniconda
1821
- name: Setup Miniconda
19-
uses: conda-incubator/setup-miniconda@v2.0.1
22+
uses: conda-incubator/setup-miniconda@v2.1.0
2023
with:
2124
channels: conda-forge
2225
miniconda-version: "latest"
2326

2427
# Install GMT
2528
- name: Install GMT
26-
shell: bash -l {0}
2729
run: conda install -c conda-forge gmt=6.1.1
2830

2931
# Download remote files
3032
- name: Download remote data
31-
shell: bash -l {0}
3233
run: |
3334
gmt which -Ga @earth_relief_10m_p @earth_relief_10m_g \
3435
@earth_relief_30m_p @earth_relief_30m_g \
3536
@earth_relief_01d_p @earth_relief_01d_g \
3637
@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
3745
gmt which -Ga @ridge.txt @Table_5_11.txt @test.dat.nc \
3846
@tut_bathy.nc @tut_quakes.ngdc @tut_ship.xyz \
39-
@usgs_quakes_22.txt
47+
@usgs_quakes_22.txt @fractures_06.txt
4048
4149
# Upload the downloaded files as artifacts to GitHub
4250
- name: Upload artifacts to GitHub

.github/workflows/check-links.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,14 @@ jobs:
2626
path: documentation
2727

2828
- name: Link Checker
29-
uses: lycheeverse/lychee-action@v1.0.4
29+
uses: lycheeverse/lychee-action@v1.0.6
3030
with:
3131
# 429: Too many requests
3232
args: >
3333
--accept 429
34+
--exclude "^https://doi.org/10.5281/zenodo$"
3435
--exclude "^https://zenodo.org/badge/DOI/$"
36+
--exclude "^https://zenodo.org/badge/DOI/10.5281/zenodo$"
3537
--exclude "^https://github.com/GenericMappingTools/pygmt/pull/[0-9]*$"
3638
--exclude "^https://github.com/GenericMappingTools/pygmt/issues/[0-9]*$"
3739
--exclude "^https://www.generic-mapping-tools.org/_static/gmt-logo.png/$"
@@ -40,6 +42,7 @@ jobs:
4042
--exclude "^git"
4143
--exclude "^file://"
4244
--exclude "^https://docs.generic-mapping-tools.org/latest/%s$"
45+
--exclude "https://hackmd.io/@pygmt"
4346
--verbose
4447
"repository/**/*.rst"
4548
"repository/**/*.md"

.github/workflows/ci_docs.yml

Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
# This workflow installs PyGMT, builds and deploys documentation
2+
3+
name: Docs
4+
5+
on:
6+
push:
7+
branches: [ master ]
8+
pull_request:
9+
types: [opened, reopened, synchronize, ready_for_review]
10+
paths-ignore:
11+
- 'pygmt/tests/**'
12+
- '*.md'
13+
- '*.json'
14+
- 'LICENSE.txt'
15+
- '.gitignore'
16+
- '.pylintrc'
17+
release:
18+
types:
19+
- published
20+
21+
jobs:
22+
docs:
23+
name: ${{ matrix.os }} - Python ${{ matrix.python-version }}
24+
runs-on: ${{ matrix.os }}
25+
strategy:
26+
fail-fast: false
27+
matrix:
28+
python-version: [3.9]
29+
os: [ubuntu-latest, macOS-latest, windows-latest]
30+
# Is it a draft Pull Request (true or false)?
31+
isDraft:
32+
- ${{ github.event.pull_request.draft }}
33+
# Only run one job (Ubuntu + Python 3.9) for draft PRs
34+
exclude:
35+
- os: macOS-latest
36+
isDraft: true
37+
- os: windows-latest
38+
isDraft: true
39+
defaults:
40+
run:
41+
shell: bash -l {0}
42+
43+
steps:
44+
# Cancel previous runs that are not completed
45+
- name: Cancel Previous Runs
46+
uses: styfle/cancel-workflow-action@0.8.0
47+
with:
48+
access_token: ${{ github.token }}
49+
50+
# Checkout current git repository
51+
- name: Checkout
52+
uses: actions/checkout@v2.3.4
53+
with:
54+
# fecth all history so that setuptools-scm works
55+
fetch-depth: 0
56+
57+
# Setup Miniconda
58+
- name: Setup Miniconda
59+
uses: conda-incubator/setup-miniconda@v2.1.0
60+
with:
61+
activate-environment: pygmt
62+
python-version: ${{ matrix.python-version }}
63+
channels: conda-forge
64+
miniconda-version: "latest"
65+
66+
# Install GMT and other required dependencies from conda-forge
67+
- name: Install dependencies
68+
run: |
69+
conda install gmt=6.1.1 numpy pandas xarray netCDF4 packaging \
70+
ipython make myst-parser \
71+
sphinx sphinx-copybutton sphinx-gallery sphinx_rtd_theme=0.5.1
72+
73+
# Show installed pkg information for postmortem diagnostic
74+
- name: List installed packages
75+
run: conda list
76+
77+
# Download cached remote files (artifacts) from GitHub
78+
- name: Download remote data from GitHub
79+
uses: dawidd6/action-download-artifact@v2.13.0
80+
with:
81+
workflow: cache_data.yaml
82+
workflow_conclusion: success
83+
name: gmt-cache
84+
path: .gmt
85+
86+
# Move downloaded files to ~/.gmt directory and list them
87+
- name: Move and list downloaded remote files
88+
run: |
89+
mkdir -p ~/.gmt
90+
mv .gmt/* ~/.gmt
91+
# Change modification times of the two files, so GMT won't refresh it
92+
touch ~/.gmt/server/gmt_data_server.txt ~/.gmt/server/gmt_hash_server.txt
93+
ls -lhR ~/.gmt
94+
95+
# Install the package that we want to test
96+
- name: Install the package
97+
run: |
98+
python setup.py sdist --formats=zip
99+
pip install dist/*
100+
101+
# Build the documentation
102+
- name: Build the documentation
103+
run: make -C doc clean all
104+
105+
- name: Checkout the gh-pages branch
106+
uses: actions/checkout@28c7f3d2b5162b5ddd3dfd9a45aa55eaf396478b
107+
with:
108+
ref: gh-pages
109+
# Checkout to this folder instead of the current one
110+
path: deploy
111+
# Download the entire history
112+
fetch-depth: 0
113+
if: (github.event_name == 'release' || github.event_name == 'push') && (matrix.os == 'ubuntu-latest')
114+
115+
- name: Push the built HTML to gh-pages
116+
run: |
117+
# Detect if this is a release or from the master branch
118+
if [[ "${GITHUB_EVENT_NAME}" == "release" ]]; then
119+
# Get the tag name without the "refs/tags/" part
120+
version="${GITHUB_REF#refs/*/}"
121+
else
122+
version=dev
123+
fi
124+
echo "Deploying version: $version"
125+
# Make the new commit message. Needs to happen before cd into deploy
126+
# to get the right commit hash.
127+
message="Deploy $version from $(git rev-parse --short HEAD)"
128+
cd deploy
129+
# Need to have this file so that Github doesn't try to run Jekyll
130+
touch .nojekyll
131+
# Delete all the files and replace with our new set
132+
echo -e "\nRemoving old files from previous builds of ${version}:"
133+
rm -rvf ${version}
134+
echo -e "\nCopying HTML files to ${version}:"
135+
cp -Rvf ../doc/_build/html/ ${version}/
136+
# If this is a new release, update the link from /latest to it
137+
if [[ "${version}" != "dev" ]]; then
138+
echo -e "\nSetup link from ${version} to 'latest'."
139+
rm -f latest
140+
ln -sf ${version} latest
141+
fi
142+
# Stage the commit
143+
git add -A .
144+
echo -e "\nChanges to be applied:"
145+
git status
146+
# Configure git to be the GitHub Actions account
147+
git config user.email "github-actions[bot]@users.noreply.github.com"
148+
git config user.name "github-actions[bot]"
149+
# If this is a dev build and the last commit was from a dev build
150+
# (detect if "dev" was in the previous commit message), reuse the
151+
# same commit
152+
if [[ "${version}" == "dev" && `git log -1 --format='%s'` == *"dev"* ]]; then
153+
echo -e "\nAmending last commit:"
154+
git commit --amend --reset-author -m "$message"
155+
else
156+
echo -e "\nMaking a new commit:"
157+
git commit -m "$message"
158+
fi
159+
# Make the push quiet just in case there is anything that could leak
160+
# sensitive information.
161+
echo -e "\nPushing changes to gh-pages."
162+
git push -fq origin gh-pages 2>&1 >/dev/null
163+
echo -e "\nFinished uploading generated files."
164+
if: (github.event_name == 'release' || github.event_name == 'push') && (matrix.os == 'ubuntu-latest')

0 commit comments

Comments
 (0)