GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Merge branch 'main' into subplot/A · GenericMappingTools/pygmt@b24ca35

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • .mailmap
  • pygmt
    • src
      • grdhisteq.py
      • grdview.py
    • tests
      • test_grdhisteq.py
      • test_grdview.py
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎.mailmap‎

Copy file name to clipboard
+16-7Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,30 @@
11
# Map author/committer names and/or email addresses for git.
22
# Reference: https://git-scm.com/docs/gitmailmap
3+
4+
# Canonical identities: "Canonical Name <Canonical Email>"
35
Dongdong Tian <[email protected]>
4-
Dongdong Tian <[email protected]> <[email protected]>
56
Jiayuan Yao <[email protected]>
6-
Jiayuan Yao <[email protected]> <[email protected]>
77
Jing-Hui Tong <[email protected]>
8-
Jing-Hui Tong <[email protected]> <[email protected]>
98
Max Jones <[email protected]>
9+
Michael Grund <[email protected]>
10+
Wei Ji Leong <[email protected]>
11+
Will Schlitzer <[email protected]>
12+
Xingchen He <[email protected]>
13+
Yvonne Fröhlich <[email protected]>
14+
15+
# Alias mappings: "Canonical Name <Canonical Email> <Alias Email>"
16+
Dongdong Tian <[email protected]> <[email protected]>
17+
Jiayuan Yao <[email protected]> <[email protected]>
18+
Jing-Hui Tong <[email protected]> <[email protected]>
1019
Max Jones <[email protected]> <[email protected]>
1120
Max Jones <[email protected]> <[email protected]>
1221
Max Jones <[email protected]> <[email protected]>
13-
Michael Grund <[email protected]> <[email protected]>
14-
Michael Grund <[email protected]> <[email protected]>
15-
Michael Grund <[email protected]> <[email protected]>
16-
Wei Ji Leong <[email protected]>
22+
Michael Grund <[email protected]> <[email protected]>
23+
Michael Grund <[email protected]> <[email protected]>
24+
Michael Grund <[email protected]> <[email protected]>
1725
Wei Ji Leong <[email protected]> <[email protected]>
1826
Wei Ji Leong <[email protected]> <[email protected]>
1927
Will Schlitzer <[email protected]> <[email protected]>
28+
Xingchen He <[email protected]> <[email protected]>
2029
Yvonne Fröhlich <[email protected]> <[email protected]>
2130
Yvonne Fröhlich <[email protected]> <[email protected]>
Collapse file

‎pygmt/src/grdhisteq.py‎

