Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
6 changes: 3 additions & 3 deletions pygmt/datasets/samples.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,16 +369,16 @@ def _load_rock_sample_compositions():
Returns
-------
data : pandas.DataFrame
The data table with columns "water", "air", and "limestone".
The data table with columns "limestone", "water", "air",
and "permittivity".
"""

fname = which("@ternary.txt", download="c")
return pd.read_csv(
fname,
delim_whitespace=True,
header=None,
names=["water", "air", "limestone"],
usecols=(0, 1, 2),
names=["limestone", "water", "air", "permittivity"],
)


Expand Down
12 changes: 7 additions & 5 deletions pygmt/tests/test_datasets_samples.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,12 @@ def test_rock_sample_compositions():
Check that the @ternary.txt dataset loads without errors.
"""
data = load_sample_data(name="rock_compositions")
assert data.shape == (1000, 3)
assert data.shape == (1000, 4)
assert data["limestone"].min() == 0
assert data["limestone"].max() == 1
assert data["water"].min() == 0
assert data["water"].max() == 1
assert data["water"].max() == 0.921
assert data["air"].min() == 0
assert data["air"].max() == 0.921
assert data["limestone"].min() == 0
assert data["limestone"].max() == 0.981
assert data["air"].max() == 0.981
assert data["permittivity"].min() == 1.041
assert data["permittivity"].max() == 70.844