Skip to content

Fix rose tests for GMT 6.2.0 #1324

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

Merged
merged 8 commits into from
Jun 9, 2021
Merged
Changes from 4 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
23 changes: 12 additions & 11 deletions pygmt/tests/test_rose.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ def fixture_data():
def fixture_data_fractures_compilation():
"""
Load the sample fractures compilation dataset.

Lengths are stored in the first column, azimuths in the second.
"""
return load_fractures_compilation()

Expand All @@ -38,7 +40,6 @@ def test_rose_data_file(data_fractures_compilation):
diameter="5.5c",
color="blue",
frame=["x0.2g0.2", "y30g30", "+glightgray"],
incols=[1, 0],
pen="1p",
norm="",
scale=0.4,
Expand Down Expand Up @@ -116,8 +117,7 @@ def test_rose_plot_data_using_cpt(data):
def test_rose_plot_with_transparency(data_fractures_compilation):
"""
Test supplying a data file containing a list of fracture lengths and
azimuth as digitized from geological maps to the data argument (lengths are
stored in the second column, azimuths in the first, specify via columns).
azimuths as digitized from geological maps to the data argument.

Use transparency.
"""
Expand All @@ -129,7 +129,6 @@ def test_rose_plot_with_transparency(data_fractures_compilation):
diameter="5.5c",
color="blue",
frame=["x0.2g0.2", "y30g30", "+glightgray"],
incols=[1, 0],
pen="1p",
norm=True,
scale=0.4,
Expand All @@ -142,16 +141,14 @@ def test_rose_plot_with_transparency(data_fractures_compilation):
def test_rose_no_sectors(data_fractures_compilation):
"""
Test supplying a data file containing a list of fracture lengths and
azimuth as digitized from geological maps to the data argument (lengths are
stored in the second column, azimuths in the first, specify via columns).
azimuth as digitized from geological maps to the data argument.

Plot data without defining a sector width, add a title and rename labels.
"""
fig = Figure()
fig.rose(
data=data_fractures_compilation,
region=[0, 500, 0, 360],
incols="1,0",
diameter="10c",
labels="180/0/90/270",
frame=["xg100", "yg45", "+t'Windrose diagram'"],
Expand All @@ -166,8 +163,7 @@ def test_rose_no_sectors(data_fractures_compilation):
def test_rose_bools(data_fractures_compilation):
"""
Test supplying a data file containing a list of fracture lengths and
azimuth as digitized from geological maps to the data argument (lengths are
stored in the second column, azimuths in the first, specify via columns).
azimuth as digitized from geological maps to the data argument.

Test bools.
"""
Expand All @@ -176,7 +172,6 @@ def test_rose_bools(data_fractures_compilation):
data=data_fractures_compilation,
region=[0, 1, 0, 360],
sector=10,
incols=[1, 0],
diameter="10c",
frame=["x0.2g0.2", "y30g30", "+glightgray"],
color="red3",
Expand All @@ -198,10 +193,16 @@ def test_rose_deprecate_columns_to_incols(data_fractures_compilation):

Modified from the test_rose_bools() test.
"""

data = data_fractures_compilation
# swap data columns, below the use of the columns parameter
# reverses this action
data = data[["azimuth", "length"]]

fig = Figure()
with pytest.warns(expected_warning=FutureWarning) as record:
fig.rose(
data=data_fractures_compilation,
data=data,
region=[0, 1, 0, 360],
sector=10,
columns=[1, 0],
Expand Down