Skip to content

Commit

Permalink
Remove check to build ts_energy_user only when dynamic labels is avai…
Browse files Browse the repository at this point in the history
…lable.
  • Loading branch information
iantei committed Sep 25, 2024
1 parent 29f99b1 commit edfc6ec
Showing 1 changed file with 14 additions and 15 deletions.
29 changes: 14 additions & 15 deletions viz_scripts/generic_timeseries.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -252,23 +252,22 @@
"metadata": {},
"outputs": [],
"source": [
"if (len(dynamic_labels) == 0):\n",
" plot_title_no_quality = 'Net Daily Energy (All Users, excluding air)'\n",
" file_name = \"ts_energy_user%s\"%file_suffix\n",
"plot_title_no_quality = 'Net Daily Energy (All Users, excluding air)'\n",
"file_name = \"ts_energy_user%s\"%file_suffix\n",
"\n",
" try:\n",
" # Energy per week across all users (net impact)\n",
" plot_data = energy.groupby(['date_time'], as_index=False)['Mode_confirm_EI(kWH)'].agg(['sum'])\n",
" plot_data = plot_data.merge(active_users, on='date_time')\n",
" plot_data['sum'] = plot_data['sum'] / plot_data['active_users']\n",
"try:\n",
" # Energy per week across all users (net impact)\n",
" plot_data = energy.groupby(['date_time'], as_index=False)['Mode_confirm_EI(kWH)'].agg(['sum'])\n",
" plot_data = plot_data.merge(active_users, on='date_time')\n",
" plot_data['sum'] = plot_data['sum'] / plot_data['active_users']\n",
"\n",
" plot_title= plot_title_no_quality+\"\\n\"+quality_text\n",
" ylab = 'Energy (kWH/day/user)'\n",
" timeseries_plot(plot_data['date_time'], plot_data['sum'], plot_title, ylab, file_name)\n",
" alt_text = store_alt_text_timeseries(plot_data, file_name, plot_title)\n",
" except:\n",
" generate_missing_plot(plot_title_no_quality,debug_df,file_name)\n",
" alt_text = store_alt_text_missing(debug_df, file_name, plot_title_no_quality)"
" plot_title= plot_title_no_quality+\"\\n\"+quality_text\n",
" ylab = 'Energy (kWH/day/user)'\n",
" timeseries_plot(plot_data['date_time'], plot_data['sum'], plot_title, ylab, file_name)\n",
" alt_text = store_alt_text_timeseries(plot_data, file_name, plot_title)\n",
"except:\n",
" generate_missing_plot(plot_title_no_quality,debug_df,file_name)\n",
" alt_text = store_alt_text_missing(debug_df, file_name, plot_title_no_quality)"
]
},
{
Expand Down

0 comments on commit edfc6ec

Please sign in to comment.