nakas Claude commited on
Commit
e8c040b
·
1 Parent(s): 3938e7a

Use exact approach from dynamical-org/notebooks

Browse files

- Use latest.zarr URLs instead of version-specific paths
- Add .zarr extension to all dataset URLs
- Use chunks=None parameter (no dask chunking)
- Upgrade to xarray>=2025.3.0 and zarr>=3.0.8
- Match exact package versions from notebooks repo

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

Files changed (2) hide show
  1. app.py +10 -16
  2. requirements.txt +4 -4
app.py CHANGED
@@ -17,30 +17,30 @@ logging.basicConfig(
17
  )
18
  logger = logging.getLogger(__name__)
19
 
20
- # Catalog configuration with correct zarr store URLs
21
  CATALOG = {
22
  "NOAA GFS Analysis (Hourly)": {
23
- "url": "https://data.dynamical.org/noaa/gfs/analysis-hourly/[email protected]",
24
  "type": "analysis",
25
  "variables": ["temperature_2m", "precipitation", "wind_u_10m", "wind_v_10m", "mean_sea_level_pressure"]
26
  },
27
  "NOAA GFS Forecast": {
28
- "url": "https://data.dynamical.org/noaa/gfs/forecast/[email protected]",
29
  "type": "forecast",
30
  "variables": ["temperature_2m", "precipitation", "wind_u_10m", "wind_v_10m", "mean_sea_level_pressure"]
31
  },
32
  "NOAA GEFS Analysis": {
33
- "url": "https://data.dynamical.org/noaa/gefs/analysis/[email protected]",
34
  "type": "analysis",
35
  "variables": ["temperature_2m", "precipitation", "wind_u_10m", "wind_v_10m"]
36
  },
37
  "NOAA GEFS Forecast (35-day)": {
38
- "url": "https://data.dynamical.org/noaa/gefs/forecast-35-day/[email protected]",
39
  "type": "forecast",
40
  "variables": ["temperature_2m", "precipitation", "wind_u_10m", "wind_v_10m"]
41
  },
42
  "NOAA HRRR Forecast (48-hour)": {
43
- "url": "https://data.dynamical.org/noaa/hrrr/forecast-48-hour/[email protected]",
44
  "type": "forecast",
45
  "variables": ["temperature_2m", "precipitation", "wind_u_10m", "wind_v_10m"]
46
  }
@@ -61,16 +61,10 @@ def load_dataset(dataset_name, use_cache=True):
61
  url = CATALOG[dataset_name]["url"]
62
  logger.info(f"Opening zarr store at: {url}")
63
 
64
- # Open zarr store (using zarr v2)
65
- # Try consolidated first, then fall back to non-consolidated
66
- try:
67
- logger.info("Trying to open with consolidated=True")
68
- ds = xr.open_zarr(url, consolidated=True)
69
- logger.info(f"Successfully opened with consolidated metadata")
70
- except KeyError:
71
- logger.info("No consolidated metadata, trying consolidated=False")
72
- ds = xr.open_zarr(url, consolidated=False)
73
- logger.info(f"Successfully opened without consolidated metadata")
74
  logger.info(f"Dataset dimensions: {dict(ds.dims)}")
75
  logger.info(f"Dataset variables: {list(ds.data_vars)}")
76
  logger.info(f"Dataset coordinates: {list(ds.coords)}")
 
17
  )
18
  logger = logging.getLogger(__name__)
19
 
20
+ # Catalog configuration - using latest.zarr URLs as per dynamical-org/notebooks
21
  CATALOG = {
22
  "NOAA GFS Analysis (Hourly)": {
23
+ "url": "https://data.dynamical.org/noaa/gfs/analysis-hourly/latest.zarr?email=treesixtyweather@gmail.com",
24
  "type": "analysis",
25
  "variables": ["temperature_2m", "precipitation", "wind_u_10m", "wind_v_10m", "mean_sea_level_pressure"]
26
  },
27
  "NOAA GFS Forecast": {
28
+ "url": "https://data.dynamical.org/noaa/gfs/forecast/latest.zarr?email=treesixtyweather@gmail.com",
29
  "type": "forecast",
30
  "variables": ["temperature_2m", "precipitation", "wind_u_10m", "wind_v_10m", "mean_sea_level_pressure"]
31
  },
32
  "NOAA GEFS Analysis": {
33
+ "url": "https://data.dynamical.org/noaa/gefs/analysis/latest.zarr?email=treesixtyweather@gmail.com",
34
  "type": "analysis",
35
  "variables": ["temperature_2m", "precipitation", "wind_u_10m", "wind_v_10m"]
36
  },
37
  "NOAA GEFS Forecast (35-day)": {
38
+ "url": "https://data.dynamical.org/noaa/gefs/forecast-35-day/latest.zarr?email=treesixtyweather@gmail.com",
39
  "type": "forecast",
40
  "variables": ["temperature_2m", "precipitation", "wind_u_10m", "wind_v_10m"]
41
  },
42
  "NOAA HRRR Forecast (48-hour)": {
43
+ "url": "https://data.dynamical.org/noaa/hrrr/forecast-48-hour/latest.zarr?email=treesixtyweather@gmail.com",
44
  "type": "forecast",
45
  "variables": ["temperature_2m", "precipitation", "wind_u_10m", "wind_v_10m"]
46
  }
 
61
  url = CATALOG[dataset_name]["url"]
62
  logger.info(f"Opening zarr store at: {url}")
63
 
64
+ # Open zarr store - using approach from dynamical-org/notebooks
65
+ logger.info("Opening zarr store with chunks=None")
66
+ ds = xr.open_zarr(url, chunks=None)
67
+ logger.info(f"Successfully opened zarr store")
 
 
 
 
 
 
68
  logger.info(f"Dataset dimensions: {dict(ds.dims)}")
69
  logger.info(f"Dataset variables: {list(ds.data_vars)}")
70
  logger.info(f"Dataset coordinates: {list(ds.coords)}")
requirements.txt CHANGED
@@ -1,9 +1,9 @@
1
  gradio==5.47.2
2
- xarray<2025.1.0
3
- zarr<3.0.0
4
  fsspec
5
- aiohttp
6
- s3fs
7
  pandas
8
  numpy
9
  plotly
 
1
  gradio==5.47.2
2
+ xarray>=2025.3.0
3
+ zarr>=3.0.8
4
  fsspec
5
+ aiohttp>=3.11.14
6
+ s3fs>=2025.3.0
7
  pandas
8
  numpy
9
  plotly