Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

loop over statistics only once to avoid data multiplication #330 #331

Merged
merged 1 commit into from
Oct 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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