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

Change load_earth_relief()'s default resolution to 01d #488

Merged
merged 3 commits into from
Jun 23, 2020

Conversation

seisman
Copy link
Member

@seisman seisman commented Jun 23, 2020

Description of proposed changes

In GMT 6.0.0, both 01d and 60m are valid resolutions of earth
relief data. It was called 60m at the beginning, and was changed to 01d
when GMT 6.0.0 was officially released. 60m is still valid for backward
compatibility.

Run the following commands, and you will have the two data in the
current directory.

gmt which @earth_relief_60m -Gl
gmt which @earth_relief_01d -Gl

These two files have different file names but are identical:

$ md5sum earth_relief_01d.grd earth_relief_60m.grd
74a884c902015dda516d17605f317efe  earth_relief_01d.grd
74a884c902015dda516d17605f317efe  earth_relief_60m.grd

In the upcoming GMT 6.1.0, the resolution 60m will be deprecated.
That's why we have many ~25 errors when testing PyGMT with the GMT master
branch, simply because GMT 6.1.0 can't download the @earth_relief_60m.

To make the transition to GMT 6.1.0 easier, here I change the default
earth relief resolution of load_earth_relief() function from 60m to
01d. As the two grids are identical, the change in this PR won't break
anything.

Note that, currently there are ~43 failures due to the recent updates of
the GMT data server (#451), and we can't fix these failures easily due
to the grid registration issue (#476). Thus, I don't try to fix any
failures in this PR.

I also added some valid resolutions (e.g., 20m, 15m) which are missing.

The test log files (master.log and current-branch.log) of the master branch and this branch are the same.
Tests that fail in the master branch still fail in the same way in this branch.

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.

In GMT 6.0.0, both `01d` and `60m` are valid resolutions of earth
relief data. It was called `60m` at the beginning, and was changed to `01d`
when GMT 6.0.0 was officially released. `60m` is still valid for backward
compatibility.

Run the following commands, and you will have the two data in the
current directory.
```
gmt which @earth_relief_60m -Gl
gmt which @earth_relief_01d -Gl
```
These two files have different file names but are identical:
```
$ md5sum earth_relief_01d.grd earth_relief_60m.grd
74a884c902015dda516d17605f317efe  earth_relief_01d.grd
74a884c902015dda516d17605f317efe  earth_relief_60m.grd
```

In the upcoming GMT 6.1.0, the resolution `60m` will be deprecated.
That's why we have many ~25 errors when testing PyGMT with the GMT master
branch, simply because GMT 6.1.0 can't download the `@earth_relief_60m`.

To make the transition to GMT 6.1.0 easier, here I change the default
earth relief resolution of `load_earth_relief()` function from `60m` to
`01d`. As the two grids are identical, the change in this PR won't break
anything.

Note that, currently there are ~43 failures due to the recent updates of
the GMT data server (#451), and we can't fix these failures easily due
to the grid registration issue (#476). Thus, I don't try to fix any
failures in this PR.

The test log files of the master branch and this branch are the same.
Tests that fail in the master brach still fail in the same way in this branch.
@seisman seisman requested a review from weiji14 June 23, 2020 04:27
@vercel vercel bot temporarily deployed to Preview June 23, 2020 04:27 Inactive
@seisman seisman requested a review from leouieda June 23, 2020 04:27
Copy link
Member

@weiji14 weiji14 left a comment

Choose a reason for hiding this comment

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

Looks good. I get the same 43 failures locally (on GMT 6.0). Just a few suggestions.

pygmt/datasets/earth_relief.py Show resolved Hide resolved
pygmt/datasets/earth_relief.py Outdated Show resolved Hide resolved
pygmt/datasets/earth_relief.py Outdated Show resolved Hide resolved
Co-authored-by: Wei Ji <23487320+weiji14@users.noreply.github.com>
@vercel vercel bot temporarily deployed to Preview June 23, 2020 05:13 Inactive
@seisman seisman added the enhancement Improving an existing feature label Jun 23, 2020
@seisman seisman merged commit eaf81bb into master Jun 23, 2020
@seisman seisman deleted the earth-relief-01d branch June 23, 2020 06:28
@seisman
Copy link
Member Author

seisman commented Jun 23, 2020

@weiji14

  1. I changed the branch protection rule so that I can merge the PR even though our CI jobs fail.
  2. When writing the commit message before merging a PR, we need to pay a little more attention to the maximum line length. Long lines look terrible, but I know that the github text editor is not good for limiting the line length.

Locally:
image

GitHub new experimental UI:
image

@weiji14
Copy link
Member

weiji14 commented Jun 23, 2020

Ah ok, I always do squash merging via the Github UI and never noticed. Do you just copy the text into your editor and have it cut the line lengths somehow?

As for the repository refresh thing, might be good to give feedback at https://support.github.com/contact/feedback?contact%5Bcategory%5D=repo-refresh&contact%5Bsubject%5D=Product+feedback.

@seisman
Copy link
Member Author

seisman commented Jun 24, 2020

Ah ok, I always do squash merging via the Github UI and never noticed. Do you just copy the text into your editor and have it cut the line lengths somehow?

My vim editor seems to be clever to automatically wrap my commit messages to no longer than 80 characters. When do the squash merging, I usually use the line length of the commit messages as a ruler.

@weiji14 weiji14 added this to the 0.1.x milestone Jun 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improving an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants