Skip to content
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

Check invalid combinations of resolution and registration in load_earth_relief() #965

Merged
merged 4 commits into from
Feb 26, 2021

Conversation

seisman
Copy link
Member

@seisman seisman commented Feb 25, 2021

Description of proposed changes

As shown in
https://docs.generic-mapping-tools.org/latest/datasets/remote-data.html#id1,
earth_relief_15s only provides pixel-registered grid, and
earth_relief_03s and earth_relief_01s only provide
gridline-registered grid.

This PR adds checks for the invalid combination of resolution and
registration. A test is also added.

Fixes #

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

…h_relief

As shown in
https://docs.generic-mapping-tools.org/latest/datasets/remote-data.html#id1,
`earth_relief_15s` only provides pixel-registered grid, and
`earth_relief_03s` and `earth_relief_01s` only provide
gridline-registered grid.

This PR adds checks for the invalid combination of resolution and
registration. A test is also added.
@seisman seisman added the enhancement Improving an existing feature label Feb 25, 2021
@seisman seisman added this to the 0.3.1 milestone Feb 25, 2021
@seisman seisman added bug Something isn't working and removed enhancement Improving an existing feature labels Feb 25, 2021
@seisman
Copy link
Member Author

seisman commented Feb 25, 2021

A question: do you think we should split the tests in pygmt/tests/test_datasets.py into two files pygmt/tests/test_datasets_tutorial.py and pygmt/tests/test_datasets_earth_relief.py.

@seisman seisman requested review from a team February 25, 2021 22:21
@github-actions
Copy link
Contributor

github-actions bot commented Feb 26, 2021

Deploy preview for pygmt ready!

✅ Preview
https://pygmt-9ek8cm1jg-gmt.vercel.app

Built with commit 4a2a002.
This pull request is being automatically deployed with vercel-action

@willschlitzer willschlitzer merged commit 4db28ef into master Feb 26, 2021
@willschlitzer willschlitzer deleted the earth-relief-invalid-resolution-registration branch February 26, 2021 12:55
sixy6e pushed a commit to sixy6e/pygmt that referenced this pull request Dec 21, 2022
…h_relief (GenericMappingTools#965)

*Add check to see the registration type when passing a registration type for a specific resolution, and raise an error if an invalid registration is passed.
*Add a test to confirm an error is raised when an invalid registration is passed.

Co-authored-by: Will Schlitzer <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants