def getArguments(self, parent=None): description = "The GEN_DATA RFT CSV export requires some information before it starts:" dialog = CustomDialog("Robust CSV Export", description, parent) output_path_model = DefaultPathModel("output.csv") output_path_chooser = PathChooser(output_path_model, path_label="Output file path") trajectory_model = DefaultPathModel("wellpath" , must_be_a_directory=True , must_be_a_file = False , must_exist = True) trajectory_chooser = PathChooser(trajectory_model, path_label="Trajectory file") fs_manager = self.ert().getEnkfFsManager() all_case_list = fs_manager.getCaseList() all_case_list = [case for case in all_case_list if fs_manager.caseHasData(case)]
def getArguments(self, parent=None): description = "The MDA Ensemble Smoother requires some information before running:" dialog = CustomDialog("MDA Ensemble Smoother", description, parent) iterated_target_case_format_model = DefaultNameFormatModel(self.getDefaultTargetCaseFormat()) iterated_target_case_format_box = StringBox(iterated_target_case_format_model, "Target case format", "config/simulation/iterated_target_case_format") iterated_target_case_format_box.setValidator(ProperNameFormatArgument()) iteration_weights_path_model = DefaultPathModel("", must_exist=True) iteration_weights_path_chooser = PathChooser(iteration_weights_path_model, path_label="Iteration weights file") custom_iteration_weights_model = StringModel("1") custom_iteration_weights_box = StringBox(custom_iteration_weights_model, "Custom iteration weights", "config/simulation/iteration_weights") custom_iteration_weights_box.setValidator(NumberListStringArgument()) option_widget = OptionWidget("Iteration Weights") option_widget.addHelpedWidget("Custom", custom_iteration_weights_box) option_widget.addHelpedWidget("File", iteration_weights_path_chooser) dialog.addOption(iterated_target_case_format_box) dialog.addOption(option_widget) dialog.addButtons() success = dialog.showAndTell() if success: optioned_widget = option_widget.getCurrentWidget() if optioned_widget == iteration_weights_path_chooser: weights = iteration_weights_path_model.getPath() elif optioned_widget == custom_iteration_weights_box: weights = custom_iteration_weights_model.getValue() else: weights = "1" return [iterated_target_case_format_model.getValue(), weights] raise CancelPluginException("User cancelled!")
def getArguments(self, parent=None): description = "The GEN_DATA RFT CSV export requires some information before it starts:" dialog = CustomDialog("Robust CSV Export", description, parent) output_path_model = DefaultPathModel("output.csv") output_path_chooser = PathChooser(output_path_model, path_label="Output file path") trajectory_model = DefaultPathModel("wellpath" , must_be_a_directory=True , must_be_a_file = False , must_exist = True) trajectory_chooser = PathChooser(trajectory_model, path_label="Trajectory file") fs_manager = self.ert().getEnkfFsManager() all_case_list = fs_manager.getCaseList() all_case_list = [case for case in all_case_list if fs_manager.caseHasData(case)] list_edit = ListEditBox(all_case_list, "List of cases to export") infer_iteration_model = DefaultBooleanModel() infer_iteration_checkbox = CheckBox(infer_iteration_model, label="Infer iteration number", show_label=False) infer_iteration_checkbox.setToolTip(GenDataRFTCSVExportJob.INFER_HELP) dialog.addOption(output_path_chooser) dialog.addOption(trajectory_chooser) dialog.addOption(list_edit) dialog.addOption(infer_iteration_checkbox) dialog.addButtons() success = dialog.showAndTell() if success: case_list = ",".join(list_edit.getItems()) try: return [output_path_model.getPath(), trajectory_model.getPath() , case_list, infer_iteration_model.isTrue()] except ValueError: pass raise CancelPluginException("User cancelled!")
def getArguments(self, parent=None): description = "The CSV export requires some information before it starts:" dialog = CustomDialog("CSV Export", description, parent) default_csv_output_path = self.getDataKWValue("CSV_OUTPUT_PATH", default="output.csv") output_path_model = DefaultPathModel(default_csv_output_path) output_path_chooser = PathChooser(output_path_model, path_label="Output file path") design_matrix_default = self.getDataKWValue("DESIGN_MATRIX_PATH", default="") design_matrix_path_model = DefaultPathModel(design_matrix_default, is_required=False, must_exist=True) design_matrix_path_chooser = PathChooser(design_matrix_path_model, path_label="Design Matrix path") all_case_list = self.getAllCaseList() list_edit = ListEditBox(all_case_list, "List of cases to export") infer_iteration_model = DefaultBooleanModel() infer_iteration_checkbox = CheckBox(infer_iteration_model, label="Infer iteration number", show_label=False) infer_iteration_checkbox.setToolTip(CSVExportJob.INFER_HELP) dialog.addOption(output_path_chooser) dialog.addOption(design_matrix_path_chooser) dialog.addOption(list_edit) dialog.addOption(infer_iteration_checkbox) dialog.addButtons() success = dialog.showAndTell() if success: design_matrix_path = design_matrix_path_model.getPath() if design_matrix_path.strip() == "": design_matrix_path = None case_list = ",".join(list_edit.getItems()) return [output_path_model.getPath(), case_list, design_matrix_path, infer_iteration_model.isTrue()] raise CancelPluginException("User cancelled!")
def getArguments(self, parent=None): description = "The CSV export requires some information before it starts:" dialog = CustomDialog("CSV Export", description, parent) default_csv_output_path = self.getDataKWValue("CSV_OUTPUT_PATH", default="output.csv") output_path_model = DefaultPathModel(default_csv_output_path) output_path_chooser = PathChooser(output_path_model, path_label="Output file path") design_matrix_default = self.getDataKWValue("DESIGN_MATRIX_PATH", default="") design_matrix_path_model = DefaultPathModel(design_matrix_default, is_required=False, must_exist=True) design_matrix_path_chooser = PathChooser( design_matrix_path_model, path_label="Design Matrix path") all_case_list = self.getAllCaseList() list_edit = ListEditBox(all_case_list, "List of cases to export") infer_iteration_model = DefaultBooleanModel() infer_iteration_checkbox = CheckBox(infer_iteration_model, label="Infer iteration number", show_label=False) infer_iteration_checkbox.setToolTip(CSVExportJob.INFER_HELP) dialog.addOption(output_path_chooser) dialog.addOption(design_matrix_path_chooser) dialog.addOption(list_edit) dialog.addOption(infer_iteration_checkbox) dialog.addButtons() success = dialog.showAndTell() if success: design_matrix_path = design_matrix_path_model.getPath() if design_matrix_path.strip() == "": design_matrix_path = None case_list = ",".join(list_edit.getItems()) return [ output_path_model.getPath(), case_list, design_matrix_path, infer_iteration_model.isTrue() ] raise CancelPluginException("User cancelled!")