Skip to content

Commit 2c71ecf

Browse files
committed
Merge branch 'preview-url' into release-candidate
2 parents 6ebfce7 + 1491f3d commit 2c71ecf

5 files changed

Lines changed: 53 additions & 56 deletions

File tree

.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ CLIMATECLAW_TARGET_PORT=8502 # The port on which the backend will be accessible
66
CLIMATECLAW_DEBUG_PORT=5678 # When debug-mode is on app.py is run via debugpy. See ./dev.sh on how to activate DEBUG mode
77

88
CLIMATECLAW_INSTANCE_NAME="dev" # The name of the instance, used to differentiate between multiple instances on the same server/filesystem
9-
CLIMATECLAW__PROJECT_NAME="freva-prod" # Required by prod.sh; deployment project name used to get preview directory of the project
9+
CLIMATECLAW_PROJECT_NAME="nextgems" # Required by prod.sh; deployment project name used to get preview directory of the project
1010

1111
CLIMATECLAW_CACHE_PATH=/scratch/b/b380001/climateclaw/cache # The path where the output of code (if saved by the bot) will be stored.
1212

src/climateclaw/prompt_library/baseline/examples.jsonl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@
131131
// Handlind daily data
132132
{"variant":"User","content":"Make a map plot of surface wind on 25.04.2010."}
133133
{"variant":"Assistant","content":"Here's how I will proceed:\n\n1. Query ERA5 surface wind (sfcWind) data for 25 April 2010 using freva-client.\n2. Load the data for that day using xarray.\n3. Create a global map plot (PlateCarree) of daily mean surface wind using matplotlib and cartopy.\n4. Add coastlines, borders, and a colorbar to the plot.\n\nLet's perform these steps now."}
134-
{"variant":"Code", "content":["{\"code\":\"import freva_client\\nimport xarray as xr\\nimport matplotlib.pyplot as plt\\nimport cartopy.crs as ccrs\\nimport cartopy.feature as cfeature\\nimport numpy as np\\n\\n# 1. Query ERA5 surface wind (sfcWind) data for 25 April 2010\\nerawind_files = freva_client.databrowser(\\n project='reanalysis',\\n experiment='era5',\\n variable='sfcwind',\\n time_frequency='day',\\n time='2010-04-25',\\n host='nextgems.dkrz.de')\\n\\n# 2. Load the data\\nds = xr.open_mfdataset(list(erawind_files), combine='by_coords')\\nwind = ds['sfcWind'].sel(time='2010-04-25').squeeze()\\n\\n# 3. Prepare lon/lat grid\\nd_lon = ds['lon']\\nd_lat = ds['lat']\\nlon2d, lat2d = np.meshgrid(d_lon, d_lat)\\n\\n# 4. Plotting\\nfig, ax = plt.subplots(figsize=(12,6), subplot_kw={'projection': ccrs.PlateCarree()})\\nlevels = np.linspace(np.nanmin(wind), np.nanmax(wind), 60)\\ncf = ax.contourf(lon2d, lat2d, wind, levels=levels, cmap='viridis', extend='both', transform=ccrs.PlateCarree())\\nax.add_feature(cfeature.COASTLINE)\\nax.add_feature(cfeature.BORDERS, linestyle=':')\\nplt.colorbar(cf, orientation='horizontal', pad=0.05, aspect=50, label='Surface Wind (m/s)')\\nplt.title('ERA5 Surface Wind on 2010-04-25')\\nplt.tight_layout()\\nplt.show()\"}","daily_wind_plot"]}
134+
{"variant":"Code", "content":["{\"code\":\"import freva_client\\nimport xarray as xr\\nimport matplotlib.pyplot as plt\\nimport cartopy.crs as ccrs\\nimport cartopy.feature as cfeature\\nimport numpy as np\\n\\n# 1. Query ERA5 surface wind (sfcWind) data for 25 April 2010\\nerawind_files = freva_client.databrowser(\\n project='reanalysis',\\n experiment='era5',\\n variable='sfcwind',\\n time_frequency='day',\\n time='2010-04-25',\\n host='nextgems.dkrz.de')\\n\\n# 2. Load the data\\nds = xr.open_mfdataset(list(erawind_files), combine='by_coords')\\nwind = ds['sfcWind'].sel(time='2010-04-25').squeeze()\\n\\n# 3. Prepare lon/lat grid\\nd_lon = ds['lon']\\nd_lat = ds['lat']\\nlon2d, lat2d = np.meshgrid(d_lon, d_lat)\\n\\n# 4. Plotting\\nfig, ax = plt.subplots(figsize=(12,6), subplot_kw={'projection': ccrs.PlateCarree()})\\nlevels = np.linspace(np.nanmin(wind), np.nanmax(wind), 60)\\ncf = ax.contourf(lon2d, lat2d, wind, levels=levels, cmap='viridis', extend='both', transform=ccrs.PlateCarree())\\nax.add_feature(cfeature.COASTLINE)\\nax.add_feature(cfeature.BORDERS, linestyle=':')\\nplt.colorbar(cf, orientation='horizontal', pad=0.05, aspect=50, label='Surface Wind (m/s)')\\nplt.title('ERA5 Surface Wind on 2010-04-25')\\nplt.tight_layout()\\nplt.savefig('era5_surface_wind_20100425.png')\"}","daily_wind_plot"]}
135135
{"variant":"CodeOutput","content":["","daily_wind_plot"]}
136136
{"variant":"Assistant","content":"Here is the global map plot of ERA5 surface wind (sfcWind, m/s) for 25 April 2010.\nThe map uses a PlateCarree projection, includes coastlines and country borders, and the colorbar shows the wind speed in meters per second. If you need any specific adjustments or a different region/projection, just let me know!"}
137137
// Weighting by area

src/climateclaw/prompt_library/baseline/starting_prompt.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -289,11 +289,13 @@ These paths can be accessed directly.
289289

290290
1. When using code_interpreter to create a plot, chart, figure, image, map, or visualization for the user, always save it to a file in the current working directory.
291291

292-
2. Use a descriptive filename with an appropriate extension, such as `.png`, `.jpg`, `.svg`, or `.pdf`.
292+
2. Instead of displaying figures inline, save every generated figure to disk, and close each figure after saving to avoid unnecessary inline rendering or memory use.
293293

294-
3. Use the built-in `open` function for file operations.
294+
3. Use a descriptive filename with an appropriate extension, such as `.png`, `.jpg`, `.svg`, or `.pdf`.
295295

296-
4. Do not import `os`.
296+
4. Use the built-in `open` function for file operations.
297+
298+
5. Do not import `os`.
297299

298300
---
299301

0 commit comments

Comments
 (0)