Code Duplication    Length = 21-21 lines in 2 locations

metpy/plots/tests/test_station_plot.py 2 locations

@@ 44-64 (lines=21) @@
41
    return fig
42
43
44
@pytest.mark.mpl_image_compare(tolerance={'1.5': 0.05974, '1.4': 3.7}.get(MPL_VERSION, 0.0033),
45
                               savefig_kwargs={'dpi': 300}, remove_text=True)
46
def test_station_plot_replace():
47
    """Test that locations are properly replaced."""
48
    fig = plt.figure(figsize=(3, 3))
49
50
    # testing data
51
    x = np.array([1])
52
    y = np.array([1])
53
54
    # Make the plot
55
    sp = StationPlot(fig.add_subplot(1, 1, 1), x, y, fontsize=16)
56
    sp.plot_barb([20], [0])
57
    sp.plot_barb([5], [0])
58
    sp.plot_parameter('NW', [10.5], color='red')
59
    sp.plot_parameter('NW', [20], color='blue')
60
61
    sp.ax.set_xlim(-3, 3)
62
    sp.ax.set_ylim(-3, 3)
63
64
    return fig
65
66
67
@pytest.mark.mpl_image_compare(tolerance={'1.5': 0.036, '1.4': 2.02}.get(MPL_VERSION, 0.00321),
@@ 21-41 (lines=21) @@
18
MPL_VERSION = matplotlib.__version__[:3]
19
20
21
@pytest.mark.mpl_image_compare(tolerance={'1.5': 0.04625, '1.4': 4.1}.get(MPL_VERSION, 0.0033),
22
                               savefig_kwargs={'dpi': 300}, remove_text=True)
23
def test_stationplot_api():
24
    """Test the StationPlot API."""
25
    fig = plt.figure(figsize=(9, 9))
26
27
    # testing data
28
    x = np.array([1, 5])
29
    y = np.array([2, 4])
30
31
    # Make the plot
32
    sp = StationPlot(fig.add_subplot(1, 1, 1), x, y, fontsize=16)
33
    sp.plot_barb([20, 0], [0, -50])
34
    sp.plot_text('E', ['KOKC', 'ICT'], color='blue')
35
    sp.plot_parameter('NW', [10.5, 15], color='red')
36
    sp.plot_symbol('S', [5, 7], high_clouds, color='green')
37
38
    sp.ax.set_xlim(0, 6)
39
    sp.ax.set_ylim(0, 6)
40
41
    return fig
42
43
44
@pytest.mark.mpl_image_compare(tolerance={'1.5': 0.05974, '1.4': 3.7}.get(MPL_VERSION, 0.0033),