Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor test_image to plot @circuit.png instead of test_logo.png #2922

Merged
merged 6 commits into from
Dec 27, 2023
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: 0 additions & 5 deletions .github/workflows/ci_tests_legacy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ jobs:
rioxarray
sphinx-gallery
build
dvc
make
pip
pytest
Expand All @@ -101,10 +100,6 @@ jobs:
touch ~/.gmt/server/gmt_data_server.txt ~/.gmt/server/gmt_hash_server.txt
ls -lhR ~/.gmt

# Pull baseline image data from dvc remote (DAGsHub)
- name: Pull baseline image data from dvc remote
run: dvc pull pygmt/tests/baseline/test_logo.png && ls -lhR pygmt/tests/baseline/

# Install the package that we want to test
- name: Install the package
run: make install
Expand Down
1 change: 1 addition & 0 deletions pygmt/helpers/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ def download_test_data():
"@S90E000.earth_wdmam_03m_g.nc", # Specific grid for 03m test
# Other cache files
"@capitals.gmt",
"@circuit.png",
"@earth_relief_20m_holes.grd",
"@EGM96_to_36.txt",
"@MaunaLoa_CO2.txt",
Expand Down
4 changes: 2 additions & 2 deletions pygmt/tests/baseline/test_image.png.dvc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
outs:
- md5: c2e05c0d6fb17bcc7bf2f96193f91ad6
size: 10005
- md5: d7d0d71a44a232d5907dbd44f7a08f18
size: 30811
path: test_image.png
8 changes: 1 addition & 7 deletions pygmt/tests/test_image.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@
"""
Test Figure.image.
"""
import os
import sys

import pytest
from pygmt import Figure

TEST_IMG = os.path.join(os.path.dirname(__file__), "baseline", "test_logo.png")


@pytest.mark.skipif(sys.platform == "win32", reason="crashes on Windows")
@pytest.mark.mpl_image_compare
def test_image():
"""
Place images on map.
"""
fig = Figure()
fig.image(TEST_IMG, position="x0/0+w2c", box="+pthin,blue")
fig.image(imagefile="@circuit.png", position="x0/0+w2c", box="+pthin,blue")
return fig
Loading