Skip to content

Update colorbar, inset, legend and logo baseline images for GMT 6.2.0 - #1322

Merged
weiji14 merged 3 commits into
masterfrom
gmt-6.2.0/fix-tests
Jun 6, 2021
Merged

weiji14 merged 3 commits into
masterfrom
gmt-6.2.0/fix-tests

Conversation

@weiji14

@weiji14 weiji14 commented Jun 6, 2021 •

Copy link
Copy Markdown
Member

Description of proposed changes

Fix five broken tests on GMT 6.2.0 for fig.colorbar, fig.inset, fig.legend and fig.logo. Differences are mainly due to a different pen thickness setting. Also marking a test_plot3d_matrix_color as xfail on Windows due to incorrect -i parameter parsing.

Addresses #1320

Reminders

  • Run make format and make check to make sure the code follows the style guide.
  • Add tests for new features or tests that would have caught the bug that you're fixing.
  • Add new public functions/methods/classes to doc/api/index.rst.
  • Write detailed docstrings for all functions/methods.
  • If adding new functionality, add an example to docstrings or tutorials.

Slash Commands

You can write slash commands (/command) in the first line of a comment to perform
specific operations. Supported slash commands are:

  • /format: automatically format and lint the code
  • /test-gmt-dev: run full tests on the latest GMT development version

@weiji14 weiji14 added maintenance Boring but important stuff for the core devs skip-changelog Skip adding Pull Request to changelog labels Jun 6, 2021
@weiji14 weiji14 added this to the 0.4.0 milestone Jun 6, 2021
@weiji14 weiji14 self-assigned this Jun 6, 2021
@weiji14 weiji14 mentioned this pull request Jun 6, 2021
7 tasks done
@github-actions

github-actions Bot commented Jun 6, 2021 •

Copy link
Copy Markdown
Contributor

Summary of changed images

This is an auto-generated report of images that have changed on the DVC remote

Status Path
modified pygmt/tests/baseline/test_colorbar_box.png
modified pygmt/tests/baseline/test_inset_aliases.png
modified pygmt/tests/baseline/test_inset_context_manager.png
modified pygmt/tests/baseline/test_legend_position.png
modified pygmt/tests/baseline/test_logo_on_a_map.png

None

Image diff(s)

Details

Added images

Modified images

Path Old New
test_colorbar_box.png
test_inset_aliases.png
test_inset_context_manager.png
test_legend_position.png
test_logo_on_a_map.png

Report last updated at commit 3270134

@weiji14
weiji14 marked this pull request as ready for review June 6, 2021 09:58
…6.2.0

Fix six broken tests on GMT 6.2.0 for fig.colorbar,
fig.inset, fig.legend, fig.logo, and fig.plot3d.
@weiji14
weiji14 force-pushed the gmt-6.2.0/fix-tests branch from 6fbf5b7 to 1ddda56 Compare June 6, 2021 10:11
Comment on lines 2 to 3
- md5: d08eaf4bf196c8680a3b7c0d8f4259a7
size: 24071

@weiji14 weiji14 Jun 6, 2021 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

test_plot3d_matrix_color still failing on Windows. See https://github.com/GenericMappingTools/pygmt/pull/1322/checks?check_run_id=2756778343#step:11:486:

__________________________ test_plot3d_matrix_color ___________________________
Error: Image dimensions did not match.
  Expected shape: (1040, 1729)
    D:\a\pygmt\pygmt\tmp-test-dir-with-unique-name\results\pygmt.tests.test_plot3d.test_plot3d_matrix_color\baseline.png
  Actual shape: (991, 1729)
    D:\a\pygmt\pygmt\tmp-test-dir-with-unique-name\results\pygmt.tests.test_plot3d.test_plot3d_matrix_color\result.png
baseline (correct) result (wrong)
baseline result

This test is using i=[0, 1, 2, 2], so perhaps something not handled properly with the bugfixes at GenericMappingTools/gmt#5289 or GenericMappingTools/gmt#5291?

@pytest.mark.mpl_image_compare
def test_plot3d_matrix_color(data, region):
"""
Plot the data passing in a matrix and using a colormap.
"""
fig = Figure()
fig.plot3d(
data=data,
zscale=5,
perspective=[225, 30],
region=region,
projection="X10c",
style="c0.5c",
cmap="rainbow",
columns=[0, 1, 2, 2],
frame=["a", "za"],
)
return fig

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

But it passes on Linux and macOS. I think we can mark it as xfail on Windows, and see if @joa-quim can help debug the Windows-only issue.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I've marked test_plot3d_matrix_color as xfail on Windows (and reverted the dvc baseline image change to that test) at 3270134.

weiji14 added 2 commits June 7, 2021 09:59
Also revert change to test_plot3d_matrix_color.png.dvc since
the baseline image works on Linux and macOS.
@weiji14 weiji14 changed the title Update colorbar, inset, legend, logo, plot3d baseline images for GMT 6.2.0 Update colorbar, inset, legend and logo baseline images for GMT 6.2.0 Jun 6, 2021
@weiji14
weiji14 merged commit 63e63f9 into master Jun 6, 2021
@weiji14
weiji14 deleted the gmt-6.2.0/fix-tests branch June 6, 2021 23:04
@joa-quim

joa-quim commented Jun 6, 2021

Copy link
Copy Markdown
Member

Sorry, what is it that you want me to test?

@seisman

seisman commented Jun 6, 2021 •

Copy link
Copy Markdown
Member

Sorry, what is it that you want me to test?

Here is a PyGMT script:

import numpy as np
import pygmt

datafile = "points.txt"

# array
data = np.loadtxt(datafile)
fig = pygmt.Figure()
fig.plot3d(
    data=data,
    zscale=5,
    perspective=[225, 30],
    region=[10, 70, -5, 10, 0, 1],
    projection="X10c",
    style="c0.5c",
    cmap="rainbow",
    frame=["a", "za"],
    i=[0, 1, 2, 2],
)
fig.savefig("plot3d-array.png")

The data file is points.txt.

The PyGMT test shows that the above script produces the correct (left side) image on Linux/macOS, but produces the wrong (right-side) image on Windows.

baseline (correct) result (wrong)
baseline result

It's related to recent changes about the -i option in GenericMappingTools/gmt#5289 and GenericMappingTools/gmt#5291. Please see if you can reproduce it.

@joa-quim

joa-quim commented Jun 6, 2021

Copy link
Copy Markdown
Member

Ok, but I want to first reproduce this example in Julia and I'm having some errors that I need to debug first.
Anyway I think that in Julia I never use the numeric values directly but parse them and construct a -i string

And I'll need some remembering on how to update my PyGMT. Remember that I use the code from repo directly and my GMT win build.

seisman pushed a commit that referenced this pull request Jun 8, 2021
…#1322)

Fix five broken tests on GMT 6.2.0 for fig.colorbar, fig.inset,
fig.legend and fig.logo. Differences are mainly due to a different
pen thickness setting. Also marking a test_plot3d_matrix_color
as xfail on Windows due to incorrect -i parameter parsing.
sixy6e pushed a commit to sixy6e/pygmt that referenced this pull request Dec 21, 2022
…GenericMappingTools#1322)

Fix five broken tests on GMT 6.2.0 for fig.colorbar, fig.inset,
fig.legend and fig.logo. Differences are mainly due to a different
pen thickness setting. Also marking a test_plot3d_matrix_color
as xfail on Windows due to incorrect -i parameter parsing.

This branch was previously deployed

1 inactive deployment
Preview — 32701347 Deployed Jun 6, 2021 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Boring but important stuff for the core devs skip-changelog Skip adding Pull Request to changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants