Skip to content

Commit ff455b6

Browse files
authored
Figure.solar: Fix the baseline image for test_solar_terminators (#4675)
1 parent 6eea101 commit ff455b6

2 files changed

Lines changed: 15 additions & 22 deletions

File tree

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
outs:
2-
- md5: 8325728360e1d302bb9abbb681b41cc6
3-
size: 42122
2+
- md5: a426e3b83eb29dbc273a480d9c3019e1
3+
size: 43708
44
path: test_solar_terminators.png
5+
hash: md5

pygmt/tests/test_solar.py

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,39 +5,31 @@
55
import datetime
66

77
import pytest
8+
from packaging.version import Version
89
from pygmt import Figure
10+
from pygmt.clib import __gmt_version__
911
from pygmt.exceptions import GMTParameterError, GMTValueError
1012
from pygmt.params import Axis
1113

1214

15+
# TODO(GMT>6.6.0): Remove the xfail marker.
16+
@pytest.mark.xfail(
17+
condition=Version(__gmt_version__) <= Version("6.6.0"),
18+
reason="Upstream bug fixed in https://github.com/GenericMappingTools/gmt/pull/8938",
19+
)
1320
@pytest.mark.mpl_image_compare
1421
def test_solar_terminators():
1522
"""
1623
Test passing the solar argument with a time string and no terminator type to confirm
1724
the default terminator type.
1825
"""
26+
dt = "1990-02-17 04:25:00"
1927
fig = Figure()
2028
fig.basemap(region="d", projection="W0/15c", frame=Axis(annot=True))
21-
fig.solar(
22-
terminator="d",
23-
pen="1p,blue",
24-
terminator_datetime="1990-02-17 04:25:00",
25-
)
26-
fig.solar(
27-
terminator="a",
28-
pen="1p,red",
29-
terminator_datetime="1990-02-17 04:25:00",
30-
)
31-
fig.solar(
32-
terminator="c",
33-
pen="1p,green",
34-
terminator_datetime="1990-02-17 04:25:00",
35-
)
36-
fig.solar(
37-
terminator="n",
38-
pen="1p,yellow",
39-
terminator_datetime="1990-02-17 04:25:00",
40-
)
29+
fig.solar(terminator="day_night", pen="1p,blue", terminator_datetime=dt)
30+
fig.solar(terminator="astronomical", pen="1p,red", terminator_datetime=dt)
31+
fig.solar(terminator="civil", pen="1p,green", terminator_datetime=dt)
32+
fig.solar(terminator="nautical", pen="1p,yellow", terminator_datetime=dt)
4133
return fig
4234

4335

0 commit comments

Comments
 (0)