Skip to content

Commit 9ddca59

Browse files
committed
Merge branch 'main' into datatypes/gmtdataset
2 parents 2b1d565 + 5014591 commit 9ddca59

31 files changed

+449
-610
lines changed

.github/ISSUE_TEMPLATE/bump_gmt_checklist.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ using the following command:
3737
- [ ] Bump the minimum required GMT version (1 PR)
3838
- [ ] Update `required_version` in `pygmt/clib/session.py`
3939
- [ ] Update `test_get_default` in `pygmt/tests/test_clib.py`
40-
- [ ] Update minimum required versions in `doc/minversions.rst`
40+
- [ ] Update minimum required versions in `doc/minversions.md`
4141
- [ ] Remove unsupported GMT version from `.github/workflows/ci_tests_legacy.yaml`
4242
- [ ] 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
4343
- [ ] Update deprecated syntax in source code and examples based on the [GMT Changelog](https://docs.generic-mapping-tools.org/latest/changes.html)

.github/ISSUE_TEMPLATE/release_checklist.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ assignees: ''
3131
- [ ] Update DOI (and url for BibTeX)
3232
- [ ] Update version
3333
- [ ] Update date released
34-
- [ ] Add the documentation link `doc/minversions.rst`
35-
- [ ] Add minimum required version information `doc/minversions.rst`
34+
- [ ] Add the documentation link `doc/minversions.md`
35+
- [ ] Add minimum required version information `doc/minversions.md`
3636
- [ ] 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))
3737

3838
**Release**:

.github/workflows/benchmarks.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ jobs:
6464
6565
# Download cached remote files (artifacts) from GitHub
6666
- name: Download remote data from GitHub
67-
uses: dawidd6/action-download-artifact@v3.0.0
67+
uses: dawidd6/action-download-artifact@v3.1.1
6868
with:
6969
workflow: cache_data.yaml
7070
workflow_conclusion: success
@@ -86,7 +86,7 @@ jobs:
8686

8787
# Run the benchmark tests
8888
- name: Run benchmarks
89-
uses: CodSpeedHQ/action@v2.1.1
89+
uses: CodSpeedHQ/action@v2.2.1
9090
with:
9191
run: |
9292
python -c "import pygmt; pygmt.show_versions()"

.github/workflows/ci_docs.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ on:
2323
- '!pygmt/tests/**'
2424
- 'doc/**'
2525
- 'examples/**'
26-
- 'README.rst'
26+
- 'README.md'
2727
- '.github/workflows/ci_docs.yml'
2828
pull_request:
2929
types: [opened, reopened, synchronize, ready_for_review]
@@ -32,7 +32,7 @@ on:
3232
- '!pygmt/tests/**'
3333
- 'doc/**'
3434
- 'examples/**'
35-
- 'README.rst'
35+
- 'README.md'
3636
- '.github/workflows/ci_docs.yml'
3737
release:
3838
types:
@@ -111,7 +111,7 @@ jobs:
111111
112112
# Download cached remote files (artifacts) from GitHub
113113
- name: Download remote data from GitHub
114-
uses: dawidd6/action-download-artifact@v3.0.0
114+
uses: dawidd6/action-download-artifact@v3.1.1
115115
with:
116116
workflow: cache_data.yaml
117117
workflow_conclusion: success

.github/workflows/ci_doctests.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ jobs:
7070
7171
# Download cached remote files (artifacts) from GitHub
7272
- name: Download remote data from GitHub
73-
uses: dawidd6/action-download-artifact@v3.0.0
73+
uses: dawidd6/action-download-artifact@v3.1.1
7474
with:
7575
workflow: cache_data.yaml
7676
workflow_conclusion: success

.github/workflows/ci_tests.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ jobs:
127127
128128
# Download cached remote files (artifacts) from GitHub
129129
- name: Download remote data from GitHub
130-
uses: dawidd6/action-download-artifact@v3.0.0
130+
uses: dawidd6/action-download-artifact@v3.1.1
131131
with:
132132
workflow: cache_data.yaml
133133
workflow_conclusion: success
@@ -165,7 +165,7 @@ jobs:
165165

166166
# Upload coverage to Codecov
167167
- name: Upload coverage to Codecov
168-
uses: codecov/codecov-action@v4.0.1
168+
uses: codecov/codecov-action@v4.1.0
169169
with:
170170
file: ./coverage.xml # optional
171171
env_vars: OS,PYTHON,NUMPY

