From 7965ac52b8b88bf14a0f8bac32b2f6c20d6eabce Mon Sep 17 00:00:00 2001 From: kaklise Date: Thu, 15 Feb 2024 15:27:31 -0800 Subject: [PATCH] removed group_data function --- pyomo/contrib/parmest/parmest.py | 39 -------------------------------- 1 file changed, 39 deletions(-) diff --git a/pyomo/contrib/parmest/parmest.py b/pyomo/contrib/parmest/parmest.py index 2e44b278423..83b24e39327 100644 --- a/pyomo/contrib/parmest/parmest.py +++ b/pyomo/contrib/parmest/parmest.py @@ -16,7 +16,6 @@ # TODO: move use_mpisppy to a Pyomo configuration option # Redesign TODOS -# TODO: remove group_data,this is only used in 1 example and should be handled by the user in Experiment # TODO: _treemaker is not used in parmest, the code could be moved to scenario tree if needed # TODO: Create additional built in objective expressions in an Enum class which includes SSE (see SSE function below) # TODO: Clean up the use of theta_names through out the code. The Experiment returns the CUID of each theta and this can be used directly (instead of the name) @@ -272,44 +271,6 @@ def _experiment_instance_creation_callback( # return m - -# def group_data(data, groupby_column_name, use_mean=None): -# """ -# Group data by scenario - -# Parameters -# ---------- -# data: DataFrame -# Data -# groupby_column_name: strings -# Name of data column which contains scenario numbers -# use_mean: list of column names or None, optional -# Name of data columns which should be reduced to a single value per -# scenario by taking the mean - -# Returns -# ---------- -# grouped_data: list of dictionaries -# Grouped data -# """ -# if use_mean is None: -# use_mean_list = [] -# else: -# use_mean_list = use_mean - -# grouped_data = [] -# for exp_num, group in data.groupby(data[groupby_column_name]): -# d = {} -# for col in group.columns: -# if col in use_mean_list: -# d[col] = group[col].mean() -# else: -# d[col] = list(group[col]) -# grouped_data.append(d) - -# return grouped_data - - def SSE(model): expr = sum((y - yhat) ** 2 for y, yhat in model.experiment_outputs.items()) return expr