Skip to content

Commit

Permalink
Review comment
Browse files Browse the repository at this point in the history
  • Loading branch information
oyvindeide committed May 23, 2024
1 parent 36dcb6f commit 0197014
Showing 1 changed file with 8 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def run(

if ensemble_list is not None:
if ensemble_list.strip() == "*":
ensembles = self.getAllEnsembleList()
ensembles = self.getAllEnsembleList(storage)
else:
ensembles = ensemble_list.split(",")

Expand Down Expand Up @@ -168,21 +168,18 @@ def getArguments(self, parent, ert_config, storage):
description = "The CSV export requires some information before it starts:"
dialog = CustomDialog("CSV Export", description, parent)

default_csv_output_path = self.get_context_value(
"<CSV_OUTPUT_PATH>", default="output.csv"
)
subs_list = ert_config.substitution_list
default_csv_output_path = subs_list.get("<CSV_OUTPUT_PATH>", "output.csv")
output_path_model = PathModel(default_csv_output_path)
output_path_chooser = PathChooser(output_path_model)

design_matrix_default = self.get_context_value(
"<DESIGN_MATRIX_PATH>", default=""
)
design_matrix_default = subs_list.get("<DESIGN_MATRIX_PATH>", "")
design_matrix_path_model = PathModel(
design_matrix_default, is_required=False, must_exist=True
)
design_matrix_path_chooser = PathChooser(design_matrix_path_model)

list_edit = ListEditBox(self.getAllEnsembleList())
list_edit = ListEditBox(self.getAllEnsembleList(storage))

infer_iteration_check = QCheckBox()
infer_iteration_check.setChecked(True)
Expand Down Expand Up @@ -221,14 +218,9 @@ def getArguments(self, parent, ert_config, storage):

raise CancelPluginException("User cancelled!")

def get_context_value(self, name, default):
context = self.ert().substitution_list
if name in context:
return context[name]
return default

def getAllEnsembleList(self):
@staticmethod
def getAllEnsembleList(storage):
all_ensemble_list = [
ensemble.name for ensemble in self.storage.ensembles if ensemble.has_data()
ensemble.name for ensemble in storage.ensembles if ensemble.has_data()
]
return all_ensemble_list

0 comments on commit 0197014

Please sign in to comment.