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

load_earth_age: Add inline examples #2232

Merged
merged 3 commits into from
Dec 7, 2022
Merged

load_earth_age: Add inline examples #2232

merged 3 commits into from
Dec 7, 2022

Conversation

willschlitzer
Copy link
Contributor

Add an inline example for load_earth_age.

Addresses #2225

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 wrapping a new module, open a 'Wrap new GMT module' issue and submit reasonably-sized PRs.
  • 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

@willschlitzer willschlitzer added documentation Improvements or additions to documentation skip-changelog Skip adding Pull Request to changelog labels Dec 6, 2022
@willschlitzer willschlitzer added this to the 0.8.0 milestone Dec 6, 2022
@willschlitzer willschlitzer self-assigned this Dec 6, 2022
@seisman seisman added the final review call This PR requires final review and approval from a second reviewer label Dec 6, 2022
pygmt/datasets/earth_age.py Outdated Show resolved Hide resolved
pygmt/datasets/earth_age.py Outdated Show resolved Hide resolved
pygmt/datasets/earth_age.py Outdated Show resolved Hide resolved
@yvonnefroehlich
Copy link
Member

The following goes beyond this PR. At the moment I am wondering if the two messages blow are contradicting:

When running

from pygmt.datasets import load_earth_age
grid = load_earth_age(resolution="30m")

It says:

pygmt-session [WARNING]: Remote dataset given to a data processing module but no registration was specified - 
default to gridline registration (if available)

In the documentation users find:

registration (str) – Grid registration type. Either "pixel" for pixel registration or "gridline" for gridline registration. Default is None, where a pixel-registered grid is returned unless only the gridline-registered grid is available.

@willschlitzer
Copy link
Contributor Author

The following goes beyond this PR. At the moment I am wondering if the two messages blow are contradicting:

When running

from pygmt.datasets import load_earth_age
grid = load_earth_age(resolution="30m")

It says:

pygmt-session [WARNING]: Remote dataset given to a data processing module but no registration was specified - 
default to gridline registration (if available)

In the documentation users find:

registration (str) – Grid registration type. Either "pixel" for pixel registration or "gridline" for gridline registration. Default is None, where a pixel-registered grid is returned unless only the gridline-registered grid is available.

As I understand it, this is coming from the default registration in GMT. Since an argument isn't passed to registration in this example, the API returns this warning.

@seisman
Copy link
Member

seisman commented Dec 7, 2022

The following goes beyond this PR. At the moment I am wondering if the two messages blow are contradicting:
When running

from pygmt.datasets import load_earth_age
grid = load_earth_age(resolution="30m")

It says:

pygmt-session [WARNING]: Remote dataset given to a data processing module but no registration was specified - 
default to gridline registration (if available)

In the documentation users find:

registration (str) – Grid registration type. Either "pixel" for pixel registration or "gridline" for gridline registration. Default is None, where a pixel-registered grid is returned unless only the gridline-registered grid is available.

As I understand it, this is coming from the default registration in GMT. Since an argument isn't passed to registration in this example, the API returns this warning.

See #1929 for the related issue report. We need to handle this in a separate PR.

@seisman seisman changed the title Add inline example for load_earth_age load_earth_age: Add inline examples Dec 7, 2022
@seisman seisman merged commit f81256c into main Dec 7, 2022
@seisman seisman deleted the inline-example/earth-age branch December 7, 2022 10:19
@seisman seisman removed the final review call This PR requires final review and approval from a second reviewer label Dec 7, 2022
@yvonnefroehlich
Copy link
Member

The following goes beyond this PR. At the moment I am wondering if the two messages blow are contradicting:
When running

from pygmt.datasets import load_earth_age
grid = load_earth_age(resolution="30m")

It says:

pygmt-session [WARNING]: Remote dataset given to a data processing module but no registration was specified - 
default to gridline registration (if available)

In the documentation users find:

registration (str) – Grid registration type. Either "pixel" for pixel registration or "gridline" for gridline registration. Default is None, where a pixel-registered grid is returned unless only the gridline-registered grid is available.

As I understand it, this is coming from the default registration in GMT. Since an argument isn't passed to registration in this example, the API returns this warning.

See #1929 for the related issue report. We need to handle this in a separate PR.

Thanks @seisman for pointing out the related issue!

sixy6e pushed a commit to sixy6e/pygmt that referenced this pull request Dec 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation skip-changelog Skip adding Pull Request to changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants