diff --git a/doc/api/index.rst b/doc/api/index.rst index 8fd7ae0e028..08d9a23ec3f 100644 --- a/doc/api/index.rst +++ b/doc/api/index.rst @@ -237,7 +237,6 @@ Use :func:`pygmt.datasets.load_sample_data` instead. datasets.load_hotspots datasets.load_mars_shape - datasets.load_ocean_ridge_points datasets.load_sample_bathymetry datasets.load_usgs_quakes diff --git a/pygmt/datasets/__init__.py b/pygmt/datasets/__init__.py index f0c003b77d6..3a00936ef26 100644 --- a/pygmt/datasets/__init__.py +++ b/pygmt/datasets/__init__.py @@ -14,7 +14,6 @@ list_sample_data, load_hotspots, load_mars_shape, - load_ocean_ridge_points, load_sample_bathymetry, load_sample_data, load_usgs_quakes, diff --git a/pygmt/datasets/samples.py b/pygmt/datasets/samples.py index bfb7fb84c46..fe52f4bbc39 100644 --- a/pygmt/datasets/samples.py +++ b/pygmt/datasets/samples.py @@ -73,7 +73,6 @@ def load_sample_data(name): "bathymetry": load_sample_bathymetry, "hotspots": load_hotspots, "mars_shape": load_mars_shape, - "ocean_ridge_points": load_ocean_ridge_points, "usgs_quakes": load_usgs_quakes, } @@ -84,6 +83,7 @@ def load_sample_data(name): "japan_quakes": _load_japan_quakes, "maunaloa_co2": _load_maunaloa_co2, "notre_dame_topography": _load_notre_dame_topography, + "ocean_ridge_points": _load_ocean_ridge_points, "rock_compositions": _load_rock_sample_compositions, } @@ -125,41 +125,24 @@ def _load_japan_quakes(): ) -def load_ocean_ridge_points(**kwargs): +def _load_ocean_ridge_points(): """ - (Deprecated) Load a table of ocean ridge points for the entire world as a + Load a table of ocean ridge points for the entire world as a pandas.DataFrame. - .. warning:: Deprecated since v0.6.0. This function has been replaced with - ``load_sample_data(name="ocean_ridge_points")`` and will be removed in - v0.9.0. - - This is the ``@ridge.txt`` dataset used in the GMT tutorials. - - 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. - Returns ------- data : pandas.DataFrame - The data table. Columns are longitude and latitude. + The data table. The column names are "longitude" and "latitude". """ - - if "suppress_warning" not in kwargs: - warnings.warn( - "This function has been deprecated since v0.6.0 and will be removed " - "in v0.9.0. Please use load_sample_data(name='ocean_ridge_points') " - "instead.", - category=FutureWarning, - stacklevel=2, - ) - fname = which("@ridge.txt", download="c") - data = pd.read_csv( - fname, sep=r"\s+", names=["longitude", "latitude"], skiprows=1, comment=">" + return pd.read_csv( + fname, + delim_whitespace=True, + names=["longitude", "latitude"], + skiprows=1, + comment=">", ) - return data def load_sample_bathymetry(**kwargs): diff --git a/pygmt/tests/test_datasets_samples.py b/pygmt/tests/test_datasets_samples.py index 98e25ae7bc7..cbfae696984 100644 --- a/pygmt/tests/test_datasets_samples.py +++ b/pygmt/tests/test_datasets_samples.py @@ -7,7 +7,6 @@ from pygmt.datasets import ( load_hotspots, load_mars_shape, - load_ocean_ridge_points, load_sample_bathymetry, load_sample_data, load_usgs_quakes, @@ -41,9 +40,7 @@ def test_ocean_ridge_points(): """ Check that the @ridge.txt dataset loads without errors. """ - with pytest.warns(expected_warning=FutureWarning) as record: - data = load_ocean_ridge_points() - assert len(record) == 1 + data = load_sample_data(name="ocean_ridge_points") assert data.shape == (4146, 2) assert data["longitude"].min() == -179.9401 assert data["longitude"].max() == 179.935