Skip to content

Commit

Permalink
Add a new test test_meca_spec_dataframe to test passing a dataframe t…
Browse files Browse the repository at this point in the history
…o meca
  • Loading branch information
seisman committed Dec 2, 2022
1 parent 3e21af4 commit 7b1b17e
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions pygmt/tests/test_meca.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,26 @@ def test_meca_spec_file():
return fig


@pytest.mark.mpl_image_compare(filename="test_meca_spec_dict.png")
def test_meca_spec_dataframe():
"""
Test supplying a dictionary containing a single focal mechanism to the spec
parameter.
"""
fig = Figure()
fig.meca(
spec=pd.DataFrame(dict(strike=0, dip=90, rake=0, magnitude=5), index=[0]),
longitude=0,
latitude=5,
depth=0,
scale="2.5c",
region=[-1, 1, 4, 6],
projection="M14c",
frame=True,
)
return fig


@pytest.mark.mpl_image_compare
def test_meca_spec_dict_list():
"""
Expand Down

0 comments on commit 7b1b17e

Please sign in to comment.