Skip to content

Commit

Permalink
ENH: New baseline file updates and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamTheisen committed Feb 15, 2024
1 parent d2e2622 commit 41a40fc
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 5 deletions.
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_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_qc_flag_block_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_time_height_scatter.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_time_height_scatter2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 4 additions & 1 deletion 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 Down Expand Up @@ -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,11 +53,13 @@ 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


Expand Down
10 changes: 6 additions & 4 deletions tests/plotting/test_timeseriesdisplay.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ def test_barb_sounding_plot():
def test_time_height_scatter():
sonde_ds = act.io.arm.read_arm_netcdf(sample_files.EXAMPLE_SONDE1)

display = TimeSeriesDisplay({'sgpsondewnpnC1.b1': sonde_ds}, figsize=(7, 3))
display = TimeSeriesDisplay({'sgpsondewnpnC1.b1': sonde_ds}, figsize=(10, 6))
display.time_height_scatter('tdry', plot_alt_field=True)

sonde_ds.close()
Expand All @@ -216,7 +216,9 @@ def test_time_height_scatter():
def test_time_height_scatter2():
sonde_ds = act.io.arm.read_arm_netcdf(sample_files.EXAMPLE_SONDE1)

display = TimeSeriesDisplay({'sgpsondewnpnC1.b1': sonde_ds}, figsize=(7, 6), subplot_shape=(2,))
display = TimeSeriesDisplay(
{'sgpsondewnpnC1.b1': sonde_ds}, figsize=(8, 10), subplot_shape=(2,)
)
display.time_height_scatter(
'tdry', day_night_background=True, subplot_index=(0,), cb_friendly=True, plot_alt_field=True
)
Expand Down Expand Up @@ -303,7 +305,7 @@ def test_fill_between():
def test_qc_flag_block_plot():
ds = act.io.arm.read_arm_netcdf(sample_files.EXAMPLE_SURFSPECALB1MLAWER)

display = TimeSeriesDisplay(ds, subplot_shape=(2,), figsize=(8, 2 * 4))
display = TimeSeriesDisplay(ds, subplot_shape=(2,), figsize=(10, 8))

display.plot('surface_albedo_mfr_narrowband_10m', force_line_plot=True, labels=True)

Expand Down Expand Up @@ -626,7 +628,7 @@ def test_plot_time_rng():
def test_match_ylimits_plot():
files = sample_files.EXAMPLE_MET_WILDCARD
ds = act.io.arm.read_arm_netcdf(files)
display = act.plotting.TimeSeriesDisplay(ds, figsize=(10, 8), subplot_shape=(2, 2))
display = act.plotting.TimeSeriesDisplay(ds, figsize=(14, 8), subplot_shape=(2, 2))
groupby = display.group_by('day')
groupby.plot_group('plot', None, field='temp_mean', marker=' ')
groupby.display.set_yrng([-20, 20], match_axes_ylimits=True)
Expand Down

0 comments on commit 41a40fc

Please sign in to comment.