Skip to content

Commit

Permalink
add multi variable support for phenology
Browse files Browse the repository at this point in the history
  • Loading branch information
robertjwilson committed Feb 4, 2025
1 parent 82f2c66 commit 339d44e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion ecoval/data/simdiff_phenology.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@
"for mm in set(measures):\n",
"\n",
"\n",
" mm_variables = list(set(df_options[df_options[\"measure\"] == mm][\"variable\"].values))\n",
" mm_variables = list(set(df_options[df_options[\"measure\"] == mm].variable))\n",
" # mm_variables = list(set(df_options[df_options[\"measure\"] == mm][\"variable\"].values))\n",
" rr_plot = True\n",
" for vv in mm_variables:\n",
" if True:\n",
Expand Down Expand Up @@ -123,9 +124,11 @@
" var = ds1_ave.variables[0]\n",
" ds1_ave = float(ds1_ave.to_dataframe()[var].values[0])\n",
" df_add = pd.DataFrame({\"simulation\": sim_0_name, \"variable\": var, \"value\": ds1_ave}, index = [0])\n",
" df_add = df_add.assign(variable = vv)\n",
" df_ave.append(df_add)\n",
" ds2_ave = float(ds2_ave.to_dataframe()[var].values[0])\n",
" df_add = pd.DataFrame({\"simulation\": sim_1_name, \"variable\": var, \"value\": ds2_ave}, index = [0])\n",
" df_add = df_add.assign(variable = vv)\n",
" df_ave.append(df_add)\n",
" # append to df_ave\n",
"\n",
Expand All @@ -135,9 +138,12 @@
" df1[\"simulation\"] = sim_0_name\n",
" df2 = extract_df(ds2)\n",
" df2[\"simulation\"] = sim_1_name\n",
" df1 = df1.assign(variable = vv)\n",
" df2 = df2.assign(variable = vv)\n",
" df_all.append(pd.concat([df1, df2]))\n",
" ds1-ds2\n",
" df1 = extract_df(ds1)\n",
" df1 = df1.assign(variable = vv)\n",
" df1[\"simulation\"] = sim_0_name\n",
" df_diff.append(df1)\n",
"df_all = pd.concat(df_all).reset_index(drop = True)\n",
Expand Down

0 comments on commit 339d44e

Please sign in to comment.