Skip to content

Commit

Permalink
loop over statistics only once to avoid data multiplication #330 (#331)
Browse files Browse the repository at this point in the history
  • Loading branch information
TatianaBurek authored Oct 13, 2023
1 parent 83050f1 commit cf3dbd4
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion metcalcpy/util/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,14 @@ def equalize_axis_data(fix_vals_keys, fix_vals_permuted, params, input_data, axi

for fcst_var, fcst_var_stats in fcst_var_val.items():
series_data_for_ee = pd.DataFrame()
for fcst_var_stat in fcst_var_stats:
fcst_var_stats_current = fcst_var_stats
# if the data comes from agg_stat workflow it doesn't contain statistics values.
# They will be calculated later. In this case The code should not loop over all
# requested statistics but instead should do it only ones to avoid data multiplication
if 'stat_name' not in input_data.keys():
fcst_var_stats_current = [fcst_var_stats[0]]

for fcst_var_stat in fcst_var_stats_current:
# for each series for the specified axis
if len(params['series_val_' + axis]) == 0:
series_data_for_ee = input_data
Expand Down

0 comments on commit cf3dbd4

Please sign in to comment.