From fdd7a9233d49e92bb53f26e17335bddb9a32f38c Mon Sep 17 00:00:00 2001 From: bikegeek Date: Mon, 6 Jan 2025 14:55:47 -0700 Subject: [PATCH] move initialization of stat_values list to inside 'if' --- metcalcpy/agg_stat_bootstrap.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metcalcpy/agg_stat_bootstrap.py b/metcalcpy/agg_stat_bootstrap.py index 0687b456..0332b2f2 100644 --- a/metcalcpy/agg_stat_bootstrap.py +++ b/metcalcpy/agg_stat_bootstrap.py @@ -305,8 +305,8 @@ def _calc_stats(self, cases): values = self.series_data[np.in1d(data_cases, flat_cases)].to_numpy() safe_log(logger, "debug", f"Number of values selected for single case: {len(values)}") # Calculate the statistic for each bootstrap iteration + stat_values = [] try: - stat_values = [] stat_value = globals()[func_name](values, self.column_names, logger=logger) stat_values.append(stat_value) safe_log(logger, "info", f"Statistic calculated for bootstrap iteration: {stat_value}")