Skip to content

Commit 80c1062

Browse files
committed
Merge branch 'master' into put-vector-text
2 parents 24ad0af + 477fe81 commit 80c1062

10 files changed

+163
-116
lines changed

.github/ISSUE_TEMPLATE/release_checklist.md

Lines changed: 18 additions & 7 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]

.github/release-drafter.yml

Lines changed: 7 additions & 2 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'

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
4848
- name: Build source and wheel distributions
4949
run: |
50-
python setup.py sdist bdist_wheel
50+
make package
5151
echo ""
5252
echo "Generated files:"
5353
ls -lh dist/

AUTHORS.md

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

1111
* [Dongdong Tian](https://seisman.info/) | [0000-0001-7967-1197](https://orcid.org/0000-0001-7967-1197) | Michigan State University
12+
* [Jiayuan Yao](https://github.com/core-man) | [0000-0001-7036-4238](https://orcid.org/0000-0001-7036-4238) | Nanyang Technological University
1213
* [Leonardo Uieda](http://www.leouieda.com/) | [0000-0001-6123-9515](https://orcid.org/0000-0001-6123-9515) | University of Liverpool
1314
* [Liam Toney](https://liam.earth/) | [0000-0003-0167-9433](https://orcid.org/0000-0003-0167-9433) | University of Alaska Fairbanks
1415
* [Malte Ziebarth](https://github.com/mjziebarth) | [0000-0002-5190-4478](https://orcid.org/0000-0002-5190-4478) | GFZ German Research Centre for Geosciences

MAINTENANCE.md

Lines changed: 60 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ making releases, creating packages, etc.
66
If you want to make a contribution to the project, see the
77
[Contributing Guide](CONTRIBUTING.md) instead.
88

9+
## Onboarding Access Checklist
10+
11+
- [ ] Added to [python-maintainers](https://github.com/orgs/GenericMappingTools/teams/python-maintainers) team in the [GenericMappingTools](https://github.com/orgs/GenericMappingTools/teams/) organization on GitHub (gives 'maintain' permissions)
12+
- [ ] Added as moderator on [GMT forum](https://forum.generic-mapping-tools.org) (to see mod-only discussions)
13+
- [ ] Added as member on the [PyGMT devs Slack channel](https://pygmtdevs.slack.com) (for casual conversations)
14+
- [ ] Added as maintainer on [PyPI](https://pypi.org/project/pygmt/) and [Test PyPI](https://test.pypi.org/project/pygmt) [optional]
15+
- [ ] Added as member on [HackMD](https://hackmd.io/@pygmt) [optional]
916

1017
## Branches
1118

@@ -47,43 +54,58 @@ conda and the `Makefile` to run the tests and checks.
4754

4855
### GitHub Actions
4956

50-
There are 5 configuration files located in `.github/workflows`:
57+
There are 8 configuration files located in `.github/workflows`:
5158

5259
1. `style_checks.yaml` (Code lint and style checks)
5360

54-
This is ran on every commit to the *master* and Pull Request branches.
55-
It is also scheduled to run daily on the *master* branch.
61+
This is run on every commit to the *master* and Pull Request branches.
62+
It is also scheduled to run daily on the *master* branch.
5663

5764
2. `ci_tests.yaml` (Tests on Linux/macOS/Windows)
5865

59-
This is ran on every commit to the *master* and Pull Request branches.
60-
It is also scheduled to run daily on the *master* branch.
61-
In draft Pull Requests, only one job (Ubuntu + Python latest)
62-
is triggered to save on Continuous Integration resources.
66+
This is run on every commit to the *master* and Pull Request branches.
67+
It is also scheduled to run daily on the *master* branch.
68+
In draft Pull Requests, only one job (Ubuntu + Python latest)
69+
is triggered to save on Continuous Integration resources.
6370

64-
On the *master* branch, the workflow also handles the documentation deployment:
71+
On the *master* branch, the workflow also handles the documentation
72+
deployment:
6573

66-
* Updating the development documentation by pushing the built HTML pages from the
67-
*master* branch onto the `dev` folder of the *gh-pages* branch.
68-
* Updated the `latest` documentation link to the new release.
74+
* Updating the development documentation by pushing the built HTML pages
75+
from the *master* branch onto the `dev` folder of the *gh-pages* branch.
76+
* Updating the `latest` documentation link to the new release.
6977

7078
3. `ci_tests_dev.yaml` (GMT Dev Tests on Linux/macOS/Windows).
7179

72-
This is triggered when a PR is marked as "ready for review", or using the slash
73-
command `/test-gmt-dev`. It is also scheduled to run daily on the *master* branch.
80+
This is triggered when a PR is marked as "ready for review", or using the
81+
slash command `/test-gmt-dev`. It is also scheduled to run daily on the
82+
*master* branch.
7483

7584
4. `cache_data.yaml` (Caches GMT remote data files needed for GitHub Actions CI)
7685

77-
This is scheduled to run every Sunday at 12 noon.
78-
If new remote files are needed urgently, maintainers can manually uncomment
79-
the 'pull_request:' line in that `cache_data.yaml` file to refresh the cache.
86+
This is scheduled to run every Sunday at 12:00 (UTC).
87+
If new remote files are needed urgently, maintainers can manually uncomment
88+
the 'pull_request:' line in that `cache_data.yaml` file to refresh the cache.
8089

8190
5. `publish-to-pypi.yml` (Publish wheels to PyPI and TestPyPI)
8291

83-
This workflow is ran to publish wheels to PyPI and TestPyPI (for testing only).
84-
Archives will be pushed to TestPyPI on every commit to the *master* branch and
85-
tagged releases, and to PyPI for tagged releases only.
92+
This workflow is run to publish wheels to PyPI and TestPyPI (for testing only).
93+
Archives will be pushed to TestPyPI on every commit to the *master* branch
94+
and tagged releases, and to PyPI for tagged releases only.
95+
96+
6. `release-drafter.yml` (Drafts the next release notes)
97+
98+
This workflow is run to update the next releases notes as pull requests are
99+
merged into master.
100+
101+
7. `check-links.yml` (Check links in the repository and website)
102+
103+
This workflow is run weekly to check all external links in plaintext and
104+
HTML files. It will create an issue if broken links are found.
86105

106+
8. `format-command.yml` (Format the codes using slash command)
107+
108+
This workflow is triggered in a PR if the slash command `/format` is used.
87109

88110
## Continuous Documentation
89111

@@ -116,31 +138,28 @@ https://github.com/release-drafter/release-drafter.
116138
The drafted release notes are not perfect, so we will need to tidy it prior to
117139
publishing the actual release notes at https://www.pygmt.org/latest/changes.html.
118140

119-
1. Generate a list of commits between the last release tag and now:
141+
1. Go to https://github.com/GenericMappingTools/pygmt/releases and click on the
142+
'Edit' button next to the current draft release note. Copy the text of the
143+
automatically drafted release notes under the 'Write' tab to
144+
`doc/changes.md`. Add a section separator `---` between the new and old
145+
changelog sections.
146+
2. Update the DOI badge in the changelog. Remember to replace the DOI number
147+
inside the badge url.
120148

121-
```bash
122-
git log HEAD...v0.1.2 --pretty="* %s" > changes.txt
123149
```
124-
125-
2. Edit the changes list to remove any trivial changes (updates to the README, typo
126-
fixes, CI configuration, etc).
127-
3. Replace the PR number in the commit titles with a link to the GitHub PR page.
128-
Use ``sed -i.bak -E 's$\(#([0-9]*)\)$(`#\1 <https://github.com/GenericMappingTools/pygmt/pull/\1>`__)$g' changes.rst``
129-
to make the change automatically.
130-
4. Copy the remaining changes to `doc/changes.rst` under a new section for the
131-
intended release.
132-
5. Add a list of people who contributed to the release (use
133-
`` git shortlog HEAD...v0.1.2 -sne ``).
134-
6. Include the DOI badge in the changelog. Remember to replace your DOI inside the badge url.
135-
150+
[![Digital Object Identifier for PyGMT vX.Y.Z](https://zenodo.org/badge/DOI/10.5281/zenodo.<INSERT-DOI-HERE>.svg)](https://doi.org/10.5281/zenodo.<INSERT-DOI-HERE>)
136151
```
137-
.. image:: https://zenodo.org/badge/DOI/<INSERT-DOI-HERE>.svg
138-
:alt: Digital Object Identifier for the Zenodo archive
139-
:target: https://doi.org/<INSERT-DOI-HERE>
140-
```
141-
142-
7. Add a link to the new release version documentation in `README.rst`.
143-
8. Open a new PR with the updated changelog.
152+
3. Open a new Pull Request using the title 'Changelog entry for vX.Y.Z' with
153+
the updated release notes, so that other people can help to review and
154+
collaborate on the changelog curation process described next.
155+
4. Edit the change list to remove any trivial changes (updates to the README,
156+
typo fixes, CI configuration, etc).
157+
5. Edit the list of people who contributed to the release, linking to their
158+
GitHub account. Sort their names by the number of commits made since the
159+
last release (e.g. use `` git shortlog HEAD...v0.1.2 -sne ``).
160+
6. Update `README.rst` with new information on the new release version, namely
161+
the BibTeX citation, a vX.Y.Z documentation link, and compatibility with
162+
Python and GMT versions.
144163
145164
### Check the README syntax
146165

Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ help:
1515
@echo "Commands:"
1616
@echo ""
1717
@echo " install install in editable mode"
18+
@echo " package build source and wheel distributions"
1819
@echo " test run the test suite (including doctests) and report coverage"
1920
@echo " format run black, blackdoc, docformatter and isort to automatically format the code"
2021
@echo " check run code style and quality checks (black, blackdoc, docformatter, flake8 and isort)"
@@ -26,6 +27,9 @@ help:
2627
install:
2728
pip install --no-deps -e .
2829

30+
package:
31+
python setup.py sdist bdist_wheel
32+
2933
test:
3034
# Run a tmp folder to make sure the tests are run on the installed version
3135
mkdir -p $(TESTDIR)
@@ -57,10 +61,11 @@ clean:
5761
find . -name "*.pyc" -exec rm -v {} +
5862
find . -name "*~" -exec rm -v {} +
5963
find . -type d -name "__pycache__" -exec rm -rv {} +
60-
rm -rvf build dist MANIFEST .coverage .cache .pytest_cache htmlcov coverage.xml
64+
rm -rvf build dist .eggs MANIFEST .coverage .cache .pytest_cache htmlcov coverage.xml
6165
rm -rvf $(TESTDIR)
6266
rm -rvf baseline
6367
rm -rvf result_images
68+
rm -rvf results
6469

6570
distclean: clean
6671
rm -rvf *.egg-info

README.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ PyGMT
1212
:target: https://pypi.python.org/pypi/pygmt
1313
.. image:: https://github.com/GenericMappingTools/pygmt/workflows/Tests/badge.svg
1414
:alt: GitHub Actions Tests status
15-
:target: https://github.com/GenericMappingTools/pygmt/actions?query=workflow%3ATests
15+
:target: https://github.com/GenericMappingTools/pygmt/actions/workflows/ci_tests.yaml
1616
.. image:: https://github.com/GenericMappingTools/pygmt/workflows/GMT%20Dev%20Tests/badge.svg
1717
:alt: GitHub Actions GMT Dev Tests status
18-
:target: https://github.com/GenericMappingTools/pygmt/actions?query=workflow%3A%22GMT+Latest+Tests%22
18+
:target: https://github.com/GenericMappingTools/pygmt/actions/workflows/ci_tests_dev.yaml
1919
.. image:: https://img.shields.io/codecov/c/github/GenericMappingTools/pygmt/master.svg?style=flat-square
2020
:alt: Test coverage status
2121
:target: https://codecov.io/gh/GenericMappingTools/pygmt
@@ -86,8 +86,8 @@ Project goals
8686
* Build a Pythonic API for GMT.
8787
* Interface with the GMT C API directly using ctypes (no system calls).
8888
* Support for rich display in the Jupyter notebook.
89-
* Integration with the `PyData <https://pydata.org/>`__ ecosystem:
90-
``numpy.ndarray`` or ``pandas.DataFrame`` for data tables and
89+
* Integration with the `PyData <https://pydata.org/>`__ ecosystem:
90+
``numpy.ndarray`` or ``pandas.DataFrame`` for data tables and
9191
``xarray.DataArray`` for grids.
9292

9393

pygmt/clib/loading.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,10 @@ def clib_full_names(env=None):
116116
)
117117
assert libfullpath.exists()
118118
yield str(libfullpath)
119-
except (FileNotFoundError, AssertionError): # command not found
119+
except (FileNotFoundError, AssertionError, sp.CalledProcessError):
120+
# the 'gmt' executable is not found
121+
# the gmt library is not found
122+
# the 'gmt' executable is broken
120123
pass
121124

122125
# 3. Search for DLLs in PATH by calling find_library() (Windows only)

pygmt/tests/test_datasets.py renamed to pygmt/tests/test_datasets_earth_relief.py

Lines changed: 2 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,13 @@
11
"""
2-
Test basic functionality for loading datasets.
2+
Test basic functionality for loading Earth relief datasets.
33
"""
44
import numpy as np
55
import numpy.testing as npt
66
import pytest
7-
from pygmt.datasets import (
8-
load_earth_relief,
9-
load_japan_quakes,
10-
load_ocean_ridge_points,
11-
load_sample_bathymetry,
12-
load_usgs_quakes,
13-
)
7+
from pygmt.datasets import load_earth_relief
148
from pygmt.exceptions import GMTInvalidInput
159

1610

17-
def test_japan_quakes():
18-
"""
19-
Check that the dataset loads without errors.
20-
"""
21-
data = load_japan_quakes()
22-
assert data.shape == (115, 7)
23-
summary = data.describe()
24-
assert summary.loc["min", "year"] == 1987
25-
assert summary.loc["max", "year"] == 1988
26-
assert summary.loc["min", "month"] == 1
27-
assert summary.loc["max", "month"] == 12
28-
assert summary.loc["min", "day"] == 1
29-
assert summary.loc["max", "day"] == 31
30-
31-
32-
def test_ocean_ridge_points():
33-
"""
34-
Check that the @ridge.txt dataset loads without errors.
35-
"""
36-
data = load_ocean_ridge_points()
37-
assert data.shape == (4146, 2)
38-
summary = data.describe()
39-
assert summary.loc["min", "longitude"] == -179.9401
40-
assert summary.loc["max", "longitude"] == 179.935
41-
assert summary.loc["min", "latitude"] == -65.6182
42-
assert summary.loc["max", "latitude"] == 86.8
43-
44-
45-
def test_sample_bathymetry():
46-
"""
47-
Check that the @tut_ship.xyz dataset loads without errors.
48-
"""
49-
data = load_sample_bathymetry()
50-
assert data.shape == (82970, 3)
51-
summary = data.describe()
52-
assert summary.loc["min", "longitude"] == 245.0
53-
assert summary.loc["max", "longitude"] == 254.705
54-
assert summary.loc["min", "latitude"] == 20.0
55-
assert summary.loc["max", "latitude"] == 29.99131
56-
assert summary.loc["min", "bathymetry"] == -7708.0
57-
assert summary.loc["max", "bathymetry"] == -9.0
58-
59-
60-
def test_usgs_quakes():
61-
"""
62-
Check that the dataset loads without errors.
63-
"""
64-
data = load_usgs_quakes()
65-
assert data.shape == (1197, 22)
66-
67-
6811
def test_earth_relief_fails():
6912
"""
7013
Make sure earth relief fails for invalid resolutions.

0 commit comments

Comments
 (0)