Skip to content

Commit 0875079

Browse files
author
zacharyburnett
committed
fix date retrieval for synthetic storm creation
1 parent 0759960 commit 0875079

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

stormevents/stormevent.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ def start_date(self, start_date: datetime):
244244
@lru_cache(maxsize=None)
245245
def __data_start(self) -> datetime:
246246
data_start = self.__entry["start_date"]
247-
if pandas.isna(data_start):
247+
if pandas.isna(data_start) and not self.synthetic:
248248
data_start = VortexTrack.from_storm_name(self.name, self.year).start_date
249249
return data_start
250250

@@ -269,7 +269,7 @@ def end_date(self, end_date: datetime):
269269
@lru_cache(maxsize=None)
270270
def __data_end(self) -> datetime:
271271
data_end = self.__entry["end_date"]
272-
if pandas.isna(data_end):
272+
if pandas.isna(data_end) and not self.synthetic:
273273
data_end = VortexTrack.from_storm_name(self.name, self.year).end_date
274274
return data_end
275275

0 commit comments

Comments
 (0)