Skip to content

Commit 1eec810

Browse files
authored
Merge branch 'main' into remove-sequence_join-separator
2 parents f09caa2 + 1a2d806 commit 1eec810

File tree

20 files changed

+107
-29
lines changed

20 files changed

+107
-29
lines changed

.github/ISSUE_TEMPLATE/4-release_checklist.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ assignees: ''
2828
- [ ] All tests pass in the ["GMT Legacy Tests" workflow](https://github.com/GenericMappingTools/pygmt/actions/workflows/ci_tests_legacy.yaml)
2929
- [ ] All tests pass in the ["GMT Dev Tests" workflow](https://github.com/GenericMappingTools/pygmt/actions/workflows/ci_tests_dev.yaml)
3030
- [ ] All tests pass in the ["Doctests" workflow](https://github.com/GenericMappingTools/pygmt/actions/workflows/ci_doctests.yaml)
31+
- [ ] All links work in the ["Check Links" workflow](https://github.com/GenericMappingTools/pygmt/actions/workflows/check-links.yml)
3132
- [ ] Update warnings in `pygmt/_show_versions.py` as well as notes in [Not working transparency](https://www.pygmt.org/dev/install.html#not-working-transparency) regarding GMT-Ghostscript incompatibility
3233
- [ ] Reserve a DOI on [Zenodo](https://zenodo.org) by clicking on "New Version"
3334
- [ ] Finish up the "Changelog entry for v0.x.x" Pull Request (Use the previous changelog PR as a reference)
@@ -52,7 +53,7 @@ assignees: ''
5253
- [ ] Bump PyGMT version on https://github.com/GenericMappingTools/try-gmt (after conda-forge update)
5354
- [ ] Announce the release on:
5455
- [ ] GMT [forum](https://forum.generic-mapping-tools.org/c/news/) (do this announcement first! Requires moderator status)
55-
- [ ] [ResearchGate](https://www.researchgate.net) (after forum announcement; download the ZIP file of the new release from the release page and add it as research item via the **code** category, be sure to include the corresponding new Zenodo DOI)
56+
- [ ] [ResearchGate](https://www.researchgate.net) (after forum announcement; download the ZIP file of the new release from Zenodo and add it as research item via the **code** category, be sure to include the corresponding new Zenodo DOI)
5657
- [ ] Update release checklist template with any additional bullet points that may have arisen during the release
5758

5859
---

.github/workflows/check-links.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ jobs:
6363
--exclude "^https://hackmd.io/@pygmt"
6464
--exclude "^https://test.pypi.org/simple/"
6565
--exclude "^https://www.adobe.com/jp/print/postscript/pdfs/PLRM.pdf"
66+
--exclude "^https://naciscdn.org/naturalearth"
6667
--exclude "^https://www.generic-mapping-tools.org/remote-datasets/%s$"
6768
--exclude "^https://www.gnu.org/software/libc/manual/html_node/TZ-Variable.html"
6869
--exclude "^https://www.pygmt.org/%7B%7Bpath%7D%7D"

.github/workflows/ci_tests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ jobs:
151151
GH_TOKEN: ${{ github.token }}
152152

153153
- name: Install uv
154-
uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7.1.6
154+
uses: astral-sh/setup-uv@61cb8a9741eeb8a550a1b8544337180c0fc8476b # v7.2.0
155155
with:
156156
activate-environment: true
157157
python-version: ${{ matrix.python-version }}

.github/workflows/ci_tests_dev.yaml

Lines changed: 9 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -103,44 +103,30 @@ jobs:
103103

104104
# Build GMT from source on Linux/macOS, script is adapted from
105105
# https://github.com/GenericMappingTools/gmt/blob/6.5.0/ci/build-gmt.sh
106-
- name: Build GMT on Linux/macOS
107-
run: |
108-
cd gmt/
109-
mkdir build
110-
cd build
111-
cmake -G Ninja .. \
112-
-DCMAKE_INSTALL_PREFIX=${GMT_INSTALL_DIR} \
113-
-DCMAKE_BUILD_TYPE=Release \
114-
-DGMT_ENABLE_OPENMP=TRUE \
115-
-DGMT_USE_THREADS=TRUE
116-
cmake --build .
117-
cmake --build . --target install
118-
cd ..
119-
rm -rf gmt/
120-
env:
121-
GMT_INSTALL_DIR: ${{ runner.temp }}/gmt-install-dir
122-
if: runner.os != 'Windows'
123-
124-
- name: Build GMT on Windows
106+
- name: Build GMT from source
125107
shell: bash
126108
run: |
127109
cd gmt/
128110
mkdir build
129111
cd build
130-
cmd.exe /c "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
112+
if [[ "$RUNNER_OS" == "Windows" ]]; then
113+
cmd.exe /c "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
114+
CMAKE_PREFIX_PATH="$MAMBA_ROOT_PREFIX/envs/pygmt/Library"
115+
else
116+
CMAKE_PREFIX_PATH="$MAMBA_ROOT_PREFIX/envs/pygmt"
117+
fi
131118
cmake -G Ninja .. \
119+
-DCMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH" \
132120
-DCMAKE_INSTALL_PREFIX="$GMT_INSTALL_DIR" \
133121
-DCMAKE_BUILD_TYPE=Release \
134-
-DCMAKE_PREFIX_PATH="$MAMBA_ROOT_PREFIX/envs/pygmt/Library" \
135122
-DGMT_ENABLE_OPENMP=TRUE \
136123
-DGMT_USE_THREADS=TRUE
137124
cmake --build .
138125
cmake --build . --target install
139126
cd ..
140-
rm -rf gmt/
127+
rm -rf build
141128
env:
142129
GMT_INSTALL_DIR: ${{ runner.temp }}/gmt-install-dir
143-
if: runner.os == 'Windows'
144130

145131
- name: Add GMT's bin to PATH
146132
run: echo '${{ runner.temp }}/gmt-install-dir/bin' >> $GITHUB_PATH

examples/tutorials/basics/plot.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import io
1414

1515
import pygmt
16-
from pygmt.params import Position
16+
from pygmt.params import Box, Position
1717

1818
# %%
1919
# For example, let's load the sample dataset of tsunami generating earthquakes
@@ -72,7 +72,12 @@
7272
legend = io.StringIO(
7373
"\n".join(f"S 0.4 c {0.02 * 2**m:.2f} - 1p 1 Mw {m}" for m in [3, 4, 5])
7474
)
75-
fig.legend(spec=legend, position=Position("BR", offset=0.2), line_spacing=2.0, box=True)
75+
fig.legend(
76+
spec=legend,
77+
position=Position("BR", offset=0.2),
78+
line_spacing=2,
79+
box=Box(fill="white", pen="black"),
80+
)
7681
fig.show()
7782

7883
# %%
@@ -104,7 +109,12 @@
104109
pen="black",
105110
)
106111
fig.colorbar(frame="xaf+lDepth (km)")
107-
fig.legend(spec=legend, position=Position("BR", offset=0.2), line_spacing=2.0, box=True)
112+
fig.legend(
113+
spec=legend,
114+
position=Position("BR", offset=0.2),
115+
line_spacing=2,
116+
box=Box(fill="white", pen="black"),
117+
)
108118
fig.show()
109119

110120
# sphinx_gallery_thumbnail_number = 3

pygmt/src/binstats.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
from pygmt._typing import PathLike, TableLike
1010
from pygmt.alias import Alias, AliasSystem
1111
from pygmt.clib import Session
12+
from pygmt.exceptions import GMTTypeError, GMTValueError
1213
from pygmt.helpers import build_arg_list, fmt_docstring, use_alias
1314

1415

@@ -166,6 +167,16 @@ def binstats(
166167
)
167168
aliasdict.merge(kwargs)
168169
if statistic == "quantile":
170+
if not isinstance(quantile_value, (int, float)):
171+
raise GMTTypeError(
172+
quantile_value, reason="quantile_value must be an 'int' or 'float'."
173+
)
174+
if not (0 <= quantile_value <= 100):
175+
raise GMTValueError(
176+
quantile_value,
177+
description="quantile_value",
178+
reason="Must be a value between 0 and 100.",
179+
)
169180
aliasdict["C"] += f"{quantile_value}"
170181

171182
with Session() as lib:

pygmt/src/config.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
config - Change GMT default settings globally or locally.
33
"""
44

5+
import warnings
56
from inspect import Parameter, Signature
67
from typing import ClassVar
78

@@ -22,6 +23,12 @@ class config: # noqa: N801
2223
...
2324
2425
Full GMT defaults list at :gmt-docs:`gmt.conf.html`.
26+
27+
.. note::
28+
29+
:gmt-term:`PS_CONVERT` is not supported.
30+
To configure conversion options, please pass parameters to
31+
:meth:`pygmt.Figure.savefig` or :meth:`pygmt.Figure.show` instead.
2532
"""
2633

2734
# Manually set the __signature__ attribute to enable tab autocompletion
@@ -135,7 +142,7 @@ class config: # noqa: N801
135142
"PS_CHAR_ENCODING",
136143
"PS_COLOR_MODEL",
137144
"PS_COMMENTS",
138-
"PS_CONVERT",
145+
# "PS_CONVERT", # Not supported; use parameters of Figure.savefig/show instead
139146
"PS_IMAGE_COMPRESS",
140147
"PS_LINE_CAP",
141148
"PS_LINE_JOIN",
@@ -188,6 +195,16 @@ class config: # noqa: N801
188195
)
189196

190197
def __init__(self, **kwargs):
198+
if "PS_CONVERT" in kwargs:
199+
warnings.warn(
200+
message="Parameter 'PS_CONVERT' is not supported. "
201+
"To configure conversion options, please pass parameters to "
202+
"pygmt.Figure.savefig or pygmt.Figure.show instead.",
203+
category=SyntaxWarning,
204+
stacklevel=2,
205+
)
206+
kwargs.pop("PS_CONVERT")
207+
191208
# Save values so that we can revert to their initial values
192209
self.old_defaults = {}
193210
with Session() as lib:

pygmt/src/grdfill.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ def _validate_params(
7878
@fmt_docstring
7979
# TODO(PyGMT>=0.19.0): Remove the deprecated 'no_data' parameter.
8080
# TODO(PyGMT>=0.19.0): Remove the deprecated 'mode' parameter.
81+
# TODO(PyGMT>=0.20.0): Remove the deprecated '*fill' parameters.
8182
@deprecate_parameter("no_data", "hole", "v0.15.0", remove_version="v0.19.0")
8283
@deprecate_parameter(
8384
"constantfill", "constant_fill", "v0.18.0", remove_version="v0.20.0"

pygmt/src/grdlandmask.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717

1818
@fmt_docstring
19+
# TODO(PyGMT>=0.20.0): Remove the deprecated 'maskvalues' parameter.
20+
# TODO(PyGMT>=0.20.0): Remove the deprecated 'bordervalues' parameter.
1921
@deprecate_parameter("maskvalues", "mask_values", "v0.18.0", remove_version="v0.20.0")
2022
@deprecate_parameter(
2123
"bordervalues", "border_values", "v0.18.0", remove_version="v0.20.0"

pygmt/src/grdview.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717

1818

1919
@fmt_docstring
20+
# TODO(PyGMT>=0.20.0): Remove the deprecated '*pen' parameters.
21+
# TODO(PyGMT>=0.20.0): Remove the deprecated 'drapegrid' parameter.
2022
@deprecate_parameter("contourpen", "contour_pen", "v0.18.0", remove_version="v0.20.0")
2123
@deprecate_parameter("facadepen", "facade_pen", "v0.18.0", remove_version="v0.20.0")
2224
@deprecate_parameter("meshpen", "mesh_pen", "v0.18.0", remove_version="v0.20.0")

0 commit comments

Comments
 (0)