Skip to content

Commit

Permalink
ENH: New baseline images and updates to plot test tolerances (#801)
Browse files Browse the repository at this point in the history
* ENH: New baseline images and updates to plot test tolerances

* ENH: ruff updates

* ENH: Updating tolerance to 20 for test_xsection_plot

* ENH: New baseline file updates and tests
  • Loading branch information
AdamTheisen authored Feb 16, 2024
1 parent 707c3bc commit c15802b
Show file tree
Hide file tree
Showing 65 changed files with 68 additions and 63 deletions.
Binary file modified tests/plotting/baseline/test_2D_timeseries_plot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/plotting/baseline/test_2d_as_1d.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/plotting/baseline/test_add_nan_line.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/plotting/baseline/test_assessment_overplot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/plotting/baseline/test_assessment_overplot_multi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/plotting/baseline/test_barb_sounding_plot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/plotting/baseline/test_colorbar_labels.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/plotting/baseline/test_contour.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/plotting/baseline/test_contour2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/plotting/baseline/test_contour_stamp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/plotting/baseline/test_contourf.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/plotting/baseline/test_contourf2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/plotting/baseline/test_enhanced_skewt_plot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/plotting/baseline/test_enhanced_skewt_plot_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/plotting/baseline/test_fill_between.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/plotting/baseline/test_geoplot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/plotting/baseline/test_geoplot_tile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/plotting/baseline/test_groupby_plot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/plotting/baseline/test_heatmap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/plotting/baseline/test_heatmap2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/plotting/baseline/test_heatmap3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/plotting/baseline/test_match_ylimits_plot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/plotting/baseline/test_multi_skewt_plot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/plotting/baseline/test_multidataset_plot_dict.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/plotting/baseline/test_multidataset_plot_tuple.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/plotting/baseline/test_plot.png
Binary file modified tests/plotting/baseline/test_plot_barbs_from_u_v.png
Binary file modified tests/plotting/baseline/test_plot_barbs_from_u_v2.png
Binary file modified tests/plotting/baseline/test_plot_datarose.png
Binary file modified tests/plotting/baseline/test_qc_bar_plot.png
Binary file modified tests/plotting/baseline/test_qc_flag_block_plot.png
Binary file modified tests/plotting/baseline/test_scatter.png
Binary file modified tests/plotting/baseline/test_scatter2.png
Binary file modified tests/plotting/baseline/test_size_distribution.png
Binary file modified tests/plotting/baseline/test_size_distribution2.png
Binary file modified tests/plotting/baseline/test_skewt_options.png
Binary file modified tests/plotting/baseline/test_skewt_plot.png
Binary file modified tests/plotting/baseline/test_skewt_plot_spd_dir.png
Binary file modified tests/plotting/baseline/test_stacked_bar_graph.png
Binary file modified tests/plotting/baseline/test_stacked_bar_graph2.png
Binary file modified tests/plotting/baseline/test_stacked_bar_graph3.png
Binary file modified tests/plotting/baseline/test_stacked_bar_graph_sorted.png
Binary file modified tests/plotting/baseline/test_stair_graph.png
Binary file modified tests/plotting/baseline/test_stair_graph2.png
Binary file modified tests/plotting/baseline/test_stair_graph_sorted.png
Binary file modified tests/plotting/baseline/test_time_height_scatter.png
Binary file modified tests/plotting/baseline/test_time_height_scatter2.png
Binary file modified tests/plotting/baseline/test_time_plot.png
Binary file modified tests/plotting/baseline/test_time_plot2.png
Binary file modified tests/plotting/baseline/test_time_plot_match_color_ylabel.png
Binary file modified tests/plotting/baseline/test_timeseries_invert.png
Binary file modified tests/plotting/baseline/test_violin.png
Binary file modified tests/plotting/baseline/test_violin2.png
Binary file modified tests/plotting/baseline/test_wind_rose.png
Binary file modified tests/plotting/baseline/test_xlim_correction_plot.png
Binary file modified tests/plotting/baseline/test_xsection_plot.png
Binary file modified tests/plotting/baseline/test_xsection_plot_map.png
Binary file modified tests/plotting/baseline/test_y_axis_flag_meanings.png
10 changes: 5 additions & 5 deletions tests/plotting/test_contourdisplay.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
matplotlib.use('Agg')


@pytest.mark.mpl_image_compare(tolerance=30)
@pytest.mark.mpl_image_compare(tolerance=10)
def test_contour():
files = sample_files.EXAMPLE_MET_CONTOUR
time = '2019-05-08T04:00:00.000000000'
Expand Down Expand Up @@ -36,7 +36,7 @@ def test_contour():
matplotlib.pyplot.close(display.fig)


@pytest.mark.mpl_image_compare(tolerance=30)
@pytest.mark.mpl_image_compare(tolerance=10)
def test_contour_stamp():
files = sample_files.EXAMPLE_STAMP_WILDCARD
test = {}
Expand All @@ -58,7 +58,7 @@ def test_contour_stamp():
matplotlib.pyplot.close(display.fig)


@pytest.mark.mpl_image_compare(tolerance=30)
@pytest.mark.mpl_image_compare(tolerance=10)
def test_contour2():
files = sample_files.EXAMPLE_MET_CONTOUR
time = '2019-05-08T04:00:00.000000000'
Expand Down Expand Up @@ -86,7 +86,7 @@ def test_contour2():
matplotlib.pyplot.close(display.fig)


@pytest.mark.mpl_image_compare(tolerance=30)
@pytest.mark.mpl_image_compare(tolerance=10)
def test_contourf():
files = sample_files.EXAMPLE_MET_CONTOUR
time = '2019-05-08T04:00:00.000000000'
Expand Down Expand Up @@ -126,7 +126,7 @@ def test_contourf():
matplotlib.pyplot.close(display.fig)


@pytest.mark.mpl_image_compare(tolerance=30)
@pytest.mark.mpl_image_compare(tolerance=10)
def test_contourf2():
files = sample_files.EXAMPLE_MET_CONTOUR
time = '2019-05-08T04:00:00.000000000'
Expand Down
32 changes: 16 additions & 16 deletions tests/plotting/test_distributiondisplay.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def test_distribution_errors():
matplotlib.pyplot.close(fig=histdisplay.fig)


@pytest.mark.mpl_image_compare(tolerance=30)
@pytest.mark.mpl_image_compare(tolerance=10)
def test_stair_graph():
sonde_ds = act.io.arm.read_arm_netcdf(sample_files.EXAMPLE_SONDE1)

Expand All @@ -94,7 +94,7 @@ def test_stair_graph():
matplotlib.pyplot.close(histdisplay.fig)


@pytest.mark.mpl_image_compare(tolerance=30)
@pytest.mark.mpl_image_compare(tolerance=10)
def test_stair_graph2():
sonde_ds = act.io.arm.read_arm_netcdf(sample_files.EXAMPLE_SONDE1)
del sonde_ds['tdry'].attrs['units']
Expand All @@ -109,7 +109,7 @@ def test_stair_graph2():
matplotlib.pyplot.close(histdisplay.fig)


@pytest.mark.mpl_image_compare(tolerance=30)
@pytest.mark.mpl_image_compare(tolerance=10)
def test_stair_graph_sorted():
sonde_ds = act.io.arm.read_arm_netcdf(sample_files.EXAMPLE_SONDE1)

Expand All @@ -128,7 +128,7 @@ def test_stair_graph_sorted():
matplotlib.pyplot.close(histdisplay.fig)


@pytest.mark.mpl_image_compare(tolerance=30)
@pytest.mark.mpl_image_compare(tolerance=10)
def test_stacked_bar_graph():
sonde_ds = act.io.arm.read_arm_netcdf(sample_files.EXAMPLE_SONDE1)

Expand All @@ -142,7 +142,7 @@ def test_stacked_bar_graph():
matplotlib.pyplot.close(histdisplay.fig)


@pytest.mark.mpl_image_compare(tolerance=30)
@pytest.mark.mpl_image_compare(tolerance=10)
def test_stacked_bar_graph2():
sonde_ds = act.io.arm.read_arm_netcdf(sample_files.EXAMPLE_SONDE1)

Expand All @@ -158,7 +158,7 @@ def test_stacked_bar_graph2():
matplotlib.pyplot.close(histdisplay.fig)


@pytest.mark.mpl_image_compare(tolerance=30)
@pytest.mark.mpl_image_compare(tolerance=10)
def test_stacked_bar_graph3():
sonde_ds = act.io.arm.read_arm_netcdf(sample_files.EXAMPLE_SONDE1)
del sonde_ds['tdry'].attrs['units']
Expand All @@ -173,7 +173,7 @@ def test_stacked_bar_graph3():
matplotlib.pyplot.close(histdisplay.fig)


@pytest.mark.mpl_image_compare(tolerance=30)
@pytest.mark.mpl_image_compare(tolerance=10)
def test_stacked_bar_graph_sorted():
sonde_ds = act.io.arm.read_arm_netcdf(sample_files.EXAMPLE_SONDE1)

Expand All @@ -192,7 +192,7 @@ def test_stacked_bar_graph_sorted():
matplotlib.pyplot.close(histdisplay.fig)


@pytest.mark.mpl_image_compare(tolerance=30)
@pytest.mark.mpl_image_compare(tolerance=10)
def test_heatmap():
sonde_ds = act.io.arm.read_arm_netcdf(sample_files.EXAMPLE_SONDE1)

Expand All @@ -212,7 +212,7 @@ def test_heatmap():
matplotlib.pyplot.close(histdisplay.fig)


@pytest.mark.mpl_image_compare(tolerance=30)
@pytest.mark.mpl_image_compare(tolerance=10)
def test_heatmap2():
sonde_ds = act.io.arm.read_arm_netcdf(sample_files.EXAMPLE_SONDE1)
del sonde_ds['tdry'].attrs['units']
Expand All @@ -233,7 +233,7 @@ def test_heatmap2():
matplotlib.pyplot.close(histdisplay.fig)


@pytest.mark.mpl_image_compare(tolerance=30)
@pytest.mark.mpl_image_compare(tolerance=10)
def test_heatmap3():
sonde_ds = act.io.arm.read_arm_netcdf(sample_files.EXAMPLE_SONDE1)
del sonde_ds['tdry'].attrs['units']
Expand All @@ -253,7 +253,7 @@ def test_heatmap3():
matplotlib.pyplot.close(histdisplay.fig)


@pytest.mark.mpl_image_compare(tolerance=30)
@pytest.mark.mpl_image_compare(tolerance=10)
def test_size_distribution():
sigma = 10
mu = 50
Expand All @@ -270,7 +270,7 @@ def test_size_distribution():
matplotlib.pyplot.close(histdisplay.fig)


@pytest.mark.mpl_image_compare(tolerance=30)
@pytest.mark.mpl_image_compare(tolerance=10)
def test_size_distribution2():
sigma = 10
mu = 50
Expand Down Expand Up @@ -334,7 +334,7 @@ def test_histogram_kwargs():
matplotlib.pyplot.close(fig=histdisplay.fig)


@pytest.mark.mpl_image_compare(tolerance=30)
@pytest.mark.mpl_image_compare(tolerance=10)
def test_violin():
ds = act.io.arm.read_arm_netcdf(sample_files.EXAMPLE_MET1)

Expand All @@ -352,7 +352,7 @@ def test_violin():
matplotlib.pyplot.close(display.fig)


@pytest.mark.mpl_image_compare(tolerance=30)
@pytest.mark.mpl_image_compare(tolerance=10)
def test_violin2():
ds = act.io.arm.read_arm_netcdf(sample_files.EXAMPLE_MET1)
del ds['temp_mean'].attrs['units']
Expand All @@ -371,7 +371,7 @@ def test_violin2():
matplotlib.pyplot.close(display.fig)


@pytest.mark.mpl_image_compare(tolerance=30)
@pytest.mark.mpl_image_compare(tolerance=10)
def test_scatter():
ds = act.io.arm.read_arm_netcdf(sample_files.EXAMPLE_MET1)
# Create a DistributionDisplay object to compare fields
Expand All @@ -394,7 +394,7 @@ def test_scatter():
matplotlib.pyplot.close(display.fig)


@pytest.mark.mpl_image_compare(tolerance=30)
@pytest.mark.mpl_image_compare(tolerance=10)
def test_scatter2():
ds = act.io.arm.read_arm_netcdf(sample_files.EXAMPLE_MET1)
del ds['wspd_arith_mean'].attrs['units']
Expand Down
4 changes: 2 additions & 2 deletions tests/plotting/test_geodisplay.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


@pytest.mark.skipif(not CARTOPY_AVAILABLE, reason='Cartopy is not installed.')
@pytest.mark.mpl_image_compare(style='default', tolerance=30)
@pytest.mark.mpl_image_compare(style='default', tolerance=10)
def test_geoplot():
sonde_ds = act.io.arm.read_arm_netcdf(sample_files.EXAMPLE_SONDE1)
geodisplay = GeographicPlotDisplay({'sgpsondewnpnC1.b1': sonde_ds}, figsize=(15, 8))
Expand Down Expand Up @@ -46,7 +46,7 @@ def test_geoplot():


@pytest.mark.skipif(not CARTOPY_AVAILABLE, reason='Cartopy is not installed.')
@pytest.mark.mpl_image_compare(style='default', tolerance=30)
@pytest.mark.mpl_image_compare(style='default', tolerance=10)
def test_geoplot_tile():
sonde_ds = act.io.arm.read_arm_netcdf(sample_files.EXAMPLE_SONDE1)
geodisplay = GeographicPlotDisplay({'sgpsondewnpnC1.b1': sonde_ds}, figsize=(15, 8))
Expand Down
17 changes: 10 additions & 7 deletions tests/plotting/test_skewtdisplay.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import pytest

Expand All @@ -9,7 +10,7 @@
matplotlib.use('Agg')


@pytest.mark.mpl_image_compare(tolerance=30)
@pytest.mark.mpl_image_compare(tolerance=10)
def test_skewt_plot():
sonde_ds = act.io.arm.read_arm_netcdf(sample_files.EXAMPLE_SONDE1)
skewt = SkewTDisplay(sonde_ds)
Expand All @@ -18,7 +19,7 @@ def test_skewt_plot():
return skewt.fig


@pytest.mark.mpl_image_compare(tolerance=30)
@pytest.mark.mpl_image_compare(tolerance=10)
def test_skewt_plot_spd_dir():
sonde_ds = act.io.arm.read_arm_netcdf(sample_files.EXAMPLE_SONDE1)
skewt = SkewTDisplay(sonde_ds, ds_name='act_datastream')
Expand All @@ -27,7 +28,7 @@ def test_skewt_plot_spd_dir():
return skewt.fig


@pytest.mark.mpl_image_compare(tolerance=81)
@pytest.mark.mpl_image_compare(tolerance=10)
def test_multi_skewt_plot():
files = sample_files.EXAMPLE_TWP_SONDE_20060121
test = {}
Expand All @@ -37,7 +38,7 @@ def test_multi_skewt_plot():
sonde_ds = sonde_ds.resample(time='30s').nearest()
test.update({time: sonde_ds})

skewt = SkewTDisplay(test, subplot_shape=(2, 2))
skewt = SkewTDisplay(test, subplot_shape=(2, 2), figsize=(12, 14))
i = 0
j = 0
for f in files:
Expand All @@ -52,15 +53,17 @@ def test_multi_skewt_plot():
dsname=time,
p_levels_to_plot=np.arange(10.0, 1000.0, 25),
)
skewt.axes[j, i].set_ylim([1000, 10])
if j == 1:
i += 1
j = 0
elif j == 0:
j += 1
plt.tight_layout()
return skewt.fig


@pytest.mark.mpl_image_compare(tolerance=30)
@pytest.mark.mpl_image_compare(tolerance=10)
def test_enhanced_skewt_plot():
ds = act.io.arm.read_arm_netcdf(sample_files.EXAMPLE_SONDE1)
display = act.plotting.SkewTDisplay(ds)
Expand All @@ -69,7 +72,7 @@ def test_enhanced_skewt_plot():
return display.fig


@pytest.mark.mpl_image_compare(tolerance=30)
@pytest.mark.mpl_image_compare(tolerance=10)
def test_enhanced_skewt_plot_2():
ds = act.io.arm.read_arm_netcdf(sample_files.EXAMPLE_SONDE1)
display = act.plotting.SkewTDisplay(ds)
Expand All @@ -87,7 +90,7 @@ def test_enhanced_skewt_plot_2():
return display.fig


@pytest.mark.mpl_image_compare(tolerance=30)
@pytest.mark.mpl_image_compare(tolerance=10)
def test_skewt_options():
sonde_ds = act.io.arm.read_arm_netcdf(sample_files.EXAMPLE_SONDE1)
skewt = SkewTDisplay(sonde_ds)
Expand Down
Loading

0 comments on commit c15802b

Please sign in to comment.