Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -66,8 +66,11 @@ class EnhancedOceanClimateAgent:
|
|
66 |
if not station_id:
|
67 |
return None, "Station not found"
|
68 |
|
69 |
-
end_date
|
|
|
|
|
70 |
start_date = end_date - timedelta(days=days_back)
|
|
|
71 |
|
72 |
# Available NOAA products
|
73 |
products_to_fetch = {
|
|
|
66 |
if not station_id:
|
67 |
return None, "Station not found"
|
68 |
|
69 |
+
# Ensure end_date is not in the future (NOAA does not support future data)
|
70 |
+
today = datetime.utcnow().replace(hour=0, minute=0, second=0, microsecond=0)
|
71 |
+
end_date = min(datetime.utcnow(), today)
|
72 |
start_date = end_date - timedelta(days=days_back)
|
73 |
+
|
74 |
|
75 |
# Available NOAA products
|
76 |
products_to_fetch = {
|