diff --git a/pygmt/tests/baseline/test_meca_loc_array.png b/pygmt/tests/baseline/test_meca_loc_array.png deleted file mode 100644 index 73c9675c1d7..00000000000 Binary files a/pygmt/tests/baseline/test_meca_loc_array.png and /dev/null differ diff --git a/pygmt/tests/baseline/test_meca_loc_array.png.dvc b/pygmt/tests/baseline/test_meca_loc_array.png.dvc new file mode 100644 index 00000000000..31612381e84 --- /dev/null +++ b/pygmt/tests/baseline/test_meca_loc_array.png.dvc @@ -0,0 +1,4 @@ +outs: +- md5: 7500fa67c18f4e307497e05fbc6857e3 + size: 4903 + path: test_meca_loc_array.png diff --git a/pygmt/tests/baseline/test_meca_spec_1d_array.png b/pygmt/tests/baseline/test_meca_spec_1d_array.png deleted file mode 100644 index e6c1f0c25c2..00000000000 Binary files a/pygmt/tests/baseline/test_meca_spec_1d_array.png and /dev/null differ diff --git a/pygmt/tests/baseline/test_meca_spec_1d_array.png.dvc b/pygmt/tests/baseline/test_meca_spec_1d_array.png.dvc new file mode 100644 index 00000000000..def65f4334c --- /dev/null +++ b/pygmt/tests/baseline/test_meca_spec_1d_array.png.dvc @@ -0,0 +1,4 @@ +outs: +- md5: 05610aeb221699698eac9d74012b5c0b + size: 3212 + path: test_meca_spec_1d_array.png diff --git a/pygmt/tests/baseline/test_meca_spec_2d_array.png b/pygmt/tests/baseline/test_meca_spec_2d_array.png deleted file mode 100644 index 51c62146df3..00000000000 Binary files a/pygmt/tests/baseline/test_meca_spec_2d_array.png and /dev/null differ diff --git a/pygmt/tests/baseline/test_meca_spec_2d_array.png.dvc b/pygmt/tests/baseline/test_meca_spec_2d_array.png.dvc new file mode 100644 index 00000000000..d0a8f4fc2b2 --- /dev/null +++ b/pygmt/tests/baseline/test_meca_spec_2d_array.png.dvc @@ -0,0 +1,4 @@ +outs: +- md5: b3e49cd999ed234d679f359d7b4fac28 + size: 5424 + path: test_meca_spec_2d_array.png diff --git a/pygmt/tests/baseline/test_meca_spec_dataframe.png b/pygmt/tests/baseline/test_meca_spec_dataframe.png deleted file mode 100644 index 45a2efda1b4..00000000000 Binary files a/pygmt/tests/baseline/test_meca_spec_dataframe.png and /dev/null differ diff --git a/pygmt/tests/baseline/test_meca_spec_dataframe.png.dvc b/pygmt/tests/baseline/test_meca_spec_dataframe.png.dvc new file mode 100644 index 00000000000..6fca9e8556b --- /dev/null +++ b/pygmt/tests/baseline/test_meca_spec_dataframe.png.dvc @@ -0,0 +1,4 @@ +outs: +- md5: 7b7024b143d6b0ec2a339e58db4d7c78 + size: 4575 + path: test_meca_spec_dataframe.png diff --git a/pygmt/tests/baseline/test_meca_spec_dict_list.png b/pygmt/tests/baseline/test_meca_spec_dict_list.png deleted file mode 100644 index c4b54723c7b..00000000000 Binary files a/pygmt/tests/baseline/test_meca_spec_dict_list.png and /dev/null differ diff --git a/pygmt/tests/baseline/test_meca_spec_dict_list.png.dvc b/pygmt/tests/baseline/test_meca_spec_dict_list.png.dvc new file mode 100644 index 00000000000..c889888a2b1 --- /dev/null +++ b/pygmt/tests/baseline/test_meca_spec_dict_list.png.dvc @@ -0,0 +1,4 @@ +outs: +- md5: a0abe33fb3dc4a67444cabe82cad92ba + size: 3074 + path: test_meca_spec_dict_list.png diff --git a/pygmt/tests/baseline/test_meca_spec_dictionary.png b/pygmt/tests/baseline/test_meca_spec_dictionary.png deleted file mode 100644 index 9663b3a9c1d..00000000000 Binary files a/pygmt/tests/baseline/test_meca_spec_dictionary.png and /dev/null differ diff --git a/pygmt/tests/baseline/test_meca_spec_dictionary.png.dvc b/pygmt/tests/baseline/test_meca_spec_dictionary.png.dvc new file mode 100644 index 00000000000..ceb6336c0ed --- /dev/null +++ b/pygmt/tests/baseline/test_meca_spec_dictionary.png.dvc @@ -0,0 +1,4 @@ +outs: +- md5: 9077531329696ab21991b6e9595b281a + size: 19564 + path: test_meca_spec_dictionary.png diff --git a/pygmt/tests/baseline/test_meca_spec_file.png b/pygmt/tests/baseline/test_meca_spec_file.png deleted file mode 100644 index d3a57997080..00000000000 Binary files a/pygmt/tests/baseline/test_meca_spec_file.png and /dev/null differ diff --git a/pygmt/tests/baseline/test_meca_spec_file.png.dvc b/pygmt/tests/baseline/test_meca_spec_file.png.dvc new file mode 100644 index 00000000000..1693cb3f82d --- /dev/null +++ b/pygmt/tests/baseline/test_meca_spec_file.png.dvc @@ -0,0 +1,4 @@ +outs: +- md5: ad602355748d74a76edfa5cef4100b13 + size: 3179 + path: test_meca_spec_file.png diff --git a/pygmt/tests/test_meca.py b/pygmt/tests/test_meca.py index 24715cd92a2..400ef37570d 100644 --- a/pygmt/tests/test_meca.py +++ b/pygmt/tests/test_meca.py @@ -15,12 +15,10 @@ @pytest.mark.mpl_image_compare def test_meca_spec_dictionary(): """ - Test supplying a dictionary containing a single focal mechanism to the - `spec` argument. + Test supplying a dictionary containing a single focal mechanism to the spec + parameter. """ - fig = Figure() - # Right lateral strike slip focal mechanism fig.meca( dict(strike=0, dip=90, rake=0, magnitude=5), @@ -32,7 +30,6 @@ def test_meca_spec_dictionary(): projection="M14c", frame=2, ) - return fig @@ -40,16 +37,13 @@ def test_meca_spec_dictionary(): def test_meca_spec_dict_list(): """ Test supplying a dictionary containing a list of focal mechanism to the - `spec` argument. + spec parameter. """ - fig = Figure() - # supply focal mechanisms as a dict of lists focal_mechanisms = dict( strike=[330, 350], dip=[30, 50], rake=[90, 90], magnitude=[3, 2] ) - fig.meca( focal_mechanisms, longitude=[-124.3, -124.4], @@ -59,15 +53,14 @@ def test_meca_spec_dict_list(): scale="2c", projection="M14c", ) - return fig @pytest.mark.mpl_image_compare def test_meca_spec_dataframe(): """ - Test supplying a pandas DataFrame containing focal mechanisms and locations - to the `spec` argument. + Test supplying a pandas.DataFrame containing focal mechanisms and locations + to the spec parameter. """ fig = Figure() @@ -83,9 +76,7 @@ def test_meca_spec_dataframe(): depth=[12, 11.0], ) spec_dataframe = pd.DataFrame(data=focal_mechanisms) - fig.meca(spec_dataframe, region=[-125, -122, 47, 49], scale="2c", projection="M14c") - return fig @@ -93,11 +84,9 @@ def test_meca_spec_dataframe(): def test_meca_spec_1d_array(): """ Test supplying a 1D numpy array containing focal mechanisms and locations - to the `spec` argument. + to the spec parameter. """ - fig = Figure() - # supply focal mechanisms to meca as a 1D numpy array, here we are using # the Harvard CMT zero trace convention but the focal mechanism # parameters may be specified any of the available conventions. Since we @@ -118,7 +107,6 @@ def test_meca_spec_1d_array(): 0, # plot_lat, 0 to plot at event location ] focal_mech_array = np.asarray(focal_mechanism) - fig.meca( focal_mech_array, convention="mt", @@ -127,7 +115,6 @@ def test_meca_spec_1d_array(): scale="2c", projection="M14c", ) - return fig @@ -135,11 +122,9 @@ def test_meca_spec_1d_array(): def test_meca_spec_2d_array(): """ Test supplying a 2D numpy array containing focal mechanisms and locations - to the `spec` argument. + to the spec parameter. """ - fig = Figure() - # supply focal mechanisms to meca as a 2D numpy array, here we are using # the GCMT convention but the focal mechanism parameters may be # specified any of the available conventions. Since we are not using a @@ -163,7 +148,6 @@ def test_meca_spec_2d_array(): [-127.50, 40.88, 12.0, 168, 40, -115, 20, 54, -70, 4.0, 23, 0, 0], ] focal_mechs_array = np.asarray(focal_mechanisms) - fig.meca( focal_mechs_array, convention="gcmt", @@ -171,21 +155,18 @@ def test_meca_spec_2d_array(): scale="2c", projection="M14c", ) - return fig @pytest.mark.mpl_image_compare def test_meca_spec_file(): """ - Test supplying a file containing focal mechanisms and locations to the - `spec` argument. + Test supplying a file containing focal mechanisms and locations to the spec + parameter. """ fig = Figure() - focal_mechanism = [-127.43, 40.81, 12, -3.19, 1.16, 3.93, -1.02, -3.93, -1.02, 23] - # writes temp file to pass to gmt with GMTTempFile() as temp: with open(temp.name, mode="w") as temp_file: @@ -199,7 +180,6 @@ def test_meca_spec_file(): scale="2c", projection="M14c", ) - return fig @@ -209,22 +189,17 @@ def test_meca_loc_array(): Test supplying lists and np.ndarrays as the event location (longitude, latitude, and depth). """ - fig = Figure() - # specify focal mechanisms focal_mechanisms = dict( strike=[327, 350], dip=[41, 50], rake=[68, 90], magnitude=[3, 2] ) - # longitude, latitude, and depth may be specified as an int, float, # list, or 1d numpy array longitude = np.array([-123.3, -124.4]) latitude = np.array([48.4, 48.2]) depth = [12.0, 11.0] # to test mixed data types as inputs - scale = "2c" - fig.meca( focal_mechanisms, scale, @@ -234,5 +209,4 @@ def test_meca_loc_array(): region=[-125, -122, 47, 49], projection="M14c", ) - return fig