CCockrum commited on
Commit
530d498
·
verified ·
1 Parent(s): 32734f2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -66,8 +66,11 @@ class EnhancedOceanClimateAgent:
66
  if not station_id:
67
  return None, "Station not found"
68
 
69
- end_date = datetime.now()
 
 
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 = {