Skip to content

Commit f545e17

Browse files
committed
Merge branch 'main' into python-3.13
2 parents bfcec3a + 29f12f5 commit f545e17

Some content is hidden

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

56 files changed

+1615
-1242
lines changed

.dvcignore

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
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
1+
# Add patterns of files dvc should ignore, which could improve the performance.
2+
# Learn more at https://dvc.org/doc/user-guide/project-structure/dvcignore-files

.github/ISSUE_TEMPLATE/4-release_checklist.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ assignees: ''
1919

2020
**Before release**:
2121

22-
- [ ] Check [SPEC 0](https://scientific-python.org/specs/spec-0000/) to see if we need to bump the minimum supported versions of GMT, Python and core package dependencies (NumPy/Pandas/Xarray)
22+
- [ ] Check [SPEC 0](https://scientific-python.org/specs/spec-0000/) to see if we need to bump the minimum supported versions of GMT, Python and
23+
core package dependencies (NumPy, pandas, Xarray)
2324
- [ ] Review the ["PyGMT Team" page](https://www.pygmt.org/dev/team.html)
2425
- [ ] Check to ensure that:
2526
- [ ] Deprecations and related tests are removed for this version by running `grep --include="*.py" -r vX.Y.Z` from the base of the repository

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
Fixes #
99

1010

11+
<!-- If significant changes to the documentation are made, please insert the link to the documentation page after it has been built. -->
12+
**Preview**:
13+
14+
1115
**Reminders**
1216

1317
- [ ] Run `make format` and `make check` to make sure the code follows the style guide.

.github/release-drafter.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ exclude-contributors:
2424
- 'actions-bot'
2525
- 'dependabot'
2626
- 'dependabot[bot]'
27+
- 'pre-commit-ci'
28+
- 'pre-commit-ci[bot]'
2729
category-template: '### $TITLE'
2830
change-template: '* $TITLE ([#$NUMBER]($URL))'
2931
sort-by: 'title'

.github/workflows/benchmarks.yml

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

8989
# Run the benchmark tests
9090
- name: Run benchmarks
91-
uses: CodSpeedHQ/[email protected].0
91+
uses: CodSpeedHQ/[email protected].1
9292
with:
9393
# 'bash -el -c' is needed to use the custom shell.
9494
# See https://github.com/CodSpeedHQ/action/issues/65.

.github/workflows/check-links.yml

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -35,32 +35,29 @@ jobs:
3535

3636
- name: Link Checker
3737
id: lychee
38-
uses: lycheeverse/lychee-action@v1.10.0
38+
uses: lycheeverse/lychee-action@v2.0.2
3939
with:
40+
fail: false # Don't fail action on broken links
4041
output: /tmp/lychee-out.md
4142
# 429: Too many requests
4243
args: >
4344
--accept 429
44-
--exclude "^https://doi.org/10.5281/zenodo$"
45-
--exclude "^https://zenodo.org/badge/DOI/$"
46-
--exclude "^https://zenodo.org/badge/DOI/10.5281/zenodo$"
47-
--exclude "^https://github.com/GenericMappingTools/pygmt/pull/[0-9]*$"
48-
--exclude "^https://github.com/GenericMappingTools/pygmt/issues/[0-9]*$"
45+
--exclude "^https://docs.generic-mapping-tools.org/6.[0-9]?/%s$"
46+
--exclude "^https://docs.generic-mapping-tools.org/6.[0-9]?/%3Cmodule-name%3E.html$"
47+
--exclude "^https://doi.org"
4948
--exclude "^https://github.com/GenericMappingTools/gmt/releases/tag/X.Y.Z$"
5049
--exclude "^https://github.com/GenericMappingTools/pygmt/edit"
5150
--exclude "^https://github.com/GenericMappingTools/pygmt/issues/new"
51+
--exclude "^https://github.com/GenericMappingTools/pygmt/pull/[0-9]*$"
52+
--exclude "^https://github.com/GenericMappingTools/pygmt/issues/[0-9]*$"
5253
--exclude "^https://github.com/GenericMappingTools/pygmt/releases/tag/%7B%7Bpath%7D%7D"
53-
--exclude "^https://www.pygmt.org/%7B%7Bpath%7D%7D"
54-
--exclude "^git"
55-
--exclude "^file://"
56-
--exclude "https://www.adobe.com/jp/print/postscript/pdfs/PLRM.pdf"
57-
--exclude "^https://docs.generic-mapping-tools.org/6.5/%s$"
58-
--exclude "^https://docs.generic-mapping-tools.org/6.5/%3Cmodule-name%3E.html$"
59-
--exclude "^https://www.generic-mapping-tools.org/remote-datasets/%s$"
6054
--exclude "^https://hackmd.io/@pygmt"
61-
--exclude "^https://doi.org"
62-
--exclude "^https://www.researchgate.net/"
6355
--exclude "^https://test.pypi.org/simple/"
56+
--exclude "^https://www.adobe.com/jp/print/postscript/pdfs/PLRM.pdf"
57+
--exclude "^https://www.generic-mapping-tools.org/remote-datasets/%s$"
58+
--exclude "^https://www.pygmt.org/%7B%7Bpath%7D%7D"
59+
--exclude "^https://www.researchgate.net/"
60+
--exclude "^https://zenodo.org/badge/DOI/"
6461
--verbose
6562
"repository/**/*.rst"
6663
"repository/**/*.md"

.github/workflows/ci_tests.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
# In draft pull request, only two jobs on Linux are triggered to save on
1818
# Continuous Integration resources:
1919
#
20-
# - Minimum supported Python/NumPy/Pandas/Xarray versions following [SPEC 0](https://scientific-python.org/specs/spec-0000/)
21-
# - Latest Python/NumPy versions + optional packages (e.g. GeoPandas)
20+
# - Minimum supported Python, NumPy, pandas, Xarray versions following [SPEC 0](https://scientific-python.org/specs/spec-0000/)
21+
# - Latest Python, NumPy versions + optional packages (e.g. GeoPandas)
2222
#
2323
name: Tests
2424

@@ -65,8 +65,8 @@ jobs:
6565
isDraft: true
6666
- os: windows-latest
6767
isDraft: true
68-
# Pair Python 3.10 with the minimum supported versions of NumPy/Pandas/Xarray
69-
# and Python 3.13 with the latest versions of NumPy/Pandas/Xarray
68+
# Pair Python 3.10 with the minimum supported versions of NumPy, pandas, Xarray
69+
# and Python 3.13 with the latest versions of NumPy, pandas, Xarray
7070
# Only install optional packages on Python 3.13
7171
include:
7272
- python-version: '3.10'
@@ -79,7 +79,7 @@ jobs:
7979
pandas-version: ''
8080
xarray-version: ''
8181
optional-packages: ' contextily geopandas ipython pyarrow rioxarray sphinx-gallery'
82-
# The job below is for testing geopandas v0.x on Ubuntu.
82+
# The job below is for testing GeoPandas v0.x on Ubuntu.
8383
# The python-version here can't be the versions in the matrix.python-version
8484
# defined above. Otherwise, other jobs will be overridden by this one.
8585
- os: 'ubuntu-latest'

.github/workflows/ci_tests_dev.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Test PyGMT with GMT dev version on Linux/macOS/Windows
22
#
33
# This workflow runs regular PyGMT tests with the GMT dev version, and also pre-release
4-
# versions of several dependencies like NumPy, Pandas, Xarray, etc. If any tests fail,
4+
# versions of several dependencies like NumPy, pandas, Xarray, etc. If any tests fail,
55
# it also uploads the diff images as workflow artifacts. The GMT dev version is
66
# installed by fetching the latest source codes from the GMT master branch and
77
# compiling.

.github/workflows/ci_tests_legacy.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Test PyGMT with GMT legacy versions on Linux/macOS/Windows
22
#
3-
# This workflow runs regular PyGMT tests with GMT legacy versions. Due to the
4-
# minor baseline image changes between GMT versions, the workflow only runs
5-
# the tests but doesn't do image comparisons.
3+
# This workflow runs regular PyGMT tests with GMT legacy versions. Due to the minor
4+
# baseline image changes between GMT versions, the workflow only runs the tests but
5+
# doesn't do image comparisons.
66
#
77
# It is scheduled to run every Tuesday on the main branch.
88
#
@@ -34,7 +34,7 @@ jobs:
3434
strategy:
3535
fail-fast: false
3636
matrix:
37-
os: [ubuntu-20.04, macos-12, windows-2019]
37+
os: [ubuntu-20.04, macos-13, windows-2019]
3838
gmt_version: ['6.4']
3939
timeout-minutes: 30
4040
defaults:
@@ -63,7 +63,7 @@ jobs:
6363
gmt=${{ matrix.gmt_version }}
6464
ghostscript<10
6565
numpy
66-
pandas<2
66+
pandas
6767
xarray
6868
netCDF4
6969
packaging
@@ -85,9 +85,9 @@ jobs:
8585
run: |
8686
# Download cached files to ~/.gmt directory and list them
8787
gh run download --name gmt-cache --dir ~/.gmt/
88-
# Change modification times of the two files, so GMT won't refresh it
89-
# The two files are in the `~/.gmt/server` directory for GMT<=6.4, and
90-
# in the `~/.gmt` directory for GMT>=6.5.
88+
# Change modification times of the two files, so GMT won't refresh it.
89+
# The two files are in the `~/.gmt/server` directory for GMT<=6.4, and in the
90+
# `~/.gmt` directory for GMT>=6.5.
9191
mkdir -p ~/.gmt/server/
9292
mv ~/.gmt/gmt_data_server.txt ~/.gmt/gmt_hash_server.txt ~/.gmt/server/
9393
touch ~/.gmt/server/gmt_data_server.txt ~/.gmt/server/gmt_hash_server.txt

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ PyGMT has adopted [SPEC 0](https://scientific-python.org/specs/spec-0000/) along
194194
rest of the Scientific Python ecosystem, and therefore:
195195

196196
- Support for Python versions be dropped 3 years after their initial release.
197-
- Support for core package dependencies (NumPy/Pandas/Xarray) be dropped 2 years after
197+
- Support for core package dependencies (NumPy, pandas, Xarray) be dropped 2 years after
198198
their initial release.
199199

200200
Similarly, the PyGMT team has decided to discontinue support for GMT versions 3 years

doc/ecosystem.md

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
# Ecosystem
2+
3+
PyGMT provides a Python interface to the Generic Mapping Tools (GMT), which is a command
4+
line program that provides a wide range of tools for manipulating geospatial data and
5+
making publication-quality maps and figures. PyGMT integrates well with the
6+
[scientific Python ecosystem](https://scientific-python.org/), with [NumPy][] for its
7+
fundamental array data structure, [pandas][] for tabular data I/O and [Xarray][] for
8+
raster grids/images/cubes I/O.
9+
10+
In addition to these core dependencies, PyGMT also relies on several optional packages to
11+
provide additional functionality for users.
12+
13+
*This page was adapted from [GeoPandas's Ecosystem](https://geopandas.org/en/latest/community/ecosystem.html) page.*
14+
15+
## PyGMT dependencies
16+
17+
_Asterisk (*) after the package name indicates the package is a required dependency of PyGMT._
18+
19+
### NumPy*
20+
21+
[NumPy][] is the fundamental package for scientific computing in Python. It is a Python
22+
library that provides a multidimensional array object, various derived objects (such as
23+
masked arrays and matrices), and an assortment of routines for fast operations on arrays,
24+
including mathematical, logical, shape manipulation, sorting, selecting, I/O, discrete
25+
Fourier transforms, basic linear algebra, basic statistical operations, random simulation
26+
and much more.
27+
28+
### pandas*
29+
30+
[pandas][] is a Python package providing fast, flexible, and expressive data structures
31+
designed to make working with "relational" or "labeled" data both easy and intuitive.
32+
It aims to be the fundamental high-level building block for doing practical, real-world
33+
data analysis in Python.
34+
35+
### Xarray*
36+
37+
[Xarray][] is an open source project and Python package that introduces labels in the
38+
form of dimensions, coordinates, and attributes on top of raw NumPy-like arrays, which
39+
allows for more intuitive, more concise, and less error-prone user experience.
40+
41+
### IPython
42+
43+
[IPython][] provides a rich toolkit to help you make the most of using Python
44+
interactively. Its main components are a powerful interactive Python shell and a Jupyter
45+
kernel to work with Python code in Jupyter notebooks and other interactive frontends.
46+
47+
PyGMT relies on IPython to provide a rich interactive experience in Jupyter notebooks.
48+
49+
### GeoPandas
50+
51+
[GeoPandas][] is an open source project to make working with geospatial data in Python
52+
easier. GeoPandas extends the datatypes used by [pandas][] to allow spatial operations
53+
on geometric types. Geometric operations are performed by [Shapely][]. GeoPandas further
54+
depends on [pyogrio][] for file access and [Matplotlib][] for plotting.
55+
56+
PyGMT doesn't directly rely on GeoPandas, but provides support of GeoPandas's two main
57+
data structure, {class}`geopandas.GeoDataFrame` and {class}`geopandas.GeoSeries`, which
58+
can be directly used in data processing and plotting functions/methods of PyGMT.
59+
60+
### contextily
61+
62+
[contextily][] is a small Python package to retrieve tile maps from the internet. It can
63+
add those tiles as basemap to matplotlib figures or write tile maps to disk into
64+
geospatial raster files.
65+
66+
In PyGMT, {func}`pygmt.datasets.load_tile_map` and {class}`pygmt.Figure.tilemap` rely
67+
on it.
68+
69+
### rioxarray
70+
71+
[rioxarray][] is a geospatial [Xarray][] extension powered by [rasterio][]. Built on top
72+
of rasterio, it enables seamless reading, writing, and manipulation of multi-dimensional
73+
arrays with geospatial attributes such as coordinate reference systems (CRS) and spatial
74+
extent (bounds).
75+
76+
Currently, PyGMT relies on [rioxarray][] to save multi-band rasters to temporary files
77+
in GeoTIFF format, to support processing and plotting 3-D {class}`xarray.DataArray`
78+
images.
79+
80+
```{note}
81+
We're working towards removing the dependency of the [rioxarray][] package in
82+
[PR #3468](https://github.com/GenericMappingTools/pygmt/pull/3468).
83+
```
84+
85+
### PyArrow
86+
87+
[Apache Arrow][] is a development platform for in-memory analytics. It contains a set of
88+
technologies that enable big data systems to process and move data fast. It specifies a
89+
standardized language-independent columnar memory format for flat and hierarchical data,
90+
organized for efficient analytic operations on modern hardware. The Arrow Python bindings
91+
(also named "[PyArrow][]") have first-class integration with NumPy, pandas, and built-in
92+
Python objects. They are based on the C++ implementation of Arrow.
93+
94+
```{note}
95+
If you have [PyArrow][] installed, PyGMT does have some initial support for
96+
`pandas.Series` and `pandas.DataFrame` objects with Apache Arrow-backed arrays.
97+
Specifically, only uint/int/float and date32/date64 are supported for now.
98+
Support for string Array dtypes, Duration types and GeoArrow geometry types is still a work in progress.
99+
For more details, see
100+
[issue #2800](https://github.com/GenericMappingTools/pygmt/issues/2800).
101+
```
102+
103+
## PyGMT ecosystem
104+
105+
Various packages rely on PyGMT for geospatial data processing, analysis, and visualization.
106+
Below is an incomplete list (in no particular order) of tools which form the PyGMT-related
107+
ecosystem.
108+
109+
```{note}
110+
If your package relies on PyGMT, please
111+
[let us know](https://github.com/GenericMappingTools/pygmt/issues/new) or
112+
[add it by yourself](contributing.md).
113+
```
114+
115+
[apache arrow]: https://arrow.apache.org/
116+
[contextily]: https://contextily.readthedocs.io/
117+
[geopandas]: https://geopandas.org/
118+
[ipython]: https://ipython.org/
119+
[matplotlib]: https://matplotlib.org/
120+
[numpy]: https://numpy.org/
121+
[pandas]: https://pandas.pydata.org/
122+
[pyarrow]: https://arrow.apache.org/docs/python/
123+
[pyogrio]: https://pyogrio.readthedocs.io/
124+
[rasterio]: https://rasterio.readthedocs.io/
125+
[rioxarray]: https://corteva.github.io/rioxarray/
126+
[shapely]: https://shapely.readthedocs.io/
127+
[xarray]: https://xarray.pydata.org/

doc/external_resources.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ Andre Belem
107107
:text-align: center
108108
:margin: 0 3 0 0
109109

110-
![](https://github.com/tktmyd/pygmt-howto-jp/raw/main/docs/_images/01aed847a81445c7a002cce113d95886793f6236fbcccb233862486589f17ed1.png)
110+
![](https://github.com/tktmyd/pygmt-howto-jp/raw/main/docs/_images/inf_on_map_12_0.png)
111111
+++
112112
Takuto Maeda
113113
::::

doc/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ api/index.rst
4545
techref/index.md
4646
changes.md
4747
minversions.md
48+
ecosystem.md
4849
```
4950

5051
```{toctree}

doc/install.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ PyGMT requires the following libraries to be installed:
9494
- [packaging](https://packaging.pypa.io)
9595

9696
:::{note}
97-
For the minimum supported versions of the dependencies, please see {doc}`minversions`.
97+
For the minimum supported versions of the dependencies, please see [](minversions.md).
9898
:::
9999

100100
The following are optional dependencies:

doc/maintenance.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
This page contains instructions for project maintainers about how our setup works,
44
making releases, creating packages, etc.
55

6-
If you want to make a contribution to the project, see the {doc}`contributing` instead.
6+
If you want to make a contribution to the project, see the [](contributing.md) instead.
77

88
## Onboarding/Offboarding Access Checklist
99

@@ -22,7 +22,7 @@ communication tools we use.
2222
### As a Maintainer
2323

2424
- Add to the [pygmt-maintainers team](https://github.com/orgs/GenericMappingTools/teams/pygmt-maintainers) (gives 'maintain' permission to the repository)
25-
- Add to "Active Maintainers" on the {doc}`Team Gallery page <team>`
25+
- Add to "Active Maintainers" on the [Team Gallery page](team.md)
2626
- Add as a moderator on the [GMT forum](https://forum.generic-mapping-tools.org) (to see mod-only discussions) [optional]
2727
- Add as a maintainer on [ReadtheDocs](https://readthedocs.org/projects/pygmt-dev) [optional]
2828
- Add as a curator to the [GMT community](https://zenodo.org/communities/generic-mapping-tools/) on Zenodo (for making releases) [optional]
@@ -38,7 +38,7 @@ the onboarding access checklist:
3838

3939
- Move from the [pygmt-maintainers team](https://github.com/orgs/GenericMappingTools/teams/pygmt-maintainers)
4040
to the [pygmt-contributors team](https://github.com/orgs/GenericMappingTools/teams/pygmt-contributors)
41-
- Move from "Active Maintainers" to "Distinguished Contributors" on the {doc}`Team Gallery page <team>`
41+
- Move from "Active Maintainers" to "Distinguished Contributors" on the [Team Gallery page](team.md)
4242
- Remove 'maintain' permission from GMT forum, ReadTheDocs, Zenodo
4343

4444
## Branches
@@ -127,7 +127,7 @@ PyGMT has adopted [SPEC 0](https://scientific-python.org/specs/spec-0000/) along
127127
rest of the Scientific Python ecosystem, and therefore:
128128

129129
* Support for Python versions be dropped 3 years after their initial release.
130-
* Support for core package dependencies (NumPy/Pandas/Xarray) be dropped 2 years after
130+
* Support for core package dependencies (NumPy, pandas, Xarray) be dropped 2 years after
131131
their initial release.
132132

133133
Similarly, the PyGMT team has decided to discontinue support for GMT versions 3 years
@@ -201,7 +201,7 @@ at `.github/release-drafter.yml`. Configuration settings can be found at
201201
<https://github.com/release-drafter/release-drafter>.
202202

203203
The drafted release notes are not perfect, so we will need to tidy it prior to
204-
publishing the actual release notes at {doc}`changes`.
204+
publishing the actual release notes at [](changes.md).
205205

206206
1. Go to <https://github.com/GenericMappingTools/pygmt/releases> and click on the
207207
'Edit' button next to the current draft release note. Copy the text of the
@@ -229,7 +229,7 @@ publishing the actual release notes at {doc}`changes`.
229229
last release (e.g., use `git shortlog HEAD...v0.4.0 -sne`).
230230
8. Update `doc/minversions.md` with new information on the new release version,
231231
including a vX.Y.Z documentation link, and minimum required versions of GMT, Python
232-
and core package dependencies (NumPy/Pandas/Xarray). Follow
232+
and core package dependencies (NumPy, pandas, Xarray). Follow
233233
[SPEC 0](https://scientific-python.org/specs/spec-0000/) for updates.
234234
9. Refresh citation information. Specifically, the BibTeX in `README.md` and
235235
`CITATION.cff` needs to be updated with any metadata changes, including the

0 commit comments

Comments
 (0)