Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions pygmt/tests/baseline/test_solar_terminators.png.dvc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
outs:
- md5: 8325728360e1d302bb9abbb681b41cc6
size: 42122
- md5: a426e3b83eb29dbc273a480d9c3019e1
size: 43708
path: test_solar_terminators.png
hash: md5
32 changes: 12 additions & 20 deletions pygmt/tests/test_solar.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,39 +5,31 @@
import datetime

import pytest
from packaging.version import Version
from pygmt import Figure
from pygmt.clib import __gmt_version__
from pygmt.exceptions import GMTParameterError, GMTValueError
from pygmt.params import Axis


# TODO(GMT>6.6.0): Remove the xfail marker.
@pytest.mark.xfail(
condition=Version(__gmt_version__) <= Version("6.6.0"),
reason="Upstream bug fixed in https://github.com/GenericMappingTools/gmt/pull/8938",

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually I'm not sure if this bug was fixed by GenericMappingTools/gmt#8938

)
@pytest.mark.mpl_image_compare
def test_solar_terminators():
"""
Test passing the solar argument with a time string and no terminator type to confirm
the default terminator type.
"""
dt = "1990-02-17 04:25:00"
fig = Figure()
fig.basemap(region="d", projection="W0/15c", frame=Axis(annot=True))
fig.solar(
terminator="d",
pen="1p,blue",
terminator_datetime="1990-02-17 04:25:00",
)
fig.solar(
terminator="a",
pen="1p,red",
terminator_datetime="1990-02-17 04:25:00",
)
fig.solar(
terminator="c",
pen="1p,green",
terminator_datetime="1990-02-17 04:25:00",
)
fig.solar(
terminator="n",
pen="1p,yellow",
terminator_datetime="1990-02-17 04:25:00",
)
fig.solar(terminator="day_night", pen="1p,blue", terminator_datetime=dt)
fig.solar(terminator="astronomical", pen="1p,red", terminator_datetime=dt)
fig.solar(terminator="civil", pen="1p,green", terminator_datetime=dt)
fig.solar(terminator="nautical", pen="1p,yellow", terminator_datetime=dt)
return fig


Expand Down
Loading