-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jan Jurgen Griesfeller
committed
May 23, 2024
1 parent
e85480a
commit 8eaf8ac
Showing
3 changed files
with
83 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import unittest | ||
import os | ||
|
||
import pyaro | ||
import pyaro.timeseries | ||
|
||
|
||
class TestPMFEBASTimeSeriesReader(unittest.TestCase): | ||
engine = "nilupmfabsorption" | ||
|
||
file = os.path.join( | ||
os.path.dirname(os.path.realpath(__file__)), | ||
"testdata", | ||
"PMF_Absorption", | ||
"Zeppelin_absorption_20171201_3mo_PMF_lev3.nas", | ||
) | ||
|
||
test_vars = ["Babs_bb", "Babs_ff", "eBC_bb", "eBC_ff"] | ||
|
||
testdata_dir = os.path.join( | ||
os.path.dirname(os.path.realpath(__file__)), "testdata", "PMF_Absorption" | ||
) | ||
|
||
def test_0engine(self): | ||
self.assertIn(self.engine, pyaro.list_timeseries_engines()) | ||
|
||
def test_1open_single_file(self): | ||
with pyaro.open_timeseries(self.engine, self.file, filters=[]) as ts: | ||
self.assertGreaterEqual(len(ts.variables()), 1) | ||
for var in ts.variables(): | ||
assert var in self.test_vars | ||
self.assertEqual(len(ts.stations()), 1) | ||
|
||
def test_2open_directory(self): | ||
with pyaro.open_timeseries(self.engine, self.testdata_dir, filters=[]) as ts: | ||
self.assertGreaterEqual(len(ts.variables()), 1) | ||
for var in ts.variables(): | ||
assert var in self.test_vars | ||
|
||
|
||
if __name__ == "__main__": | ||
unittest.main() |