Skip to content

Commit

Permalink
ENH: Use arm-test-data repo for unit testing (#762)
Browse files Browse the repository at this point in the history
* ENH: Add pooch fetching to sample files.py

* MNT: Update all test cases for the new syntax.

* FIX: Fix for list appending, needed a copy.

* MNT: Removing added docstring at end.

* FIX: Fix missing doc dependency.

* FIX: Missing e13 files from met wildcard.

* FIX: Fix examples that are broken from syntax.

* FIX: Accidently removed part of a tests.
  • Loading branch information
zssherman authored Dec 1, 2023
1 parent d3a864e commit 0feedb9
Show file tree
Hide file tree
Showing 9 changed files with 148 additions and 86 deletions.
189 changes: 126 additions & 63 deletions act/tests/sample_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,68 +6,131 @@

import os

DATA_PATH = os.path.join(os.path.dirname(__file__), 'data')
from arm_test_data import DATASETS

EXAMPLE_MET1 = os.path.join(DATA_PATH, 'sgpmetE13.b1.20190101.000000.cdf')
EXAMPLE_MET_SAIL = os.path.join(DATA_PATH, 'gucmetM1.b1.20230301.000000.cdf')
EXAMPLE_MET_CSV = os.path.join(DATA_PATH, 'sgpmetE13.*csv')
EXAMPLE_METE40 = os.path.join(DATA_PATH, 'sgpmetE40.b1.20190508.000000.cdf')
EXAMPLE_CEIL1 = os.path.join(DATA_PATH, 'sgpceilC1.b1.20190101.000000.nc')
EXAMPLE_SONDE1 = os.path.join(DATA_PATH, 'sgpsondewnpnC1.b1.20190101.053200.cdf')
EXAMPLE_LCL1 = os.path.join(DATA_PATH, 'met_lcl.nc')
EXAMPLE_SONDE_WILDCARD = os.path.join(DATA_PATH, 'sgpsondewnpn*.cdf')
EXAMPLE_MET_WILDCARD = os.path.join(DATA_PATH, 'sgpmet*201901*.cdf')
EXAMPLE_MET_CONTOUR = os.path.join(DATA_PATH, 'sgpmet*20190508*.cdf')
EXAMPLE_CEIL_WILDCARD = os.path.join(DATA_PATH, 'sgpceil*.cdf')
EXAMPLE_TWP_SONDE_WILDCARD = os.path.join(DATA_PATH, 'twpsondewnpn*.cdf')
EXAMPLE_TWP_SONDE_20060121 = os.path.join(DATA_PATH, 'twpsondewnpn*20060121*.cdf')
EXAMPLE_ANL_CSV = os.path.join(DATA_PATH, 'anltwr_mar19met.data')
EXAMPLE_VISST = os.path.join(DATA_PATH, 'twpvisstgridirtemp.c1.20050705.002500.nc')
EXAMPLE_MPL_1SAMPLE = os.path.join(DATA_PATH, 'sgpmplpolfsC1.b1.20190502.000000.cdf')
EXAMPLE_IRT25m20s = os.path.join(DATA_PATH, 'sgpirt25m20sC1.a0.20190601.000000.cdf')
EXAMPLE_NAV = os.path.join(DATA_PATH, 'marnavM1.a1.20180201.000000.nc')
EXAMPLE_AOSMET = os.path.join(DATA_PATH, 'maraosmetM1.a1.20180201.000000.nc')
EXAMPLE_DLPPI = os.path.join(DATA_PATH, 'sgpdlppiC1.b1.20191015.120023.cdf')
EXAMPLE_DLPPI_MULTI = os.path.join(DATA_PATH, 'sgpdlppiC1.b1.20191015.*.cdf')
EXAMPLE_BRS = os.path.join(DATA_PATH, 'sgpbrsC1.b1.20190705.000000.cdf')
EXAMPLE_AERI = os.path.join(DATA_PATH, 'sgpaerich1C1.b1.20190501.000342.nc')
EXAMPLE_IRTSST = os.path.join(DATA_PATH, 'marirtsstM1.b1.20190320.000000.nc')
EXAMPLE_MFRSR = os.path.join(DATA_PATH, 'sgpmfrsr7nchE11.b1.20210329.070000.nc')
EXAMPLE_SURFSPECALB1MLAWER = os.path.join(
DATA_PATH, 'nsasurfspecalb1mlawerC1.c1.20160609.080000.nc'
# Single files
EXAMPLE_MET1 = DATASETS.fetch('sgpmetE13.b1.20190101.000000.cdf')
EXAMPLE_MET_SAIL = DATASETS.fetch('gucmetM1.b1.20230301.000000.cdf')
EXAMPLE_MET_CSV = DATASETS.fetch('sgpmetE13.b1.20210401.000000.csv')
EXAMPLE_METE40 = DATASETS.fetch('sgpmetE40.b1.20190508.000000.cdf')
EXAMPLE_CEIL1 = DATASETS.fetch('sgpceilC1.b1.20190101.000000.nc')
EXAMPLE_SONDE1 = DATASETS.fetch('sgpsondewnpnC1.b1.20190101.053200.cdf')
EXAMPLE_LCL1 = DATASETS.fetch('met_lcl.nc')
EXAMPLE_ANL_CSV = DATASETS.fetch('anltwr_mar19met.data')
EXAMPLE_VISST = DATASETS.fetch('twpvisstgridirtemp.c1.20050705.002500.nc')
EXAMPLE_MPL_1SAMPLE = DATASETS.fetch('sgpmplpolfsC1.b1.20190502.000000.cdf')
EXAMPLE_IRT25m20s = DATASETS.fetch('sgpirt25m20sC1.a0.20190601.000000.cdf')
EXAMPLE_NAV = DATASETS.fetch('marnavM1.a1.20180201.000000.nc')
EXAMPLE_AOSMET = DATASETS.fetch('maraosmetM1.a1.20180201.000000.nc')
EXAMPLE_DLPPI = DATASETS.fetch('sgpdlppiC1.b1.20191015.120023.cdf')
EXAMPLE_BRS = DATASETS.fetch('sgpbrsC1.b1.20190705.000000.cdf')
EXAMPLE_AERI = DATASETS.fetch('sgpaerich1C1.b1.20190501.000342.nc')
EXAMPLE_IRTSST = DATASETS.fetch('marirtsstM1.b1.20190320.000000.nc')
EXAMPLE_MFRSR = DATASETS.fetch('sgpmfrsr7nchE11.b1.20210329.070000.nc')
EXAMPLE_SURFSPECALB1MLAWER = DATASETS.fetch(
'nsasurfspecalb1mlawerC1.c1.20160609.080000.nc'
)
EXAMPLE_SIGMA_MPLV5 = os.path.join(DATA_PATH, '201509021500.bi')
EXAMPLE_RL1 = os.path.join(DATA_PATH, 'sgprlC1.a0.20160131.000000.nc')
EXAMPLE_CO2FLX4M = os.path.join(DATA_PATH, 'sgpco2flx4mC1.b1.20201007.001500.nc')
EXAMPLE_SIRS = os.path.join(DATA_PATH, 'sgpsirsE13.b1.20190101.000000.cdf')
EXAMPLE_GML_RADIATION = os.path.join(DATA_PATH, 'brw21001.dat')
EXAMPLE_GML_MET = os.path.join(DATA_PATH, 'met_brw_insitu_1_obop_hour_2020.txt')
EXAMPLE_GML_OZONE = os.path.join(DATA_PATH, 'brw_12_2020_hour.dat')
EXAMPLE_GML_CO2 = os.path.join(DATA_PATH, 'co2_brw_surface-insitu_1_ccgg_MonthlyData.txt')
EXAMPLE_GML_HALO = os.path.join(DATA_PATH, 'brw_CCl4_Day.dat')
EXAMPLE_MET_TEST1 = os.path.join(DATA_PATH, 'sgpmet_no_time.nc')
EXAMPLE_MET_TEST2 = os.path.join(DATA_PATH, 'sgpmet_test_time.nc')
EXAMPLE_STAMP_WILDCARD = os.path.join(DATA_PATH, 'sgpstamp*202001*.nc')
EXAMPLE_NOAA_PSL = os.path.join(DATA_PATH, 'ctd21125.15w')
EXAMPLE_NOAA_PSL_TEMPERATURE = os.path.join(DATA_PATH, 'ctd22187.00t.txt')
EXAMPLE_NOAA_PSL_SURFACEMET = [os.path.join(DATA_PATH, 'ayp22199.21m'), os.path.join(DATA_PATH, 'ayp22200.00m')]
EXAMPLE_SP2B = os.path.join(DATA_PATH, 'mosaossp2M1.00.20191216.130601.raw.20191216x193.sp2b')
EXAMPLE_INI = os.path.join(DATA_PATH, 'mosaossp2M1.00.20191216.000601.raw.20191216000000.ini')
EXAMPLE_HK = os.path.join(DATA_PATH, 'mosaossp2auxM1.00.20191217.010801.raw.20191216000000.hk')
EXAMPLE_MET_YAML = os.path.join(DATA_PATH, 'sgpmetE13.b1.yaml')
EXAMPLE_CLOUDPHASE = os.path.join(DATA_PATH, 'nsacloudphaseC1.c1.20180601.000000.nc')
EXAMPLE_AAF_ICARTT = os.path.join(DATA_PATH, 'AAFNAV_COR_20181104_R0.ict')
EXAMPLE_MMCR = os.path.join(DATA_PATH, 'sgpmmcrC1.b1.*.cdf')
EXAMPLE_NEON = os.path.join(DATA_PATH, 'NEON.D18.BARR.DP1.00002.001.000.010.001.SAAT_1min.2022-10.expanded.20221107T205629Z.csv')
EXAMPLE_NEON_VARIABLE = os.path.join(DATA_PATH, 'NEON.D18.BARR.DP1.00002.001.variables.20221201T110553Z.csv')
EXAMPLE_NEON_POSITION = os.path.join(DATA_PATH, 'NEON.D18.BARR.DP1.00002.001.sensor_positions.20221107T205629Z.csv')
EXAMPLE_DOD = os.path.join(DATA_PATH, 'vdis.b1')
EXAMPLE_EBBR1 = os.path.join(DATA_PATH, 'sgp30ebbrE32.b1.20191125.000000.nc')
EXAMPLE_EBBR2 = os.path.join(DATA_PATH, 'sgp30ebbrE32.b1.20191130.000000.nc')
EXAMPLE_EBBR3 = os.path.join(DATA_PATH, 'sgp30ebbrE13.b1.20190601.000000.nc')
EXAMPLE_ECOR = os.path.join(DATA_PATH, 'sgp30ecorE14.b1.20190601.000000.cdf')
EXAMPLE_SEBS = os.path.join(DATA_PATH, 'sgpsebsE14.b1.20190601.000000.cdf')
EXAMPLE_MFAS_SODAR = os.path.join(DATA_PATH, 'sodar.20230404.mnd')
EXAMPLE_ENA_MET = os.path.join(DATA_PATH, 'enametC1.b1.20221109.000000.cdf')
EXAMPLE_CCN = os.path.join(DATA_PATH, 'sgpaosccn2colaE13.b1.20170903.000000.nc')
EXAMPLE_OLD_QC = os.path.join(DATA_PATH, 'sgp30ecorE6.b1.20040705.000000.cdf')
EXAMPLE_SIGMA_MPLV5 = DATASETS.fetch('201509021500.bi')
EXAMPLE_RL1 = DATASETS.fetch('sgprlC1.a0.20160131.000000.nc')
EXAMPLE_CO2FLX4M = DATASETS.fetch('sgpco2flx4mC1.b1.20201007.001500.nc')
EXAMPLE_SIRS = DATASETS.fetch('sgpsirsE13.b1.20190101.000000.cdf')
EXAMPLE_GML_RADIATION = DATASETS.fetch('brw21001.dat')
EXAMPLE_GML_MET = DATASETS.fetch('met_brw_insitu_1_obop_hour_2020.txt')
EXAMPLE_GML_OZONE = DATASETS.fetch('brw_12_2020_hour.dat')
EXAMPLE_GML_CO2 = DATASETS.fetch('co2_brw_surface-insitu_1_ccgg_MonthlyData.txt')
EXAMPLE_GML_HALO = DATASETS.fetch('brw_CCl4_Day.dat')
EXAMPLE_MET_TEST1 = DATASETS.fetch('sgpmet_no_time.nc')
EXAMPLE_MET_TEST2 = DATASETS.fetch('sgpmet_test_time.nc')
EXAMPLE_NOAA_PSL = DATASETS.fetch('ctd21125.15w')
EXAMPLE_NOAA_PSL_TEMPERATURE = DATASETS.fetch('ctd22187.00t.txt')
EXAMPLE_SP2B = DATASETS.fetch('mosaossp2M1.00.20191216.130601.raw.20191216x193.sp2b')
EXAMPLE_INI = DATASETS.fetch('mosaossp2M1.00.20191216.000601.raw.20191216000000.ini')
EXAMPLE_HK = DATASETS.fetch('mosaossp2auxM1.00.20191217.010801.raw.20191216000000.hk')
EXAMPLE_MET_YAML = DATASETS.fetch('sgpmetE13.b1.yaml')
EXAMPLE_CLOUDPHASE = DATASETS.fetch('nsacloudphaseC1.c1.20180601.000000.nc')
EXAMPLE_AAF_ICARTT = DATASETS.fetch('AAFNAV_COR_20181104_R0.ict')
EXAMPLE_NEON = DATASETS.fetch('NEON.D18.BARR.DP1.00002.001.000.010.001.SAAT_1min.2022-10.expanded.20221107T205629Z.csv')
EXAMPLE_NEON_VARIABLE = DATASETS.fetch('NEON.D18.BARR.DP1.00002.001.variables.20221201T110553Z.csv')
EXAMPLE_NEON_POSITION = DATASETS.fetch('NEON.D18.BARR.DP1.00002.001.sensor_positions.20221107T205629Z.csv')
EXAMPLE_DOD = DATASETS.fetch('vdis.b1')
EXAMPLE_EBBR1 = DATASETS.fetch('sgp30ebbrE32.b1.20191125.000000.nc')
EXAMPLE_EBBR2 = DATASETS.fetch('sgp30ebbrE32.b1.20191130.000000.nc')
EXAMPLE_EBBR3 = DATASETS.fetch('sgp30ebbrE13.b1.20190601.000000.nc')
EXAMPLE_ECOR = DATASETS.fetch('sgp30ecorE14.b1.20190601.000000.cdf')
EXAMPLE_SEBS = DATASETS.fetch('sgpsebsE14.b1.20190601.000000.cdf')
EXAMPLE_MFAS_SODAR = DATASETS.fetch('sodar.20230404.mnd')
EXAMPLE_ENA_MET = DATASETS.fetch('enametC1.b1.20221109.000000.cdf')
EXAMPLE_CCN = DATASETS.fetch('sgpaosccn2colaE13.b1.20170903.000000.nc')
EXAMPLE_OLD_QC = DATASETS.fetch('sgp30ecorE6.b1.20040705.000000.cdf')
EXAMPLE_SONDE_WILDCARD = DATASETS.fetch('sgpsondewnpnC1.b1.20190101.053200.cdf')
EXAMPLE_CEIL_WILDCARD = DATASETS.fetch('sgpceilC1.b1.20190101.000000.nc')

# Multiple files in a list
dlppi_multi_list = ['sgpdlppiC1.b1.20191015.120023.cdf',
'sgpdlppiC1.b1.20191015.121506.cdf']
EXAMPLE_DLPPI_MULTI = [DATASETS.fetch(file) for file in dlppi_multi_list]
noaa_psl_list = ['ayp22199.21m',
'ayp22200.00m']
EXAMPLE_NOAA_PSL_SURFACEMET = [DATASETS.fetch(file) for file in noaa_psl_list]
met_wildcard_list = ['sgpmetE13.b1.20190101.000000.cdf',
'sgpmetE13.b1.20190102.000000.cdf',
'sgpmetE13.b1.20190103.000000.cdf',
'sgpmetE13.b1.20190104.000000.cdf',
'sgpmetE13.b1.20190105.000000.cdf',
'sgpmetE13.b1.20190106.000000.cdf',
'sgpmetE13.b1.20190107.000000.cdf']
EXAMPLE_MET_WILDCARD = [DATASETS.fetch(file) for file in met_wildcard_list]
met_contour_list = ['sgpmetE15.b1.20190508.000000.cdf',
'sgpmetE31.b1.20190508.000000.cdf',
'sgpmetE32.b1.20190508.000000.cdf',
'sgpmetE33.b1.20190508.000000.cdf',
'sgpmetE34.b1.20190508.000000.cdf',
'sgpmetE35.b1.20190508.000000.cdf',
'sgpmetE36.b1.20190508.000000.cdf',
'sgpmetE37.b1.20190508.000000.cdf',
'sgpmetE38.b1.20190508.000000.cdf',
'sgpmetE39.b1.20190508.000000.cdf',
'sgpmetE40.b1.20190508.000000.cdf',
'sgpmetE9.b1.20190508.000000.cdf',
'sgpmetE13.b1.20190508.000000.cdf']
EXAMPLE_MET_CONTOUR = [DATASETS.fetch(file) for file in met_contour_list]
twp_sonde_wildcard_list = ['twpsondewnpnC3.b1.20060119.050300.custom.cdf',
'twpsondewnpnC3.b1.20060119.112000.custom.cdf',
'twpsondewnpnC3.b1.20060119.163300.custom.cdf',
'twpsondewnpnC3.b1.20060119.231600.custom.cdf',
'twpsondewnpnC3.b1.20060120.043800.custom.cdf',
'twpsondewnpnC3.b1.20060120.111900.custom.cdf',
'twpsondewnpnC3.b1.20060120.170800.custom.cdf',
'twpsondewnpnC3.b1.20060120.231500.custom.cdf',
'twpsondewnpnC3.b1.20060121.051500.custom.cdf',
'twpsondewnpnC3.b1.20060121.111600.custom.cdf',
'twpsondewnpnC3.b1.20060121.171600.custom.cdf',
'twpsondewnpnC3.b1.20060121.231600.custom.cdf',
'twpsondewnpnC3.b1.20060122.052600.custom.cdf',
'twpsondewnpnC3.b1.20060122.111500.custom.cdf',
'twpsondewnpnC3.b1.20060122.171800.custom.cdf',
'twpsondewnpnC3.b1.20060122.232600.custom.cdf',
'twpsondewnpnC3.b1.20060123.052500.custom.cdf',
'twpsondewnpnC3.b1.20060123.111700.custom.cdf',
'twpsondewnpnC3.b1.20060123.171600.custom.cdf',
'twpsondewnpnC3.b1.20060123.231500.custom.cdf',
'twpsondewnpnC3.b1.20060124.051500.custom.cdf',
'twpsondewnpnC3.b1.20060124.111800.custom.cdf',
'twpsondewnpnC3.b1.20060124.171700.custom.cdf',
'twpsondewnpnC3.b1.20060124.231500.custom.cdf']
EXAMPLE_TWP_SONDE_WILDCARD = [DATASETS.fetch(file) for file in twp_sonde_wildcard_list]
twp_sonde_20060121_list = ['twpsondewnpnC3.b1.20060121.051500.custom.cdf',
'twpsondewnpnC3.b1.20060121.111600.custom.cdf',
'twpsondewnpnC3.b1.20060121.171600.custom.cdf',
'twpsondewnpnC3.b1.20060121.231600.custom.cdf']
EXAMPLE_TWP_SONDE_20060121 = [DATASETS.fetch(file) for file in twp_sonde_20060121_list]
stamp_wildcard_list = ['sgpstampE13.b1.20200101.000000.nc',
'sgpstampE31.b1.20200101.000000.nc',
'sgpstampE32.b1.20200101.000000.nc',
'sgpstampE33.b1.20200101.000000.nc',
'sgpstampE34.b1.20200101.000000.nc',
'sgpstampE9.b1.20200101.000000.nc']
EXAMPLE_STAMP_WILDCARD = [DATASETS.fetch(file) for file in stamp_wildcard_list]
mmcr_list = ['sgpmmcrC1.b1.1.cdf',
'sgpmmcrC1.b1.2.cdf']
EXAMPLE_MMCR = [DATASETS.fetch(file) for file in mmcr_list]
11 changes: 4 additions & 7 deletions act/tests/test_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,7 @@ def test_keep_variables():
assert list(ds.data_vars).sort() == var_names.sort()
del ds

filenames = Path(act.tests.EXAMPLE_MET_WILDCARD).parent
filenames = list(filenames.glob(Path(act.tests.EXAMPLE_MET_WILDCARD).name))
filenames = list(Path(file) for file in act.tests.EXAMPLE_MET_WILDCARD)
var_names = ['temp_mean', 'qc_temp_mean', 'alt', 'lat', 'lon']
ds = act.io.arm.read_arm_netcdf(filenames, keep_variables=var_names)
assert list(ds.data_vars).sort() == var_names.sort()
Expand Down Expand Up @@ -794,8 +793,7 @@ def test_gunzip():
def test_read_netcdf_tarfiles():

with tempfile.TemporaryDirectory() as tmpdirname:
met_files = Path(act.tests.EXAMPLE_MET_WILDCARD)
met_files = list(Path(met_files.parent).glob(met_files.name))
met_files = list(Path(file) for file in act.tests.EXAMPLE_MET_WILDCARD)
filename = act.utils.io_utils.pack_tar(met_files, write_directory=tmpdirname)
ds = act.io.arm.read_arm_netcdf(filename)
ds.clean.cleanup()
Expand All @@ -805,8 +803,7 @@ def test_read_netcdf_tarfiles():

def test_read_netcdf_gztarfiles():
with tempfile.TemporaryDirectory() as tmpdirname:
met_files = Path(act.tests.EXAMPLE_MET_WILDCARD)
met_files = list(Path(met_files.parent).glob(met_files.name))
met_files = list(Path(file) for file in act.tests.EXAMPLE_MET_WILDCARD)
filename = act.utils.io_utils.pack_tar(met_files, write_directory=tmpdirname)
filename = act.utils.io_utils.pack_gzip(filename, write_directory=tmpdirname, remove=True)
ds = act.io.arm.read_arm_netcdf(filename)
Expand All @@ -824,7 +821,7 @@ def test_read_netcdf_gztarfiles():


def test_read_mmcr():
results = glob.glob(act.tests.EXAMPLE_MMCR)
results = act.tests.EXAMPLE_MMCR
ds = act.io.arm.read_arm_mmcr(results)
assert 'MeanDopplerVelocity_PR' in ds
assert 'SpectralWidth_BL' in ds
Expand Down
16 changes: 8 additions & 8 deletions act/tests/test_plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ def test_skewt_plot_spd_dir():

@pytest.mark.mpl_image_compare(tolerance=81)
def test_multi_skewt_plot():
files = glob.glob(sample_files.EXAMPLE_TWP_SONDE_20060121)
files = sample_files.EXAMPLE_TWP_SONDE_20060121
test = {}
for f in files:
time = f.split('.')[-3]
Expand Down Expand Up @@ -603,7 +603,7 @@ def test_size_distribution():

@pytest.mark.mpl_image_compare(tolerance=30)
def test_contour():
files = glob.glob(sample_files.EXAMPLE_MET_CONTOUR)
files = sample_files.EXAMPLE_MET_CONTOUR
time = '2019-05-08T04:00:00.000000000'
data = {}
fields = {}
Expand Down Expand Up @@ -631,7 +631,7 @@ def test_contour():

@pytest.mark.mpl_image_compare(tolerance=30)
def test_contour_stamp():
files = glob.glob(sample_files.EXAMPLE_STAMP_WILDCARD)
files = sample_files.EXAMPLE_STAMP_WILDCARD
test = {}
stamp_fields = {}
time = '2020-01-01T00:00:00.000000000'
Expand All @@ -653,7 +653,7 @@ def test_contour_stamp():

@pytest.mark.mpl_image_compare(tolerance=30)
def test_contour2():
files = glob.glob(sample_files.EXAMPLE_MET_CONTOUR)
files = sample_files.EXAMPLE_MET_CONTOUR
time = '2019-05-08T04:00:00.000000000'
data = {}
fields = {}
Expand Down Expand Up @@ -681,7 +681,7 @@ def test_contour2():

@pytest.mark.mpl_image_compare(tolerance=30)
def test_contourf():
files = glob.glob(sample_files.EXAMPLE_MET_CONTOUR)
files = sample_files.EXAMPLE_MET_CONTOUR
time = '2019-05-08T04:00:00.000000000'
data = {}
fields = {}
Expand Down Expand Up @@ -721,7 +721,7 @@ def test_contourf():

@pytest.mark.mpl_image_compare(tolerance=30)
def test_contourf2():
files = glob.glob(sample_files.EXAMPLE_MET_CONTOUR)
files = sample_files.EXAMPLE_MET_CONTOUR
time = '2019-05-08T04:00:00.000000000'
data = {}
fields = {}
Expand Down Expand Up @@ -1031,7 +1031,7 @@ def test_colorbar_labels():

@pytest.mark.mpl_image_compare(tolerance=30)
def test_plot_datarose():
files = glob.glob(sample_files.EXAMPLE_MET_WILDCARD)
files = sample_files.EXAMPLE_MET_WILDCARD
ds = act.io.arm.read_arm_netcdf(files)
display = act.plotting.WindRoseDisplay(ds, subplot_shape=(2, 3), figsize=(16, 10))
display.plot_data(
Expand Down Expand Up @@ -1208,7 +1208,7 @@ def test_groupby_plot():

@pytest.mark.mpl_image_compare(tolerance=30)
def test_match_ylimits_plot():
files = glob.glob(sample_files.EXAMPLE_MET_WILDCARD)
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))
groupby = display.group_by('day')
Expand Down
9 changes: 5 additions & 4 deletions act/tests/test_retrievals.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,9 @@ def test_calculate_sirs_variable():


def test_calculate_pbl_liu_liang():
files = glob.glob(act.tests.sample_files.EXAMPLE_TWP_SONDE_20060121)
files2 = glob.glob(act.tests.sample_files.EXAMPLE_SONDE1)
files += files2
files = act.tests.sample_files.EXAMPLE_TWP_SONDE_20060121.copy()
files2 = act.tests.sample_files.EXAMPLE_SONDE1
files.append(files2)
files.sort()

pblht = []
Expand Down Expand Up @@ -237,7 +237,8 @@ def test_calculate_pbl_liu_liang():


def test_calculate_heffter_pbl():
files = sorted(glob.glob(act.tests.sample_files.EXAMPLE_TWP_SONDE_20060121))
files = act.tests.sample_files.EXAMPLE_TWP_SONDE_20060121.copy()
files.sort()
ds = act.io.arm.read_arm_netcdf(files[2])
ds['tdry'].attrs['units'] = 'degree_Celsius'
ds = act.retrievals.sonde.calculate_pbl_heffter(ds)
Expand Down
1 change: 1 addition & 0 deletions continuous_integration/environment_actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ dependencies:
- pip
- lazy_loader
- cmweather
- arm-test-data
- pip:
- mpl2nc
- metpy
Expand Down
1 change: 1 addition & 0 deletions docs/environment_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ dependencies:
- scikit-posthocs
- pip
- shapely<1.8.3
- arm-test-data
- pip:
- mpl2nc
- lazy_loader
Expand Down
2 changes: 1 addition & 1 deletion examples/plotting/plot_contour.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

import act

files = glob.glob(act.tests.sample_files.EXAMPLE_MET_CONTOUR)
files = act.tests.sample_files.EXAMPLE_MET_CONTOUR
time = '2019-05-08T04:00:00.000000000'
data = {}
fields = {}
Expand Down
2 changes: 1 addition & 1 deletion examples/plotting/plot_skewt_with_text.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
xr.set_options(keep_attrs=True)

# Read data
file = sorted(glob.glob(act.tests.sample_files.EXAMPLE_TWP_SONDE_20060121))[-1]
file = sorted(act.tests.sample_files.EXAMPLE_TWP_SONDE_20060121)[-1]
sonde_ds = act.io.arm.read_arm_netcdf(file)


Expand Down
3 changes: 1 addition & 2 deletions examples/utils/plot_tar.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@
# TAR file into read_arm_netcdf() to be unpacked and read.

# Here we get a list of MET data files to pack into a TAR bundle
met_files = Path(EXAMPLE_MET_WILDCARD)
met_files = list(Path(met_files.parent).glob(met_files.name))
met_files = list(Path(file) for file in EXAMPLE_MET_WILDCARD)

# We can pass the list of netCDF data files to the pack_tar() function.
# Notice that the new_dir directory does not exist. The directory will
Expand Down

0 comments on commit 0feedb9

Please sign in to comment.