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 4 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
2 changes: 1 addition & 1 deletion .github/workflows/cache_data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ name: Cache data

on:
# Uncomment the 'pull_request' line below to manually re-cache data artifacts
# pull_request:
pull_request:
# Schedule runs on 12 noon every Sunday
schedule:
- cron: '0 12 * * 0'
Expand Down
7 changes: 1 addition & 6 deletions .github/workflows/ci_tests_legacy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ name: GMT Legacy Tests
on:
# push:
# branches: [ main ]
# pull_request:
pull_request:
# types: [ready_for_review]
# paths-ignore:
# - 'doc/**'
Expand Down 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
5 changes: 1 addition & 4 deletions pygmt/tests/test_image.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
"""
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")
Copy link
Member Author

@weiji14 weiji14 Dec 27, 2023

Choose a reason for hiding this comment

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

Gonna try removing this line and see if it still crashes on Windows. Xref #518 (comment).

Copy link
Member Author

Choose a reason for hiding this comment

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

@pytest.mark.mpl_image_compare
Expand All @@ -17,5 +14,5 @@ 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