.github/workflows/ci_tests_dev.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ jobs:
134134

135135
# Download cached remote files (artifacts) from GitHub
136136
- name: Download remote data from GitHub
137-
uses: dawidd6/action-download-artifact@v3.0.0
137+
uses: dawidd6/action-download-artifact@v3.1.1
138138
with:
139139
workflow: cache_data.yaml
140140
workflow_conclusion: success

.github/workflows/ci_tests_legacy.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ jobs:
8282
8383
# Download cached remote files (artifacts) from GitHub
8484
- name: Download remote data from GitHub
85-
uses: dawidd6/action-download-artifact@v3.0.0
85+
uses: dawidd6/action-download-artifact@v3.1.1
8686
with:
8787
workflow: cache_data.yaml
8888
workflow_conclusion: success

.github/workflows/format-command.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ jobs:
4040
- name: Commit to the PR branch if any changes
4141
run: |
4242
make format
43-
find . -type f -not -path '*/\.git/*' -exec grep -Iq . {} \; -exec dos2unix {} \;
44-
find . -type f -not -path '*/\.git/*' -exec grep -Iq . {} \; -exec chmod 644 {} \;
43+
git ls-files -z | xargs -0 dos2unix --quiet
44+
git ls-files -z | xargs -0 chmod 644
4545
if [[ $(git ls-files -m) ]]; then
4646
git config --global user.name 'actions-bot'
4747
git config --global user.email '[email protected]'

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ on:
2424
- 'Makefile'
2525
- 'MANIFEST.in'
2626
- 'pyproject.toml'
27-
- 'README.rst'
27+
- 'README.md'
2828
- '.github/workflows/publish-to-pypi.yml'
2929
release:
3030
types:

.github/workflows/slash-command-dispatch.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
runs-on: ubuntu-latest
1515
steps:
1616
- name: Slash Command Dispatch
17-
uses: peter-evans/slash-command-dispatch@v3
17+
uses: peter-evans/slash-command-dispatch@v4
1818
with:
1919
token: ${{ secrets.GITHUB_TOKEN }}
2020
commands: |

.github/workflows/style_checks.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,13 @@ jobs:
4343

4444
- name: Ensure files use UNIX line breaks and have 644 permission
4545
run: |
46-
find . -type f -not -path '*/\.git/*' -exec grep -Iq . {} \; -exec dos2unix --quiet {} \;
47-
find . -type f -not -path '*/\.git/*' -exec grep -Iq . {} \; -exec chmod 644 {} \;
46+
git ls-files -z | xargs -0 dos2unix --quiet
47+
git ls-files -z | xargs -0 chmod 644
4848
if [[ $(git ls-files -m) ]]; then git --no-pager diff HEAD; exit 1; fi
4949
5050
- name: Ensure example scripts have at least one code block separator
5151
run: |
52-
grep --files-without-match '# %%' $(find 'examples' -name '*.py') > output.txt
52+
git ls-files 'examples/**/*.py' | xargs grep --files-without-match '# %%' > output.txt
5353
nfiles=$(wc --lines output.txt | awk '{print $1}')
5454
if [[ $nfiles > 0 ]]; then
5555
echo "Code block separator '# %%' is required in following example files:"

.readthedocs.yaml

+1-4
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,13 @@ build:
2121
examples \
2222
pygmt/**/*.py \
2323
':!pygmt/tests' \
24-
README.rst \
24+
README.md \
2525
ci/requirements/docs.yml \
2626
.readthedocs.yaml;
2727
then
2828
exit 183;
2929
fi
3030
pre_build:
31-
# ReadTheDocs fails to download external resources.
32-
# Temporarily delete the two files to make ReadTheDocs building work again.
33-
- rm examples/gallery/lines/roads.py examples/gallery/maps/choropleth_map.py
3431
# Generate api stub files before building
3532
- make -C doc api
3633

