Allow load_earth_relief() to load pixel or gridline registered data#509
Allow load_earth_relief() to load pixel or gridline registered data#509
Conversation
Somewhat backward compatible way of retrieving the `earth_relief` grids using GMT 6.0 or GMT 6.1.
Refactored tests to explicitly use the gridline registered earth_relief grid, either by modifying the pytest fixture or adding a fixture. Also clarified that only gridline registered grids are available for GMT 6.0.
|
@weiji14 Do you want to implement the registration option only, or do you also want to support |
|
Let's keep this PR small. I actually have no idea how the |
|
OK. Please merge the master branch in then I can review it. |
|
Oops, should have used pygmt/.github/workflows/ci_tests.yaml Line 72 in a5af2dc Should I just fix it here? |
pygmt/datasets/earth_relief.py
Outdated
| "'pixel', 'gridline' or None. Default is None for pixel registration." | ||
| ) | ||
|
|
||
| fname = which(f"@earth_relief_{resolution}{_registration}", download="u") |
There was a problem hiding this comment.
It's better to use download="a" in GMT 6.1, but it's OK now.
| @@ -80,9 +80,15 @@ def test_earth_relief_01d(): | |||
|
|
|||
There was a problem hiding this comment.
After bumping to GMT 6.1, we need to add a test with registration="pixel" or None.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
BTW, the PR title can be changed to "Allow load_earth_relief() to load pixel or gridline registered data". It's more readable to me. |
seisman
left a comment
There was a problem hiding this comment.
I don't test it with GMT 6.1.0, but it looks good.
Description of proposed changes
Somewhat backward compatible way of retrieving the
earth_reliefgrids using GMT 6.0 or GMT 6.1. Tests on GMT 6.0 should still pass as usual in this PR, but there should be fewer failures on GMT 6.1 (except those due to the cpt change).TODO:
load_earth_relief(registration="gridline")(9a74910) 39 test failures on GMT 6.1Fixes (partially) #489
Reminders
make formatandmake checkto make sure the code follows the style guide.doc/api/index.rst.