File tree Expand file tree Collapse file tree 2 files changed +5
-10
lines changed Expand file tree Collapse file tree 2 files changed +5
-10
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,6 @@ class Ungrib(DriverCycleBased):
20
20
"""
21
21
22
22
PREFIX = "FILE"
23
- TIMEFMT = "%Y-%m-%d_%H:00:00"
24
23
25
24
# Workflow tasks
26
25
@@ -49,13 +48,14 @@ def namelist_file(self):
49
48
"""
50
49
The namelist file.
51
50
"""
51
+ timefmt = "%Y-%m-%d_%H:00:00"
52
52
d = {
53
53
"update_values" : {
54
54
"share" : {
55
- "end_date" : self ._end_date .strftime (self . TIMEFMT ),
55
+ "end_date" : self ._end_date .strftime (timefmt ),
56
56
"interval_seconds" : self ._interval ,
57
57
"max_dom" : 1 ,
58
- "start_date" : self ._cycle .strftime (self . TIMEFMT ),
58
+ "start_date" : self ._cycle .strftime (timefmt ),
59
59
"wrf_core" : "ARW" ,
60
60
},
61
61
"ungrib" : {
@@ -117,7 +117,7 @@ def output(self) -> dict[str, list[Path]]:
117
117
paths = []
118
118
ts = self ._cycle
119
119
while ts <= self ._end_date :
120
- fn = "%s:%s" % (self .PREFIX , ts .strftime (self . TIMEFMT ))
120
+ fn = "%s:%s" % (self .PREFIX , ts .strftime ("%Y-%m-%d_%H" ))
121
121
paths .append (self .rundir / fn )
122
122
ts += timedelta (seconds = self ._interval )
123
123
return {"paths" : paths }
Original file line number Diff line number Diff line change @@ -82,12 +82,7 @@ def test_Ungrib_namelist_file(driverobj):
82
82
83
83
def test_Ungrib_output (driverobj ):
84
84
assert driverobj .output ["paths" ] == [
85
- driverobj .rundir / f"FILE:{ x } "
86
- for x in (
87
- "2024-02-01_18:00:00" ,
88
- "2024-02-02_00:00:00" ,
89
- "2024-02-02_06:00:00" ,
90
- )
85
+ driverobj .rundir / f"FILE:{ x } " for x in ("2024-02-01_18" , "2024-02-02_00" , "2024-02-02_06" )
91
86
]
92
87
93
88
You can’t perform that action at this time.
0 commit comments