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

Remove the deprecated load_japan_quakes function (deprecated since v0.6.0) #2301

Merged
merged 5 commits into from
Jan 5, 2023

Conversation

seisman
Copy link
Member

@seisman seisman commented Jan 4, 2023

Description of proposed changes

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 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.
  • Use underscores (not hyphens) in names of Python files and directories.

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

@seisman seisman added the deprecation Deprecating a feature label Jan 4, 2023
@seisman seisman added this to the 0.9.0 milestone Jan 4, 2023
Comment on lines +109 to +122
return pd.read_csv(
fname,
header=1,
delim_whitespace=True,
names=[
"year",
"month",
"day",
"latitude",
"longitude",
"depth_km",
"magnitude",
],
)
Copy link
Member Author

Choose a reason for hiding this comment

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

FYI, I also made two changes when reading the dataset:

  1. Use delim_whitespace=True instead of sep=r"\s+". They're the same but I think delim_whitespace=True is easier to understand (just my own preference).
  2. Use the names parameter in the read_csv function, instead of changing the columns later.

@@ -29,9 +28,7 @@ def test_japan_quakes():
"""
Check that the dataset loads without errors.
"""
with pytest.warns(expected_warning=FutureWarning) as record:
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like test_japan_quakes and test_load_sample_data are the same. Should one of them be removed?

Copy link
Member Author

Choose a reason for hiding this comment

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

You're right. I removed in a35adc6.

@willschlitzer willschlitzer added the final review call This PR requires final review and approval from a second reviewer label Jan 4, 2023
Comment on lines -107 to -108
Data is from the NOAA NGDC database. This is the ``@tut_quakes.ngdc``
dataset used in the GMT tutorials.
Copy link
Member

Choose a reason for hiding this comment

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

Maybe we should keep this background information of the data?

The data are downloaded to a cache directory (usually ``~/.gmt/cache``) the
first time you invoke this function. Afterwards, it will load the data from
the cache. So you'll need an internet connection the first time around.
Load a table of earthquakes around Japan as a pandas.DataFrame.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Load a table of earthquakes around Japan as a pandas.DataFrame.
Load a table of earthquakes around Japan as a pandas.DataFrame.
Data is from the NOAA NGDC database. This is the "@tut_quakes.ngdc"
dataset used in the GMT tutorials.

Copy link
Member Author

Choose a reason for hiding this comment

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

@yvonnefroehlich Thanks for your comments.

Data is from the NOAA NGDC database.

I've added this sentence back in 92bcec3.

This is the "@tut_quakes.ngdc" dataset used in the GMT tutorials.

I don't think this sentence would provide any meaningful information. The file name is easy to get from the function and we all know that these dataset are used in the tutorials.

Copy link
Member

@yvonnefroehlich yvonnefroehlich Jan 5, 2023

Choose a reason for hiding this comment

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

I was not complete sure about this, as in the PRs #2306 and #2308 this is not removed but in the PRs #2301 (this PR), #2303, and #2305 it is removed. I have no big preference on this, but it should be consistent for all functions.

Copy link
Member Author

Choose a reason for hiding this comment

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

Let's discuss it in this PR and then update other PRs if necessary.

@michaelgrund and @willschlitzer what do you think?

Copy link
Member

Choose a reason for hiding this comment

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

I'm with @seisman since this information is not really required at this point in my opinion.

Copy link
Member Author

Choose a reason for hiding this comment

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

OK, then we can merge this PR.

Co-authored-by: Yvonne Fröhlich <94163266+yvonnefroehlich@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deprecation Deprecating a feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants