Skip to content

Commit eb4ca3b

Browse files
Merge branch 'main' into add-gallery-legend-spec
2 parents 21a3d53 + 05c4ab9 commit eb4ca3b

File tree

13 files changed

+169
-23
lines changed

13 files changed

+169
-23
lines changed

Diff for: .github/workflows/ci_tests.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ jobs:
154154
GH_TOKEN: ${{ github.token }}
155155

156156
- name: Install uv
157-
uses: astral-sh/setup-uv@v5.1.0
157+
uses: astral-sh/setup-uv@v5.2.1
158158
with:
159159
python-version: ${{ matrix.python-version }}
160160

@@ -185,7 +185,7 @@ jobs:
185185

186186
# Upload coverage to Codecov
187187
- name: Upload coverage to Codecov
188-
uses: codecov/codecov-action@v5.1.2
188+
uses: codecov/codecov-action@v5.3.1
189189
if: success() || failure()
190190
with:
191191
use_oidc: true

Diff for: .github/workflows/ci_tests_legacy.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
strategy:
3535
fail-fast: false
3636
matrix:
37-
os: [ubuntu-20.04, macos-13, windows-2019]
37+
os: [ubuntu-22.04, macos-13, windows-2019]
3838
gmt_version: ['6.4']
3939
timeout-minutes: 30
4040
defaults:

Diff for: .github/workflows/publish-to-pypi.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ jobs:
9797
path: dist/
9898

9999
- name: Publish distribution 📦 to TestPyPI
100-
uses: pypa/[email protected].3
100+
uses: pypa/[email protected].4
101101
with:
102102
repository-url: https://test.pypi.org/legacy/
103103

@@ -121,4 +121,4 @@ jobs:
121121
path: dist/
122122

123123
- name: Publish distribution 📦 to PyPI
124-
uses: pypa/[email protected].3
124+
uses: pypa/[email protected].4

Diff for: .github/workflows/release-drafter.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818

1919
steps:
2020
# Drafts your next Release notes as Pull Requests are merged into "main"
21-
- uses: release-drafter/release-drafter@v6.0.0
21+
- uses: release-drafter/release-drafter@v6.1.0
2222
with:
2323
# (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml
2424
config-name: release-drafter.yml

Diff for: CITATION.cff

+3-3
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,9 @@ authors:
7676
family-names: Wessel
7777
affiliation: University of Hawaiʻi at Mānoa, USA
7878
orcid: https://orcid.org/0000-0001-5708-7336
79-
date-released: 2024-12-31
80-
doi: 10.5281/zenodo.14535921
79+
date-released: 2025-02-01
80+
doi: 10.5281/zenodo.14742338
8181
license: BSD-3-Clause
8282
repository-code: https://github.com/GenericMappingTools/pygmt
8383
type: software
84-
version: 0.14.0
84+
version: 0.14.1

Diff for: README.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ Feel free to cite our work in your research using the following BibTeX:
137137

138138
```
139139
@software{
140-
pygmt_2024_14535921,
140+
pygmt_2025_14742338,
141141
author = {Tian, Dongdong and
142142
Uieda, Leonardo and
143143
Leong, Wei Ji and
@@ -157,12 +157,12 @@ Feel free to cite our work in your research using the following BibTeX:
157157
Quinn, Jamie and
158158
Wessel, Paul},
159159
title = {{PyGMT: A Python interface for the Generic Mapping Tools}},
160-
month = dec,
161-
year = 2024,
160+
month = feb,
161+
year = 2025,
162162
publisher = {Zenodo},
163-
version = {0.14.0},
164-
doi = {10.5281/zenodo.14535921},
165-
url = {https://doi.org/10.5281/zenodo.14535921}
163+
version = {0.14.1},
164+
doi = {10.5281/zenodo.14742338},
165+
url = {https://doi.org/10.5281/zenodo.14742338}
166166
}
167167
```
168168

