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 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
31 changes: 16 additions & 15 deletions pygmt/tests/test_rose.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ def fixture_data():
@pytest.fixture(scope="module", name="data_fractures_compilation")
def fixture_data_fractures_compilation():
"""
Load the sample fractures compilation dataset.
Load the sample fractures compilation dataset which contains fracture
lengths and azimuths as hypothetically digitized from geological maps.

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

Expand All @@ -38,7 +41,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 @@ -115,9 +117,8 @@ def test_rose_plot_data_using_cpt(data):
@pytest.mark.mpl_image_compare
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).
Test supplying the sample fractures compilation dataset to the data
parameter.

Use transparency.
"""
Expand All @@ -129,7 +130,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 @@ -141,17 +141,15 @@ def test_rose_plot_with_transparency(data_fractures_compilation):
@pytest.mark.mpl_image_compare
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).
Test supplying the sample fractures compilation dataset to the data
parameter.

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 @@ -165,9 +163,8 @@ def test_rose_no_sectors(data_fractures_compilation):
@pytest.mark.mpl_image_compare
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).
Test supplying the sample fractures compilation dataset to the data
parameter.

Test bools.
"""
Expand All @@ -176,7 +173,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 +194,15 @@ def test_rose_deprecate_columns_to_incols(data_fractures_compilation):

Modified from the test_rose_bools() test.
"""

# swap data column order of the sample fractures compilation dataset,
# as the use of the 'columns' parameter will reverse this action
data = data_fractures_compilation[["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