Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion doc/api/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,6 @@ Use :func:`pygmt.datasets.load_sample_data` instead.
:toctree: generated

datasets.load_fractures_compilation
datasets.load_hotspots
datasets.load_japan_quakes
datasets.load_mars_shape
datasets.load_ocean_ridge_points
Expand Down
1 change: 0 additions & 1 deletion pygmt/datasets/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
from pygmt.datasets.samples import (
list_sample_data,
load_fractures_compilation,
load_hotspots,
load_japan_quakes,
load_mars_shape,
load_ocean_ridge_points,
Expand Down
29 changes: 4 additions & 25 deletions pygmt/datasets/samples.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ def load_sample_data(name):
load_func_old = {
"bathymetry": load_sample_bathymetry,
"fractures": load_fractures_compilation,
"hotspots": load_hotspots,
"japan_quakes": load_japan_quakes,
"mars_shape": load_mars_shape,
"ocean_ridge_points": load_ocean_ridge_points,
Expand All @@ -83,6 +82,7 @@ def load_sample_data(name):
load_func = {
"rock_compositions": _load_rock_sample_compositions,
"earth_relief_holes": _load_earth_relief_holes,
"hotspots": _load_hotspots,
"maunaloa_co2": _load_maunaloa_co2,
Comment thread
michaelgrund marked this conversation as resolved.
"notre_dame_topography": _load_notre_dame_topography,
}
Expand Down Expand Up @@ -285,23 +285,10 @@ def load_fractures_compilation(**kwargs):
return data[["length", "azimuth"]]


def load_hotspots(**kwargs):
def _load_hotspots():
"""
(Deprecated) Load a table with the locations, names, and suggested symbol
sizes of hotspots.

.. warning:: Deprecated since v0.6.0. This function has been replaced with
``load_sample_data(name="hotspots")`` and will be removed in
v0.9.0.

This is the ``@hotspots.txt`` dataset used in the GMT tutorials, with data
from Mueller, Royer, and Lawver, 1993, Geology, vol. 21, pp. 275-278. The
main 5 hotspots used by Doubrovine et al. [2012] have symbol sizes twice
the size of all other hotspots.
Comment thread
michaelgrund marked this conversation as resolved.

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 with the locations, names, and suggested symbol sizes of
hotspots as a pandas.DataFrame.
Comment thread
michaelgrund marked this conversation as resolved.

Returns
-------
Expand All @@ -310,14 +297,6 @@ def load_hotspots(**kwargs):
"placename".
Comment thread
michaelgrund marked this conversation as resolved.
Outdated
"""

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='hotspots') instead.",
category=FutureWarning,
stacklevel=2,
)
fname = which("@hotspots.txt", download="c")
columns = ["longitude", "latitude", "symbol_size", "place_name"]
Comment thread
michaelgrund marked this conversation as resolved.
Outdated
Comment thread
michaelgrund marked this conversation as resolved.
Outdated
data = pd.read_table(filepath_or_buffer=fname, sep="\t", skiprows=3, names=columns)
Comment thread
seisman marked this conversation as resolved.
Outdated
Comment thread
michaelgrund marked this conversation as resolved.
Outdated
Expand Down
5 changes: 1 addition & 4 deletions pygmt/tests/test_datasets_samples.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import pytest
from pygmt.datasets import (
load_fractures_compilation,
load_hotspots,
load_japan_quakes,
load_mars_shape,
load_ocean_ridge_points,
Expand Down Expand Up @@ -129,9 +128,7 @@ def test_hotspots():
"""
Check that the @hotspots.txt dataset loads without errors.
"""
with pytest.warns(expected_warning=FutureWarning) as record:
data = load_hotspots()
assert len(record) == 1
data = load_sample_data(name="hotspots")
assert data.shape == (55, 4)
assert list(data.columns) == [
"longitude",
Comment thread
michaelgrund marked this conversation as resolved.
Expand Down