From 7ae88164b3c7c9616ad5bc05a084fbe9c53610bc Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Tue, 13 Jun 2023 08:51:10 +0800 Subject: [PATCH] Add a test for offsetting beachballs with ndarray inputs --- pygmt/tests/test_meca.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pygmt/tests/test_meca.py b/pygmt/tests/test_meca.py index f54f6b7d16a..314ca00b83a 100644 --- a/pygmt/tests/test_meca.py +++ b/pygmt/tests/test_meca.py @@ -143,7 +143,7 @@ def test_meca_spec_multiple_focalmecha(inputtype): @pytest.mark.mpl_image_compare(filename="test_meca_offset.png") -@pytest.mark.parametrize("inputtype", ["offset_args", "offset_dict"]) +@pytest.mark.parametrize("inputtype", ["offset_args", "offset_dict", "ndarray"]) def test_meca_offset(inputtype): """ Test offsetting beachballs. @@ -173,6 +173,13 @@ def test_meca_offset(inputtype): "latitude": 48, "depth": 12.0, } + elif inputtype == "ndarray": + # Test ndarray input reported in + # https://github.com/GenericMappingTools/pygmt/issues/2016 + args = { + "spec": np.array([[-124, 48, 12.0, 330, 30, 90, 3, -124.5, 47.5]]), + "convention": "aki", + } fig = Figure() fig.basemap(region=[-125, -122, 47, 49], projection="M6c", frame=True)