Copy file name to clipboardExpand all lines: pygmt/src/grdhisteq.py
+5-3Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from pygmt._typing import PathLike
1212
from pygmt.alias import AliasSystem
1313
from pygmt.clib import Session
14-
from pygmt.exceptions import GMTInvalidInput
14+
from pygmt.exceptions import GMTParameterError
1515
from pygmt.helpers import (
1616
build_arg_list,
1717
fmt_docstring,
@@ -235,8 +235,10 @@ def compute_bins(
235235
output_type = validate_output_table_type(output_type, outfile=outfile)
236236

237237
if kwargs.get("h") is not None and output_type != "file":
238-
msg = "'header' is only allowed with output_type='file'."
239-
raise GMTInvalidInput(msg)
238+
raise GMTParameterError(
239+
conflicts_with=("header", [f"output_type={output_type!r}"]),
240+
reason="'header' is allowed only when 'output_type' is 'file'.",
241+
)
240242

241243
aliasdict = AliasSystem().add_common(
242244
R=region,
Collapse file

‎pygmt/src/grdview.py‎

Copy file name to clipboardExpand all lines: pygmt/src/grdview.py
+12-9Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from pygmt._typing import PathLike
1111
from pygmt.alias import Alias, AliasSystem
1212
from pygmt.clib import Session, __gmt_version__
13-
from pygmt.exceptions import GMTInvalidInput, GMTParameterError
13+
from pygmt.exceptions import GMTParameterError
1414
from pygmt.helpers import build_arg_list, deprecate_parameter, fmt_docstring, use_alias
1515
from pygmt.src.grdinfo import grdinfo
1616

@@ -80,17 +80,20 @@ def _alias_option_Q( # noqa: N802
8080
)
8181

8282
if dpi is not None and surftype != "image":
83-
msg = "Parameter 'dpi' can only be used when 'surftype' is 'image'."
84-
raise GMTInvalidInput(msg)
83+
raise GMTParameterError(
84+
conflicts_with=("dpi", [f"surftype={surftype!r}"]),
85+
reason="'dpi' is allowed only when 'surftype' is 'image'.",
86+
)
8587
if nan_transparent and surftype != "image":
86-
msg = "Parameter 'nan_transparent' can only be used when 'surftype' is 'image'."
87-
raise GMTInvalidInput(msg)
88+
raise GMTParameterError(
89+
conflicts_with=("nan_transparent", [f"surftype={surftype!r}"]),
90+
reason="'nan_transparent' is allowed only when 'surftype' is 'image'.",
91+
)
8892
if mesh_fill is not None and surftype not in {"mesh", "waterfall_x", "waterfall_y"}:
89-
msg = (
90-
"Parameter 'mesh_fill' can only be used when 'surftype' is 'mesh', "
91-
"'waterfall_x', or 'waterfall_y'."
93+
raise GMTParameterError(
94+
conflicts_with=("mesh_fill", [f"surftype={surftype!r}"]),
95+
reason="'mesh_fill' is allowed only when 'surftype' is 'mesh', 'waterfall_x', or 'waterfall_y'.",
9296
)
93-
raise GMTInvalidInput(msg)
9497

9598
return [
9699
Alias(
Collapse file

‎pygmt/tests/test_grdhisteq.py‎

Copy file name to clipboardExpand all lines: pygmt/tests/test_grdhisteq.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import xarray as xr
1111
from pygmt import grdhisteq
1212
from pygmt.enums import GridRegistration, GridType
13-
from pygmt.exceptions import GMTInvalidInput, GMTValueError
13+
from pygmt.exceptions import GMTParameterError, GMTValueError
1414
from pygmt.helpers import GMTTempFile
1515
from pygmt.helpers.testing import load_static_earth_relief
1616

@@ -138,5 +138,5 @@ def test_compute_bins_invalid_format(grid):
138138
"""
139139
with pytest.raises(GMTValueError):
140140
grdhisteq.compute_bins(grid=grid, output_type=1)
141-
with pytest.raises(GMTInvalidInput):
141+
with pytest.raises(GMTParameterError):
142142
grdhisteq.compute_bins(grid=grid, output_type="pandas", header="o+c")
Collapse file

‎pygmt/tests/test_grdview.py‎

Copy file name to clipboardExpand all lines: pygmt/tests/test_grdview.py
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import pytest
66
from pygmt import Figure, grdcut
7-
from pygmt.exceptions import GMTInvalidInput, GMTParameterError, GMTTypeError
7+
from pygmt.exceptions import GMTParameterError, GMTTypeError
88
from pygmt.helpers import GMTTempFile
99
from pygmt.helpers.testing import load_static_earth_relief
1010

@@ -330,11 +330,11 @@ def test_grdview_invalid_surftype(gridfile):
330330
parameters.
331331
"""
332332
fig = Figure()
333-
with pytest.raises(GMTInvalidInput):
333+
with pytest.raises(GMTParameterError):
334334
fig.grdview(grid=gridfile, surftype="surface", dpi=300)
335-
with pytest.raises(GMTInvalidInput):
335+
with pytest.raises(GMTParameterError):
336336
fig.grdview(grid=gridfile, surftype="surface", nan_transparent=True)
337-
with pytest.raises(GMTInvalidInput):
337+
with pytest.raises(GMTParameterError):
338338
fig.grdview(grid=gridfile, surftype="surface", mesh_fill="red")
339339

340340

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.