File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -261,7 +261,10 @@ def status(self) -> StormStatus:
261261 entry = self .__entry
262262 age = datetime .today () - entry ["end_date" ]
263263 if pandas .isna (entry ["end_date" ]) or age < timedelta (days = 1 ):
264- return StormStatus .REALTIME
264+ if datetime .today () - entry ["start_date" ] > timedelta (days = 30 ):
265+ return StormStatus .HISTORICAL
266+ else :
267+ return StormStatus .REALTIME
265268 else :
266269 return StormStatus .HISTORICAL
267270
Original file line number Diff line number Diff line change @@ -233,6 +233,9 @@ def test_status():
233233 latest_storm = StormEvent .from_nhc_code (latest_storm_entry .name )
234234 age = datetime .today () - latest_storm_entry ["end_date" ]
235235 if pandas .isna (latest_storm_entry ["end_date" ]) or age < timedelta (days = 1 ):
236- assert latest_storm .status == StormStatus .REALTIME
236+ if datetime .today () - latest_storm_entry ["start_date" ] > timedelta (days = 30 ):
237+ assert latest_storm .status == StormStatus .HISTORICAL
238+ else :
239+ assert latest_storm .status == StormStatus .REALTIME
237240 else :
238241 assert latest_storm .status == StormStatus .HISTORICAL
You can’t perform that action at this time.
0 commit comments