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

Migrate Figure.grdimage tests to use dvc #1169

Merged
merged 8 commits into from
Apr 10, 2021
8 changes: 3 additions & 5 deletions pygmt/tests/test_grdimage.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,18 +146,16 @@ def test_grdimage_over_dateline(xrgrid):


@check_figures_equal()
@pytest.mark.parametrize("lon0", [0, 123, 180])
@pytest.mark.parametrize("proj_type", ["H", "W"])
def test_grdimage_central_meridians(grid, proj_type, lon0):
def test_grdimage_central_meridians(grid):
Copy link
Member

Choose a reason for hiding this comment

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

Err, could you revert this change please. This parametrize test was set up explicitly at #560 (comment) to catch a bug (#390).

Copy link
Contributor Author

@willschlitzer willschlitzer Apr 3, 2021

Choose a reason for hiding this comment

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

Will do; I had just assumed it was repeatedly testing the same arguments. On that note, how should this handle a reference image then, since it produces 6 different images?

Also, why don't we test this on all plotting modules that have a projection parameter? I assume it's the same issue?

Copy link
Member

Choose a reason for hiding this comment

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

Actually, I would recommend to keep this test on @check_figures_equal for now because it's quite a serious bug we want resolved at some point (differences between plotting NetCDF and xarray grids should not exist).

Copy link
Contributor Author

@willschlitzer willschlitzer Apr 3, 2021

Choose a reason for hiding this comment

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

Sounds good. Should I leave the other tests that use the parameterize decorator with check_figures_equal as well?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, just for now please 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should be fixed (took me too long to realize there would be errors when I merged with GitHub)!

"""
Test that plotting a grid with different central meridians (lon0) using
Hammer (H) and Mollweide (W) projection systems work.
"""
fig_ref, fig_test = Figure(), Figure()
fig_ref.grdimage(
"@earth_relief_01d_g", projection=f"{proj_type}{lon0}/15c", cmap="geo"
"@earth_relief_01d_g", projection="W123/15c", cmap="geo"
)
fig_test.grdimage(grid, projection=f"{proj_type}{lon0}/15c", cmap="geo")
fig_test.grdimage(grid, projection="W123/15c", cmap="geo")
return fig_ref, fig_test


Expand Down