Skip to content

Commit 688ee42

Browse files
committed
Add test for different timestep opts
1 parent f4f5045 commit 688ee42

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

tests/test_numerics.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,38 @@ def test_file_times():
179179
]
180180
assert _times == step_times
181181

182+
_times = gen.get_file_times("0001-01-01", timestep="year")
183+
assert _times == [
184+
"0001",
185+
"0002",
186+
"0003",
187+
"0004",
188+
"0005",
189+
"0006",
190+
"0007",
191+
"0008",
192+
"0009",
193+
"0010",
194+
"0011",
195+
"0012",
196+
]
197+
198+
_times = gen.get_file_times("0001-01-01", timestep="yearly-year-month-day")
199+
assert _times == [
200+
"0001-01-01",
201+
"0002-01-01",
202+
"0003-01-01",
203+
"0004-01-01",
204+
"0005-01-01",
205+
"0006-01-01",
206+
"0007-01-01",
207+
"0008-01-01",
208+
"0009-01-01",
209+
"0010-01-01",
210+
"0011-01-01",
211+
"0012-01-01",
212+
]
213+
182214

183215
def test_to_netcdf():
184216
ntimes = 12

0 commit comments

Comments
 (0)