From 4bae6b2e63334c0b3623570d1b87a7e6efdab94d Mon Sep 17 00:00:00 2001 From: Trevor James Smith <10819524+Zeitsperre@users.noreply.github.com> Date: Wed, 11 Mar 2026 13:10:12 -0400 Subject: [PATCH 1/2] add conditional drop_vars execution Signed-off-by: Trevor James Smith <10819524+Zeitsperre@users.noreply.github.com> --- docs/notebooks/11_Climatological_ESP_forecasting.ipynb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/notebooks/11_Climatological_ESP_forecasting.ipynb b/docs/notebooks/11_Climatological_ESP_forecasting.ipynb index 485b8b30..d64a221d 100644 --- a/docs/notebooks/11_Climatological_ESP_forecasting.ipynb +++ b/docs/notebooks/11_Climatological_ESP_forecasting.ipynb @@ -182,7 +182,8 @@ "q_obs = q_obs.where(q_obs > 0, np.nan)\n", "\n", "# Drop non-numerical variable\n", - "q_sims = q_sims.drop_vars(\"basin_fullname\")\n", + "if \"basin_fullname\" in q_sims:\n", + " q_sims = q_sims.drop_vars(\"basin_fullname\")\n", "\n", "# Compute the Continuous Ranked Probability Score using xskillscore\n", "xs.crps_ensemble(q_obs, q_sims, dim=\"time\").q_sim.values[0]" From 7527bef221dc9dc45dea21e1854e2c6ec3af9ff7 Mon Sep 17 00:00:00 2001 From: Trevor James Smith <10819524+Zeitsperre@users.noreply.github.com> Date: Wed, 11 Mar 2026 15:38:06 -0400 Subject: [PATCH 2/2] adjust drop_vars call Signed-off-by: Trevor James Smith <10819524+Zeitsperre@users.noreply.github.com> --- docs/notebooks/11_Climatological_ESP_forecasting.ipynb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/notebooks/11_Climatological_ESP_forecasting.ipynb b/docs/notebooks/11_Climatological_ESP_forecasting.ipynb index d64a221d..c6e0f4ff 100644 --- a/docs/notebooks/11_Climatological_ESP_forecasting.ipynb +++ b/docs/notebooks/11_Climatological_ESP_forecasting.ipynb @@ -181,9 +181,8 @@ "# Adjust the streamflow to convert missing data from -1.2345 format to NaN. Set all negative values to NaN.\n", "q_obs = q_obs.where(q_obs > 0, np.nan)\n", "\n", - "# Drop non-numerical variable\n", - "if \"basin_fullname\" in q_sims:\n", - " q_sims = q_sims.drop_vars(\"basin_fullname\")\n", + "# Drop non-numerical variable if present\n", + "q_sims = q_sims.drop_vars(\"basin_fullname\", errors=\"ignore\")\n", "\n", "# Compute the Continuous Ranked Probability Score using xskillscore\n", "xs.crps_ensemble(q_obs, q_sims, dim=\"time\").q_sim.values[0]"