Coverage for tests/test_create.py: 26.09%
21 statements
« prev ^ index » next coverage.py v7.6.1, created at 2025-07-24 10:14 +1000
« prev ^ index » next coverage.py v7.6.1, created at 2025-07-24 10:14 +1000
1# import netCDF4
2import numpy as np
3import pandas as pd
4from efts_io.wrapper import EftsDataSet
6def test_create_new_efts():
7 import efts_io.wrapper as wrap
9 issue_times = pd.date_range("2010-01-01", periods=31, freq="D")
10 station_ids = ["a", "b"]
11 lead_times = np.arange(start=1, stop=4, step=1)
12 lead_time_tstep = "hours"
13 ensemble_size = 10
14 station_names = [f"{x} station name" for x in station_ids]
15 nc_attributes = None
16 latitudes = None
17 longitudes = None
18 areas = None
19 def _create_test_ds():
20 d = wrap.xr_efts(
21 issue_times,
22 station_ids,
23 lead_times,
24 lead_time_tstep,
25 ensemble_size,
26 station_names,
27 nc_attributes,
28 latitudes,
29 longitudes,
30 areas,
31 )
32 return EftsDataSet(d)
33 # NOTE: should it be? is it wise to allow missing values for mandatory variables
34 w = _create_test_ds()
35 # assert w.writeable_to_stf2()
36 # w.save_to_stf2()
39if __name__ == "__main__": 39 ↛ 41line 39 didn't jump to line 41 because the condition on line 39 was never true
40 # test_read_thing()
41 test_create_new_efts()