Diff for: doc/_static/version_switch.js

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
var all_versions = {
1313
'latest': 'latest',
1414
'dev': 'dev',
15+
'v0.14.1': 'v0.14.1',
1516
'v0.14.0': 'v0.14.0',
1617
'v0.13.0': 'v0.13.0',
1718
'v0.12.0': 'v0.12.0',

Diff for: doc/changes.md

+26
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,31 @@
11
# Changelog
22

3+
## Release v0.14.1 (2025/02/01)
4+
5+
[![Digital Object Identifier for PyGMT v0.14.1](https://zenodo.org/badge/DOI/10.5281/zenodo.14742338.svg)](https://doi.org/10.5281/zenodo.14742338)
6+
7+
### Highlights
8+
9+
- **Patch release fixing critical bugs in PyGMT v0.14.0**
10+
- Fix the bug of converting Python sequence of datetime-like objects ([#3760](https://github.com/GenericMappingTools/pygmt/pull/3760))
11+
12+
### Maintenance
13+
14+
- CI: Separate jobs for publishing to TestPyPI and PyPI ([#3742](https://github.com/GenericMappingTools/pygmt/pull/3742))
15+
- clib.conversion._to_numpy: Add tests for Python sequence of datetime-like objects ([#3758](https://github.com/GenericMappingTools/pygmt/pull/3758))
16+
- Fix an image in README.md (broken on PyPI) and rewrap to 88 characters ([#3740](https://github.com/GenericMappingTools/pygmt/pull/3740))
17+
- Fix the dataset link in the RGB image gallery example ([#3781](https://github.com/GenericMappingTools/pygmt/pull/3781))
18+
- Update License year to 2025 ([#3737](https://github.com/GenericMappingTools/pygmt/pull/3737))
19+
20+
**Full Changelog**: <https://github.com/GenericMappingTools/pygmt/compare/v0.14.0...v0.14.1>
21+
22+
### Contributors
23+
24+
* [Dongdong Tian](https://github.com/seisman)
25+
* [Wei Ji Leong](https://github.com/weiji14)
26+
27+
---
28+
329
## Release v0.14.0 (2024/12/31)
430

531
[![Digital Object Identifier for PyGMT v0.14.0](https://zenodo.org/badge/DOI/10.5281/zenodo.14535921.svg)](https://doi.org/10.5281/zenodo.14535921)

Diff for: doc/minversions.md

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ compatibility reasons.
4141
| PyGMT Version | GMT | Python | NumPy | pandas | Xarray |
4242
|---|---|---|---|---|---|
4343
| [Dev][]* [<doc:dev>] | {{ requires.gmt }} | {{ requires.python }} | {{ requires.numpy }} | {{ requires.pandas }} | {{ requires.xarray }} |
44+
| <tag:v0.14.1> [<doc:v0.14.1>] | >=6.4.0 | >=3.11 | >=1.25 | >=2.0 | >=2023.04 |
4445
| <tag:v0.14.0> [<doc:v0.14.0>] | >=6.4.0 | >=3.11 | >=1.25 | >=2.0 | >=2023.04 |
4546
| <tag:v0.13.0> [<doc:v0.13.0>] | >=6.3.0 | >=3.10 | >=1.24 | >=1.5 | >=2022.09 |
4647
| <tag:v0.12.0> [<doc:v0.12.0>] | >=6.3.0 | >=3.10 | >=1.23 | >=1.5 | >=2022.06 |

Diff for: examples/gallery/images/rgb_image.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
# %%
2323
# Read 3-band data from GeoTIFF into an xarray.DataArray object:
2424
with rioxarray.open_rasterio(
25-
filename="https://oin-hotosm.s3.us-east-1.amazonaws.com/64d6a49a19cb3a000147a65b/0/64d6a49a19cb3a000147a65c.tif",
25+
filename="https://oin-hotosm-temp.s3.us-east-1.amazonaws.com/64d6a49a19cb3a000147a65b/0/64d6a49a19cb3a000147a65c.tif",
2626
overview_level=5,
2727
) as img:
2828
# Subset to area of Lāhainā in EPSG:32604 coordinates

Diff for: examples/gallery/lines/hlines_vlines.py

+117
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
"""
2+
Horizontal and vertical lines
3+
=============================
4+
5+
The :meth:`pygmt.Figure.hlines` and :meth:`pygmt.Figure.vlines` methods allow to plot
6+
horizontal and vertical lines in Cartesian, geographic and polar coordinate systems.
7+
"""
8+
9+
# %%
10+
# Cartesian coordinate system
11+
# ---------------------------
12+
# In Cartesian coordinate systems lines are plotted as straight lines.
13+
14+
import pygmt
15+
16+
fig = pygmt.Figure()
17+
18+
fig.basemap(
19+
region=[0, 10, 0, 10], projection="X10c/10c", frame=["+tCartesian hlines", "af"]
20+
)
21+
22+
# Add a horizontal line at y=9
23+
fig.hlines(y=9, pen="1.5p,red3", label="Line 1")
24+
# Add a horizontal line at y=8 with x from 2 to 8
25+
fig.hlines(y=8, xmin=2, xmax=8, pen="1.5p,gray30,-", label="Line 2")
26+
# Add two horizontal lines at y=6 and y=7 both with x from 3 to 7
27+
fig.hlines(y=[6, 7], xmin=3, xmax=7, pen="1.5p,salmon", label="Lines 3 & 4")
28+
# Add two horizontal lines at y=4 and y=5 both with x from 4 to 9
29+
fig.hlines(y=[4, 5], xmin=4, xmax=9, pen="1.5p,black,.", label="Lines 5 & 6")
30+
# Add two horizontal lines at y=2 and y=3 with different x limits
31+
fig.hlines(
32+
y=[2, 3], xmin=[0, 1], xmax=[7, 7.5], pen="1.5p,dodgerblue3", label="Lines 7 & 8"
33+
)
34+
fig.legend(position="JBR+jBR+o0.2c", box="+gwhite+p1p")
35+
36+
fig.shift_origin(xshift="w+2c")
37+
38+
fig.basemap(
39+
region=[0, 10, 0, 10], projection="X10c/10c", frame=["+tCartesian vlines", "af"]
40+
)
41+
# Add a vertical line at x=1
42+
fig.vlines(x=1, pen="1.5p,red3", label="Line 1")
43+
# Add a vertical line at x=2 with y from 2 to 8
44+
fig.vlines(x=2, ymin=2, ymax=8, pen="1.5p,gray30,-", label="Line 2")
45+
# Add two vertical lines at x=3 and x=4 both with y from 3 to 7
46+
fig.vlines(x=[3, 4], ymin=3, ymax=7, pen="1.5p,salmon", label="Lines 3 & 4")
47+
# Add two vertical lines at x=5 and x=6 both with y from 4 to 9
48+
fig.vlines(x=[5, 6], ymin=4, ymax=9, pen="1.5p,black,.", label="Lines 5 & 6")
49+
# Add two vertical lines at x=7 and x=8 with different y limits
50+
fig.vlines(
51+
x=[7, 8], ymin=[0, 1], ymax=[7, 7.5], pen="1.5p,dodgerblue3", label="Lines 7 & 8"
52+
)
53+
fig.legend()
54+
55+
fig.show()
56+
57+
# %%
58+
# Geographic coordinate system
59+
# ----------------------------
60+
# The same can be done in geographic coordinate systems where "horizontal" means lines
61+
# are plotted along parallels (constant latitude) while "vertical" means lines are
62+
# plotted along meridians (constant longitude).
63+
64+
fig = pygmt.Figure()
65+
66+
fig.basemap(region="g", projection="R15c", frame=["+tGeographic hlines", "af"])
67+
# Add a line at 70°N
68+
fig.hlines(y=70, pen="1.5p,red3", label="Line 1")
69+
# Add a line at 50°N with longitude limits at 20°E and 160°E
70+
fig.hlines(y=50, xmin=20, xmax=160, pen="1.5p,dodgerblue3", label="Line 2")
71+
# Add a line at 30°S with longitude limits at 60°E and 270°E
72+
fig.hlines(y=-30, xmin=60, xmax=270, pen="1.5p,gray30,-", label="Line 3")
73+
fig.legend()
74+
75+
fig.shift_origin(xshift="w+2c")
76+
77+
fig.basemap(region="g", projection="R15c", frame=["+tGeographic vlines", "af"])
78+
# Add a line at 70°E
79+
fig.vlines(x=70, pen="1.5p,red3", label="Line 1")
80+
# Add a line at 20°E with latitude limits at 50°S and 70°N
81+
fig.vlines(x=120, ymin=-50, ymax=70, pen="1.5p,dodgerblue3", label="Line 2")
82+
# Add a line at 230°E with latitude limits at 70°S and 80°N
83+
fig.vlines(x=230, ymin=-70, ymax=80, pen="1.5p,gray30,-", label="Line 3")
84+
fig.legend()
85+
86+
fig.show()
87+
88+
# %%
89+
# Polar coordinate system
90+
# -----------------------
91+
# When using polar coordinate systems "horizontal" means lines are plotted as arcs along
92+
# a constant radius while "vertical" means lines are plotted as straight lines along
93+
# radius at a specified azimuth.
94+
95+
fig = pygmt.Figure()
96+
97+
fig.basemap(region=[0, 360, 0, 1], projection="P10c", frame=["+tPolar hlines", "af"])
98+
# Add a line along radius=0.8
99+
fig.hlines(y=0.8, pen="1.5p,red3", label="Line 1")
100+
# Add a line along radius=0.5 with azimuth limits at 30° and 160°
101+
fig.hlines(y=0.5, xmin=30, xmax=160, pen="1.5p,dodgerblue3", label="Line 2")
102+
# Add a line along radius=0.25 with azimuth limits at 60° and 270°
103+
fig.hlines(y=0.25, xmin=60, xmax=270, pen="1.5p,gray30,-", label="Line 3")
104+
fig.legend()
105+
106+
fig.shift_origin(xshift="w+2c")
107+
108+
fig.basemap(region=[0, 360, 0, 1], projection="P10c", frame=["+tPolar vlines", "af"])
109+
# Add a line along azimuth=120°
110+
fig.vlines(x=120, pen="1.5p,red3", label="Line 1")
111+
# Add a line along azimuth=190° with radius limits at 0.2 and 0.8
112+
fig.vlines(x=190, ymin=0.2, ymax=0.8, pen="1.5p,dodgerblue3", label="Line 2")
113+
# Add a line along azimuth=320 with radius limits at 0.5 and 0.9
114+
fig.vlines(x=320, ymin=0.5, ymax=0.9, pen="1.5p,gray30,-", label="Line 3")
115+
fig.legend()
116+
117+
fig.show()

Diff for: pygmt/src/hlines.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,10 @@ def hlines(
3838
The term "horizontal" lines can be interpreted differently in different coordinate
3939
systems:
4040
41-
- **Cartesian** coordinate system: lines are plotted as straight lines.
42-
- **Polar** projection: lines are plotted as arcs along a constant radius.
43-
- **Geographic** projection: lines are plotted as parallels along constant latitude.
41+
- **Cartesian**: lines are plotted as straight lines.
42+
- **Polar**: lines are plotted as arcs along a constant radius.
43+
- **Geographic**: lines are plotted as arcs along parallels (i.e., constant
44+
latitude).
4445
4546
Parameters
4647
----------

Diff for: pygmt/src/vlines.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ def vlines(
3838
The term "vertical" lines can be interpreted differently in different coordinate
3939
systems:
4040
41-
- **Cartesian** coordinate system: lines are plotted as straight lines.
42-
- **Polar** projection: lines are plotted as straight lines along radius.
43-
- **Geographic** projection: lines are plotted as meridians along constant
44-
longitude.
41+
- **Cartesian**: lines are plotted as straight lines.
42+
- **Polar**: lines are plotted as straight lines along a constant azimuth.
43+
- **Geographic**: lines are plotted as arcs along meridians (i.e., constant
44+
longitude).
4545
4646
Parameters
4747
----------

0 commit comments

Comments
 (0)