Skip to content

WIP: Refactor test_basemap_polar to use mpl_image_compare and track png files in dvc #1071

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

Closed
wants to merge 26 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
48fb2d9
Initialize data version control
weiji14 Mar 11, 2021
4999875
Set dvc remote as https://dagshub.com/GenericMappingTools/pygmt.dvc
weiji14 Mar 11, 2021
9b61c77
Temporarily installing dvc using pip instead of conda to make CI work
weiji14 Mar 11, 2021
0c35dff
Refactor test_logo to use mpl_image_compare and track png files in dvc
weiji14 Mar 11, 2021
567c967
Add dvc install and dvc pull as a step in ci_tests.yaml to pull in data
weiji14 Mar 12, 2021
7e0940c
Merge branch 'master' into data_version_control
weiji14 Mar 12, 2021
4833466
List files in pygmt directory to see what happens after dvc pull
weiji14 Mar 12, 2021
f0ab167
Do `dvc pull` before `pip install` otherwise test PNGs aren't there
weiji14 Mar 12, 2021
f5e25fe
Merge branch 'master' into data_version_control
weiji14 Mar 15, 2021
6bd7ba9
First draft of instructions for using dvc to store baseline images
weiji14 Mar 15, 2021
e30c708
Instruct to do `git push` first and then `dvc push`
weiji14 Mar 16, 2021
df1ab56
Merge branch 'master' into data_version_control
weiji14 Mar 16, 2021
3208519
New checklist item for maintainers to get added to DAGsHub dvc remote
weiji14 Mar 16, 2021
2bd88c8
Move pygmt/tests/baseline/.gitignore to top-level
weiji14 Mar 17, 2021
93f6d6e
Just use `dvc push` without setting --remote upstream
weiji14 Mar 17, 2021
1f06f9a
Clarify that `git rm -r --cached` only needs to run during migration
weiji14 Mar 17, 2021
e36fd28
Try installing dvc from conda again now that there is a Py3.9 package
weiji14 Mar 17, 2021
f34bb09
Merge branch 'master' into data_version_control
weiji14 Mar 17, 2021
f3aa3c5
Install dvc and do `dvc pull` on GMT dev tests too
weiji14 Mar 17, 2021
af79eef
Refactor test_logo tests to be simpler and more unit-test like
weiji14 Mar 17, 2021
5860a72
Mention dvc status command to see which files need staging
weiji14 Mar 17, 2021
c37bdff
Use images for logo created using GMT 6.1.1
weiji14 Mar 17, 2021
393773b
List only files under pygmt/tests/baseline
weiji14 Mar 18, 2021
901733c
Refactor test_basemap_polar to use mpl_image_compare and track png fi…
seisman Mar 17, 2021
b8bdb7c
Refactor test_basemap_winkel_tripel and add to dvc
seisman Mar 18, 2021
45f2b95
Merge branch 'master' into fix-test-basemap-polar
seisman Mar 18, 2021
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
Binary file removed pygmt/tests/baseline/test_basemap_polar.png
Binary file not shown.
4 changes: 4 additions & 0 deletions pygmt/tests/baseline/test_basemap_polar.png.dvc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
outs:
- md5: 4750e440adfc5b4b383315fa7ed239dd
size: 78820
path: test_basemap_polar.png
4 changes: 4 additions & 0 deletions pygmt/tests/baseline/test_basemap_winkel_tripel.png.dvc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
outs:
- md5: 8c3cb3ee180415d2f01a214f7f05f916
size: 91501
path: test_basemap_winkel_tripel.png
20 changes: 8 additions & 12 deletions pygmt/tests/test_basemap.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,28 +64,24 @@ def test_basemap_power_axis():
return fig


@check_figures_equal()
@pytest.mark.mpl_image_compare
def test_basemap_polar():
"""
Create a polar basemap plot.
"""
fig_ref, fig_test = Figure(), Figure()
# Use single-character arguments for the reference image
fig_ref.basemap(R="0/360/0/1000", J="P6i", B="afg")
fig_test.basemap(region=[0, 360, 0, 1000], projection="P6i", frame="afg")

return fig_ref, fig_test
fig = Figure()
fig.basemap(region=[0, 360, 0, 1000], projection="P6i", frame="afg")
return fig


@check_figures_equal()
@pytest.mark.mpl_image_compare
def test_basemap_winkel_tripel():
"""
Create a Winkel Tripel basemap plot.
"""
fig_ref, fig_test = Figure(), Figure()
fig_ref.basemap(R="90/450/-90/90", J="R270/25c", B="afg")
fig_test.basemap(region=[90, 450, -90, 90], projection="R270/25c", frame="afg")
return fig_ref, fig_test
fig = Figure()
fig.basemap(region=[90, 450, -90, 90], projection="R270/25c", frame="afg")
return fig


@check_figures_equal()
Expand Down