-
Notifications
You must be signed in to change notification settings - Fork 224
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
Conversation
… set one projection type and central meridian
pygmt/tests/test_grdimage.py
Outdated
@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): |
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 😄
There was a problem hiding this comment.
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)!
Summary of changed imagesThis is an auto-generated report of images that have changed on the DVC remote
Image diff(s)
Report last updated at commit 543c3b8 |
Let's hold on to this for a while @willschlitzer, there seems to be a bug at #1172 for both |
@weiji14 It looks like the upstream bug has been fixed, according to the comment from @seisman. Should I mark this as ready for review, or are we still waiting on additional changes? |
The question is, do we want to 1) store these 'incorrect' GMT 6.1.1 images now, or 2) wait for GMT 6.2.0rc1 to come out and use that to create the 'correct' grdimage test images. |
I'll defer to you on this one. In my opinion (which I don't feel strongly about), this test should be merged as the reference images are "wrong" because of a GMT problem, not a PyGMT one. Since, as I understand it, we'll have to update most of our reference images when we switch to GMT 6.2, I figure we can update the Side note: How will testing using reference images work if we're still on PyGMT v0.3.1, as we'll want to be be testing our compatibility with both GMT 6.1.1 and GMT 6.2 that may produce different images from each other, but only have a single reference image per test? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The question is, do we want to 1) store these 'incorrect' GMT 6.1.1 images now, or 2) wait for GMT 6.2.0rc1 to come out and use that to create the 'correct' grdimage test images.
I'll defer to you on this one. In my opinion (which I don't feel strongly about), this test should be merged as the reference images are "wrong" because of a GMT problem, not a PyGMT one. Since, as I understand it, we'll have to update most of our reference images when we switch to GMT 6.2, I figure we can update the
grdimage
andgrdview
images then, along with the other tests that are affected by GMT themes.
Ok, let's merge this in then, and we can update the baseline images when GMT 6.2.0 is out (the GMT 6.2.0rc1 release should be close 🤞). The grdview
test migration to dvc doesn't quite work but that's not relevant to this PR.
Side note: How will testing using reference images work if we're still on PyGMT v0.3.1, as we'll want to be be testing our compatibility with both GMT 6.1.1 and GMT 6.2 that may produce different images from each other, but only have a single reference image per test?
Well, I'd like to think that PyGMT v0.3.1 should work with GMT 6.2.0 for 99% of use cases, and if it doesn't, people should just upgrade to GMT 6.2.0 👿. By 'work', I mean run without crashing, not that the exact same figure is produced (a user won't typically care if their image is a few pixels different between versions). Yes, in a perfect world, we would have a matrix build with GMT 6.1.1 and GMT 6.2.0, and baseline images being pulled from the DVC remote matching these 2 versions, but that's a lot of work to maintain.
Anyways, LGTM!
The upstream bug #1172 should not affect these images, because these tests all explicitly specify geographic projections. |
Felt particularly old when I had to look up what "LGTM" means. |
I like to think of it as "Let's get this merged" 🔀 Wait until you try looking up GMT. |
The internet told me it was "looks good to me" which works too! Definitely have typed in GMT to Google and realized it most certainly wasn't the GMT I was looking for 😂 |
Co-authored-by: Wei Ji <23487320+weiji14@users.noreply.github.com>
Per #1131, this pull request moves reference images to use
dvc
and replaces tests that use@check_figures_equal
. It also removes some tests, including those that usepytest.mark.parameterize
to repeatedly pass different arguments to a test.Description of proposed changes
Fixes #
Reminders
make format
andmake check
to make sure the code follows the style guide.doc/api/index.rst
.Slash Commands
You can write slash commands (
/command
) in the first line of a comment to performspecific operations. Supported slash commands are:
/format
: automatically format and lint the code/test-gmt-dev
: run full tests on the latest GMT development version