Skip to content

Commit

Permalink
Merge pull request #11 from metno/10-update-aeronetsunreader-with-lat…
Browse files Browse the repository at this point in the history
…er-pyaro-developments

update aeronetsunreader with later pyaro developments
  • Loading branch information
jgriesfeller authored Dec 7, 2023
2 parents 1f8fccb + 8c478bb commit 0ac1614
Showing 1 changed file with 21 additions and 5 deletions.
26 changes: 21 additions & 5 deletions tests/test_AERONETTimeSeriesReader.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@ class TestAERONETTimeSeriesReader(unittest.TestCase):

def test_dl_data_unzipped(self):
engine = pyaro.list_timeseries_engines()["aeronetsunreader"]
with engine.open(TEST_URL, filters=[], fill_country_flag=False, tqdm_desc="test_dl_data_unzipped") as ts:
with engine.open(
TEST_URL,
filters=[],
fill_country_flag=False,
tqdm_desc="test_dl_data_unzipped",
) as ts:
count = 0
for var in ts.variables():
count += len(ts.data(var))
Expand All @@ -29,7 +34,12 @@ def test_dl_data_unzipped(self):

def test_dl_data_zipped(self):
engine = pyaro.list_timeseries_engines()["aeronetsunreader"]
with engine.open(TEST_ZIP_URL, filters=[], fill_country_flag=False, tqdm_desc="test_dl_data_zipped") as ts:
with engine.open(
TEST_ZIP_URL,
filters=[],
fill_country_flag=False,
tqdm_desc="test_dl_data_zipped",
) as ts:
count = 0
for var in ts.variables():
count += len(ts.data(var))
Expand All @@ -42,7 +52,9 @@ def test_init(self):
# just see that it doesn't fail
engine.description()
engine.args()
with engine.open(self.file, filters=[], fill_country_flag=True, tqdm_desc="test_init") as ts:
with engine.open(
self.file, filters=[], fill_country_flag=True, tqdm_desc="test_init"
) as ts:
count = 0
for var in ts.variables():
count += len(ts.data(var))
Expand All @@ -52,7 +64,9 @@ def test_init(self):
def test_stationfilter(self):
engine = pyaro.list_timeseries_engines()["aeronetsunreader"]
sfilter = pyaro.timeseries.filters.get("stations", exclude=["Cuiaba"])
with engine.open(self.file, filters=[sfilter], tqdm_desc="test_stationfilter") as ts:
with engine.open(
self.file, filters=[sfilter], tqdm_desc="test_stationfilter"
) as ts:
count = 0
for var in ts.variables():
count += len(ts.data(var))
Expand All @@ -74,7 +88,9 @@ def test_variables_filter(self):
vfilter = pyaro.timeseries.filters.get(
"variables", reader_to_new={"AOD_550nm": new_var_name}
)
with engine.open(self.file, filters=[vfilter], tqdm_desc="test_variables_filter") as ts:
with engine.open(
self.file, filters=[vfilter], tqdm_desc="test_variables_filter"
) as ts:
self.assertEqual(ts.data(new_var_name).variable, new_var_name)


Expand Down

0 comments on commit 0ac1614

Please sign in to comment.