diff --git a/doc/api/index.rst b/doc/api/index.rst index 51abb721018..8fd7ae0e028 100644 --- a/doc/api/index.rst +++ b/doc/api/index.rst @@ -235,7 +235,6 @@ Use :func:`pygmt.datasets.load_sample_data` instead. .. autosummary:: :toctree: generated - datasets.load_fractures_compilation datasets.load_hotspots datasets.load_mars_shape datasets.load_ocean_ridge_points diff --git a/pygmt/datasets/__init__.py b/pygmt/datasets/__init__.py index 0ee95a42b31..f0c003b77d6 100644 --- a/pygmt/datasets/__init__.py +++ b/pygmt/datasets/__init__.py @@ -12,7 +12,6 @@ ) from pygmt.datasets.samples import ( list_sample_data, - load_fractures_compilation, load_hotspots, load_mars_shape, load_ocean_ridge_points, diff --git a/pygmt/datasets/samples.py b/pygmt/datasets/samples.py index 52013c0ee8a..821e8c4ade1 100644 --- a/pygmt/datasets/samples.py +++ b/pygmt/datasets/samples.py @@ -71,7 +71,6 @@ def load_sample_data(name): # Dictionary of public load functions for backwards compatibility load_func_old = { "bathymetry": load_sample_bathymetry, - "fractures": load_fractures_compilation, "hotspots": load_hotspots, "mars_shape": load_mars_shape, "ocean_ridge_points": load_ocean_ridge_points, @@ -81,6 +80,7 @@ def load_sample_data(name): # Dictionary of private load functions load_func = { "earth_relief_holes": _load_earth_relief_holes, + "fractures": _load_fractures_compilation, "japan_quakes": _load_japan_quakes, "maunaloa_co2": _load_maunaloa_co2, "notre_dame_topography": _load_notre_dame_topography, @@ -233,38 +233,22 @@ def load_usgs_quakes(**kwargs): return data -def load_fractures_compilation(**kwargs): +def _load_fractures_compilation(): """ - (Deprecated) Load a table of fracture lengths and azimuths as - hypothetically digitized from geological maps as a pandas.DataFrame. - - .. warning:: Deprecated since v0.6.0. This function has been replaced with - ``load_sample_data(name="fractures")`` and will be removed in - v0.9.0. - - This is the ``@fractures_06.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. + Load a table of fracture lengths and azimuths as hypothetically digitized + from geological maps as a pandas.DataFrame. Returns ------- data : pandas.DataFrame - The data table. Use ``print(data.describe())`` to see the available - columns. + The data table. The column names are "length" and + "azimuth" of the fractures. """ - 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='fractures') instead.", - category=FutureWarning, - stacklevel=2, - ) fname = which("@fractures_06.txt", download="c") - data = pd.read_csv(fname, header=None, sep=r"\s+", names=["azimuth", "length"]) + data = pd.read_csv( + fname, header=None, delim_whitespace=True, names=["azimuth", "length"] + ) return data[["length", "azimuth"]] diff --git a/pygmt/tests/test_datasets_samples.py b/pygmt/tests/test_datasets_samples.py index d96c7d9729e..98e25ae7bc7 100644 --- a/pygmt/tests/test_datasets_samples.py +++ b/pygmt/tests/test_datasets_samples.py @@ -5,7 +5,6 @@ import pandas as pd import pytest from pygmt.datasets import ( - load_fractures_compilation, load_hotspots, load_mars_shape, load_ocean_ridge_points, @@ -82,9 +81,7 @@ def test_fractures_compilation(): """ Check that the @fractures_06.txt dataset loads without errors. """ - with pytest.warns(expected_warning=FutureWarning) as record: - data = load_fractures_compilation() - assert len(record) == 1 + data = load_sample_data(name="fractures") assert data.shape == (361, 2) assert data["length"].min() == 98.6561 assert data["length"].max() == 984.652