AUTHORS.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ The following people have contributed code and/or documentation to the project
1313
* [Dongdong Tian](https://seisman.info/) | [0000-0001-7967-1197](https://orcid.org/0000-0001-7967-1197) | China University of Geosciences, China
1414
* [Jamie Quinn](http://jamiejquinn.com) | [0000-0002-0268-7032](https://orcid.org/0000-0002-0268-7032) | University College London, United Kingdom
1515
* [Jiayuan Yao](https://github.com/core-man) | [0000-0001-7036-4238](https://orcid.org/0000-0001-7036-4238) | Nanyang Technological University, Singapore
16-
* [Jing-Hui Tong](https://github.com/JingHuiTong) | [0009-0002-7195-3071](https://orcid.org/0009-0002-7195-3071) | National Taiwan Normal University, Taiwan
16+
* [Jing-Hui Tong](https://github.com/jhtong33) | [0009-0002-7195-3071](https://orcid.org/0009-0002-7195-3071) | National Taiwan Normal University, Taiwan
1717
* [Kathryn Materna](https://github.com/kmaterna) | [0000-0002-6687-980X](https://orcid.org/0000-0002-6687-980X) | US Geological Survey, USA
1818
* [Leonardo Uieda](http://www.leouieda.com/) | [0000-0001-6123-9515](https://orcid.org/0000-0001-6123-9515) | University of Liverpool, United Kingdom
1919
* [Liam Toney](https://liam.earth/) | [0000-0003-0167-9433](https://orcid.org/0000-0003-0167-9433) | University of Alaska Fairbanks, USA

README.md

+203
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,203 @@
1+
# PyGMT
2+
3+
> A Python interface for the Generic Mapping Tools
4+
5+
[Documentation (development version)](https://www.pygmt.org/dev) | [Contact](https://forum.generic-mapping-tools.org) | [TryOnline](https://github.com/GenericMappingTools/try-gmt)
6+
7+
[![Latest version on PyPI](http://img.shields.io/pypi/v/pygmt.svg?style=flat-square)](https://pypi.python.org/pypi/pygmt)
8+
[![Latest version on conda-forge](https://img.shields.io/conda/v/conda-forge/pygmt?style=flat-square)](https://anaconda.org/conda-forge/pygmt)
9+
[![GitHub Actions Tests status](https://github.com/GenericMappingTools/pygmt/workflows/Tests/badge.svg)](https://github.com/GenericMappingTools/pygmt/actions/workflows/ci_tests.yaml)
10+
[![GitHub Actions GMT Dev Tests status](https://github.com/GenericMappingTools/pygmt/workflows/GMT%20Dev%20Tests/badge.svg)](https://github.com/GenericMappingTools/pygmt/actions/workflows/ci_tests_dev.yaml)
11+
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
12+
[![Test coverage status](https://codecov.io/gh/GenericMappingTools/pygmt/branch/main/graph/badge.svg?token=78Fu4EWstx)](https://app.codecov.io/gh/GenericMappingTools/pygmt)
13+
[![CodSpeed Performance Benchmarks](https://img.shields.io/endpoint?url=https://codspeed.io/badge.json)](https://codspeed.io/GenericMappingTools/pygmt)
14+
[![Compatible Python versions.](https://img.shields.io/pypi/pyversions/pygmt.svg?style=flat-square)](https://pypi.python.org/pypi/pygmt)
15+
[![Discourse forum](https://img.shields.io/discourse/status?label=forum&server=https%3A%2F%2Fforum.generic-mapping-tools.org%2F&style=flat-square)](https://forum.generic-mapping-tools.org)
16+
[![Digital Object Identifier for the Zenodo archive](https://zenodo.org/badge/DOI/10.5281/3781524.svg)](https://doi.org/10.5281/zenodo.3781524)
17+
[![PyOpenSci](https://tinyurl.com/y22nb8up)](https://github.com/pyOpenSci/software-review/issues/43)
18+
[![GitHub license](https://img.shields.io/github/license/GenericMappingTools/pygmt?style=flat-square)](https://github.com/GenericMappingTools/pygmt/blob/main/LICENSE.txt)
19+
[![Contributor Code of Conduct](https://img.shields.io/badge/Contributor%20Covenant-v2.1%20adopted-ff69b4.svg)](CODE_OF_CONDUCT.md)
20+
21+
<!-- doc-index-start-after -->
22+
23+
## Why PyGMT?
24+
25+
A beautiful map is worth a thousand words. To truly understand how powerful PyGMT is, play with it online on
26+
[Binder](https://github.com/GenericMappingTools/try-gmt)! For a quicker introduction, check out our
27+
[3 minute overview](https://youtu.be/4iPnITXrxVU)!
28+
29+
Afterwards, feel free to look at our [Tutorials](https://www.pygmt.org/latest/tutorials), visit the
30+
[Gallery](https://www.pygmt.org/latest/gallery), and check out some
31+
[external PyGMT examples](https://www.pygmt.org/latest/external_resources.html)!
32+
33+
![Quick Introduction to PyGMT YouTube Video](doc/_static/scipy2022-youtube-thumbnail.jpg)
34+
35+
## About
36+
37+
PyGMT is a library for processing geospatial and geophysical data and making publication-quality
38+
maps and figures. It provides a Pythonic interface for the
39+
[Generic Mapping Tools (GMT)](https://github.com/GenericMappingTools/gmt), a command-line program
40+
widely used across the Earth, Ocean, and Planetary sciences and beyond.
41+
42+
## Project goals
43+
44+
- Make GMT more accessible to new users.
45+
- Build a Pythonic API for GMT.
46+
- Interface with the GMT C API directly using ctypes (no system calls).
47+
- Support for rich display in the Jupyter notebook.
48+
- Integration with the [PyData ecosystem](https://pydata.org/): `numpy.ndarray` or `pandas.DataFrame` for
49+
data tables, `xarray.DataArray` for grids, and `geopandas.GeoDataFrame` for geographical data.
50+
51+
## Quickstart
52+
53+
### Installation
54+
55+
Simple installation using [mamba](https://mamba.readthedocs.org/):
56+
57+
```bash
58+
mamba install --channel conda-forge pygmt
59+
```
60+
61+
If you use [conda](https://docs.conda.io/projects/conda/en/latest/user-guide/index.html):
62+
63+
```bash
64+
conda install --channel conda-forge pygmt
65+
```
66+
67+
For other ways to install `pygmt`, see the [full installation instructions](https://www.pygmt.org/latest/install.html).
68+
69+
### Getting started
70+
71+
As a starting point, you can open a [Python interpreter](https://docs.python.org/3/tutorial/interpreter.html)
72+
or a [Jupyter notebook](https://docs.jupyter.org/en/latest/running.html), and try the following example:
73+
74+
``` python
75+
import pygmt
76+
fig = pygmt.Figure()
77+
fig.coast(projection="H10c", region="g", frame=True, land="gray")
78+
fig.show()
79+
```
80+
81+
For more examples, please have a look at the [Gallery](https://www.pygmt.org/latest/gallery/index.html) and
82+
[Tutorials](https://www.pygmt.org/latest/tutorials/index.html).
83+
84+
## Contacting us
85+
86+
- Most discussion happens [on GitHub](https://github.com/GenericMappingTools/pygmt).
87+
Feel free to [open an issue](https://github.com/GenericMappingTools/pygmt/issues/new) or comment on any open
88+
issue or pull request.
89+
- We have a [Discourse forum](https://forum.generic-mapping-tools.org/c/questions/pygmt-q-a) where you can ask
90+
questions and leave comments.
91+
92+
## Contributing
93+
94+
### Code of conduct
95+
96+
Please note that this project is released with a
97+
[Contributor Code of Conduct](https://github.com/GenericMappingTools/.github/blob/main/CODE_OF_CONDUCT.md).
98+
By participating in this project you agree to abide by its terms.
99+
100+
### Contributing guidelines
101+
102+
Please read our [Contributing Guide](https://github.com/GenericMappingTools/pygmt/blob/main/CONTRIBUTING.md)
103+
to see how you can help and give feedback.
104+
105+
### Imposter syndrome disclaimer
106+
107+
**We want your help.** No, really.
108+
109+
There may be a little voice inside your head that is telling you that you're not ready to be an open source
110+
contributor; that your skills aren't nearly good enough to contribute. What could you possibly offer?
111+
112+
We assure you that the little voice in your head is wrong.
113+
114+
**Being a contributor doesn't just mean writing code.** Equally important contributions include: writing or
115+
proof-reading documentation, suggesting or implementing tests, or even giving feedback about the project
116+
(including giving feedback about the contribution process). If you're coming to the project with fresh eyes,
117+
you might see the errors and assumptions that seasoned contributors have glossed over. If you can write any
118+
code at all, you can contribute code to open source. We are constantly trying out new skills, making mistakes,
119+
and learning from those mistakes. That's how we all improve and we are happy to help others learn.
120+
121+
*This disclaimer was adapted from the* [MetPy project](https://github.com/Unidata/MetPy).
122+
123+
## Citing PyGMT
124+
125+
PyGMT is a community developed project. See the
126+
[AUTHORS.md](https://github.com/GenericMappingTools/pygmt/blob/main/AUTHORS.md) file on GitHub for a list of
127+
the people involved and a definition of the term "PyGMT Developers". Feel free to cite our work in your
128+
research using the following BibTeX:
129+
130+
```
131+
@software{
132+
pygmt_2024_10578540,
133+
author = {Tian, Dongdong and
134+
Uieda, Leonardo and
135+
Leong, Wei Ji and
136+
Schlitzer, William and
137+
Fröhlich, Yvonne and
138+
Grund, Michael and
139+
Jones, Max and
140+
Toney, Liam and
141+
Yao, Jiayuan and
142+
Magen, Yohai and
143+
Tong, Jing-Hui and
144+
Materna, Kathryn and
145+
Belem, Andre and
146+
Newton, Tyler and
147+
Anant, Abhishek and
148+
Ziebarth, Malte and
149+
Quinn, Jamie and
150+
Wessel, Paul},
151+
title = {{PyGMT: A Python interface for the Generic Mapping Tools}},
152+
month = feb,
153+
year = 2024,
154+
publisher = {Zenodo},
155+
version = {0.11.0},
156+
doi = {10.5281/zenodo.10578540},
157+
url = {https://doi.org/10.5281/zenodo.10578540}
158+
}
159+
```
160+
161+
To cite a specific version of PyGMT, go to our Zenodo page at <https://doi.org/10.5281/zenodo.3781524>
162+
and use the "Export to BibTeX" function there. It is also strongly recommended to cite the
163+
[GMT 6 paper](https://doi.org/10.1029/2019GC008515) (which PyGMT wraps around). Note that some modules
164+
like `dimfilter`, `surface`, and `x2sys` also have their dedicated citations. Further information for
165+
all these can be found at <https://www.generic-mapping-tools.org/cite>.
166+
167+
## License
168+
169+
PyGMT is free software: you can redistribute it and/or modify it under the terms of the
170+
**BSD 3-clause License**. A copy of this license is provided in
171+
[LICENSE.txt](https://github.com/GenericMappingTools/pygmt/blob/main/LICENSE.txt).
172+
173+
## Support
174+
175+
The development of PyGMT has been supported by NSF grants
176+
[OCE-1558403](https://www.nsf.gov/awardsearch/showAward?AWD_ID=1558403) and
177+
[EAR-1948603](https://www.nsf.gov/awardsearch/showAward?AWD_ID=1948602).
178+
179+
## Related projects
180+
181+
Other official wrappers for GMT:
182+
183+
- [GMT.jl](https://github.com/GenericMappingTools/GMT.jl): A Julia wrapper for GMT.
184+
- [gmtmex](https://github.com/GenericMappingTools/gmtmex): A Matlab/Octave wrapper for GMT.
185+
186+
Other non-official Python wrappers for GMT (not maintained):
187+
188+
- [gmtpy](https://github.com/emolch/gmtpy) by [Sebastian Heimann](https://github.com/emolch)
189+
- [pygmt](https://github.com/ian-r-rose/pygmt) by [Ian Rose](https://github.com/ian-r-rose)
190+
- [PyGMT](https://github.com/glimmer-cism/PyGMT) by [Magnus Hagdorn](https://github.com/mhagdorn)
191+
192+
<!-- doc-index-end-before -->
193+
194+
## Minimum supported versions
195+
196+
PyGMT has adopted [SPEC0](https://scientific-python.org/specs/spec-0000/) alongside the rest of the
197+
Scientific Python ecosystem, and therefore:
198+
199+
- Support for Python versions be dropped 3 years after their initial release.
200+
- Support for core package dependencies (NumPy/Pandas/Xarray) be opped 2 years after their initial release.
201+
202+
For the supported GMT versions as well as the minimum required versions of Python and core package
203+
dependencies, please see [Minimum Supported Versions](https://www.pygmt.org/dev/minversions.html).

0 commit comments

Comments
 (0)