Skip to content

Commit 51595da

Browse files
author
valhassan
committed
Fix datetime parsing in ShardedDataset to correctly handle ISO format without trailing 'Z'
1 parent 172848f commit 51595da

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

geo_deep_learning/datasets/wds_dataset.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ def _encode_temporal(self, datetime_str: str) -> torch.Tensor:
313313
if datetime_str.endswith("Z"):
314314
datetime_str = datetime_str[:-1] + "+00:00"
315315

316-
dt = datetime.fromisoformat(datetime_str.replace("Z", "+00:00"))
316+
dt = datetime.fromisoformat(datetime_str)
317317

318318
# Week of year (1-52 or 53)
319319
week = dt.isocalendar().week

0 commit comments

Comments
 (0)