-
Notifications
You must be signed in to change notification settings - Fork 220
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
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
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.
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_relief
grids 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 format
andmake check
to make sure the code follows the style guide.doc/api/index.rst
.