You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Baseline images need updates due to the recent updates of earth relief data #451
Upstream GMT has recently updated the global earth relief data (see GenericMappingTools/gmtserver-admin#40 for the recipe change), which lead to some test failures in PyGMT.
We need to re-generate the baseline images using the latest earth relief data and GMT 6.0.0.
While the Travis CI reports several test failures, the Azure Pipelines CIs don't. It's simply because we already cached the earth relief in the Azure Pipelines CI, thus Azure Pipelines CI is still using the old earth relief data. We need to update the cache key 20200519 to a new date to manually re-cache the new earth relief data.
Re-open the issue again, since the GMT data server updated again recently.
The biggest change is that the GMT data server now provides earth relief grids in both pixel- and gridline-registrations.
In GMT 6.1.0 (not released yet), users can give a name like @earth_relief_30m_p or @earth_relief_30m_g to specify which registration they want to use. If no registration is given, e.g., @earth_relief_30m, then the pixel-registration grid is the default.
For GMT 6.0.0, it's a breaking change. The grids changes from gridline-registration to pixel-registration.
We'll need to be very careful about this change (from gridline/node-registration to pixel-registration). It's been touched upon before in #375. Personally I'm in favour of pixel registration since that's what xarray assumes (I think?), but we might want to change the following lines:
Currently it defaults to gridline-registration GMT_GRID_NODE_REG. Ideally we would be able to specify whether pixel- GMT_GRID_PIXEL_REG or gridline/node- GMT_GRID_NODE_REG is used.
Just need to finish off some of my other work first, and I'll try to get a Pull Request up to resolve this tonight (actually had a local branch working on fixing #375 before).
In GMT 6.1.0 (not released yet), users can give a name like @earth_relief_30m_p or @earth_relief_30m_g to specify which registration they want to use. If no registration is given, e.g., @earth_relief_30m, then the pixel-registration grid is the default.
For GMT 6.0.0, it's a breaking change. The grids changes from gridline-registration to pixel-registration.
Do you think it's a good idea to change the pygmt code to use @earth_relief_30m_g for now (instead of @earth_relief_30m_p), if only to make the tests pass and keep the existing behaviour? I'm a bit hesitant to update so many PNG files again (as with GenericMappingTools/gmt#3470), and #476 doesn't seem to be a quick fix to make.
Gridline-registered grids like @earth_relief_30m_g are not available to GMT 6.0.0.
So, it's a big breaking change for GMT 6.0.0. Perhaps for GMT 6.0.0, @earth_relief_30m should be aliased to @earth_relief_30m_g instead of @earth_relief_30_p to keep backward compatibility? @PaulWessel
The GMT repository also faces the same problem. After some discussion, I feel the easiest way is to use shallow clone so that we don't have to care too much about the repository size.
Yeah, and I don't think it will be friendly for new contributors either. Surely there must be a better way to store the images, or test them ☹️
Now that we have #555, we should be able to resolve this issue by removing all the xfail statements, specifically just for the grd* modules (the non-grd* ones should be covered by #522).
Should we remove the baseline images from the repository when we switch from using @pytest.mark.mpl_image_compare to @check_figures_equal()?
Now that we have #555, we should be able to resolve this issue by removing all the xfail statements, specifically just for the grd* modules (the non-grd* ones should be covered by #522).
For other non-grd tests, perhaps we could generate the reference images by directly passing arguments to GMT modules. For examples,
For other non-grd tests, perhaps we could generate the reference images by directly passing arguments to GMT modules.
GMT sometimes make tiny changes that may affect all images. For example, GenericMappingTools/gmt#677, if this "bug" is fixed, we may have many failures and have to update the images again. Using the method I mentioned above can avoid these problems.
In this way, we can almost avoid all baselines images.
This is almost asking for a command like pygmt.call_module 😆
Also, just to note on the pytest-mpl PR at matplotlib/pytest-mpl#95 (comment), we might be able to keep using @pytest.mark.mpl_image_comparebut just return 2 figures instead of 1. Code as so:
Recently, upstream GMT made a "tiny" change about the order of plotting frames, ticks, gridlines, and data (see GenericMappingTools/gmt#4274). The change is "tiny" and unnoticeable to most users. However, it breaks some PyGMT tests. Such "tiny" changes never end. That's another reason we have to avoid storing baseline images.
Activity
seisman commentedon May 24, 2020
While the Travis CI reports several test failures, the Azure Pipelines CIs don't. It's simply because we already cached the earth relief in the Azure Pipelines CI, thus Azure Pipelines CI is still using the old earth relief data. We need to update the cache key
20200519to a new date to manually re-cache the new earth relief data.seisman commentedon Jun 9, 2020
Re-open the issue again, since the GMT data server updated again recently.
The biggest change is that the GMT data server now provides earth relief grids in both pixel- and gridline-registrations.
In GMT 6.1.0 (not released yet), users can give a name like @earth_relief_30m_p or @earth_relief_30m_g to specify which registration they want to use. If no registration is given, e.g., @earth_relief_30m, then the pixel-registration grid is the default.
For GMT 6.0.0, it's a breaking change. The grids changes from gridline-registration to pixel-registration.
Thus, we need to update the failing PyGMT tests.
weiji14 commentedon Jun 9, 2020
We'll need to be very careful about this change (from gridline/node-registration to pixel-registration). It's been touched upon before in #375. Personally I'm in favour of pixel registration since that's what
xarrayassumes (I think?), but we might want to change the following lines:pygmt/pygmt/clib/session.py
Lines 567 to 569 in 0267dd1
Currently it defaults to gridline-registration
GMT_GRID_NODE_REG. Ideally we would be able to specify whether pixel-GMT_GRID_PIXEL_REGor gridline/node-GMT_GRID_NODE_REGis used.seisman commentedon Jun 10, 2020
Yes, it looks a big issue.
Yes, the default registration in GMT is also gridline registration, so we will keep as it is.
I agree. Then we need to figure out how to determine the registration of xarray.DataArray.
weiji14 commentedon Jun 10, 2020
Yep,
xarrayuses pixel registration (i.e. the data value is for the centre of the pixel), see http://xarray.pydata.org/en/stable/plotting.html#coordinates, and also pydata/xarray#1468.Just need to finish off some of my other work first, and I'll try to get a Pull Request up to resolve this tonight (actually had a local branch working on fixing #375 before).
weiji14 commentedon Jun 19, 2020
Do you think it's a good idea to change the pygmt code to use
@earth_relief_30m_gfor now (instead of@earth_relief_30m_p), if only to make the tests pass and keep the existing behaviour? I'm a bit hesitant to update so many PNG files again (as with GenericMappingTools/gmt#3470), and #476 doesn't seem to be a quick fix to make.seisman commentedon Jun 19, 2020
Gridline-registered grids like @earth_relief_30m_g are not available to GMT 6.0.0.
So, it's a big breaking change for GMT 6.0.0. Perhaps for GMT 6.0.0, @earth_relief_30m should be aliased to @earth_relief_30m_g instead of @earth_relief_30_p to keep backward compatibility? @PaulWessel
Change load_earth_relief()'s default resolution to 01d
Change load_earth_relief()'s default resolution to 01d
9 remaining items
weiji14 commentedon Jul 9, 2020
Yeah, and I don't think it will be friendly for new contributors either. Surely there must be a better way to store the images, or test them☹️
seisman commentedon Jul 9, 2020
The GMT repository also faces the same problem. After some discussion, I feel the easiest way is to use shallow clone so that we don't have to care too much about the repository size.
weiji14 commentedon Sep 6, 2020
Now that we have #555, we should be able to resolve this issue by removing all the
xfailstatements, specifically just for the grd* modules (the non-grd* ones should be covered by #522).Should we remove the baseline images from the repository when we switch from using
@pytest.mark.mpl_image_compareto@check_figures_equal()?seisman commentedon Sep 7, 2020
For other non-grd tests, perhaps we could generate the reference images by directly passing arguments to GMT modules. For examples,
should be identical to the reference image generated by:
In this way, we can almost avoid all baselines images.
We can, but perhaps we should leave them in the repository for a while until we make the final decision.
seisman commentedon Sep 7, 2020
GMT sometimes make tiny changes that may affect all images. For example, GenericMappingTools/gmt#677, if this "bug" is fixed, we may have many failures and have to update the images again. Using the method I mentioned above can avoid these problems.
weiji14 commentedon Sep 7, 2020
This is almost asking for a command like
pygmt.call_module😆Also, just to note on the pytest-mpl PR at matplotlib/pytest-mpl#95 (comment), we might be able to keep using
@pytest.mark.mpl_image_comparebut just return 2 figures instead of 1. Code as so:Ok. We can remove them one at a time as upstream GMT starts breaking things.
seisman commentedon Oct 15, 2020
Recently, upstream GMT made a "tiny" change about the order of plotting frames, ticks, gridlines, and data (see GenericMappingTools/gmt#4274). The change is "tiny" and unnoticeable to most users. However, it breaks some PyGMT tests. Such "tiny" changes never end. That's another reason we have to avoid storing baseline images.
weiji14 commentedon Oct 15, 2020
Yes, was just about to report on these new failures at https://github.com/GenericMappingTools/pygmt/runs/1256473593?check_suite_focus=true#step:10:423
seisman commentedon Dec 15, 2020
It seems we can close the issue now.
Please re-open the issue if I missed anything.