Skip to content

Commit

Permalink
formatting updates
Browse files Browse the repository at this point in the history
  • Loading branch information
kaklise committed Feb 28, 2024
1 parent be878d1 commit 8b25688
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
9 changes: 5 additions & 4 deletions pyomo/contrib/parmest/experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,17 @@
class Experiment:
"""
The experiment class is a template for making experiment lists
to pass to parmest.
An experiment is a Pyomo model "m" which is labeled
to pass to parmest.
An experiment is a Pyomo model "m" which is labeled
with additional suffixes:
* m.experiment_outputs which defines experiment outputs
* m.unknown_parameters which defines parameters to estimate
The experiment class has one required method:
* get_labeled_model() which returns the labeled Pyomo model
"""

def __init__(self, model=None):
self.model = model

Expand Down
6 changes: 3 additions & 3 deletions pyomo/contrib/parmest/parmest.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ def _expand_indexed_unknowns(self, model_temp):
Expand indexed variables to get full list of thetas
"""
model_theta_list = [k.name for k, v in model_temp.unknown_parameters.items()]

# check for indexed theta items
indexed_theta_list = []
for theta_i in model_theta_list:
Expand All @@ -419,11 +419,11 @@ def _expand_indexed_unknowns(self, model_temp):
indexed_theta_list.append(theta_i + '[' + str(ind) + ']')
else:
indexed_theta_list.append(theta_i)

# if we found indexed thetas, use expanded list
if len(indexed_theta_list) > len(model_theta_list):
model_theta_list = indexed_theta_list

return model_theta_list

def _create_parmest_model(self, experiment_number):
Expand Down

0 comments on commit 8b25688

Please sign in to comment.