Example #1
0
    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 = PathModel("output.csv")
        output_path_chooser = PathChooser(output_path_model)

        trajectory_model = PathModel("wellpath", must_be_a_directory=True, must_be_a_file=False, must_exist=True)
        trajectory_chooser = PathChooser(trajectory_model)

        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)]
Example #2
0
    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 = PathModel(default_csv_output_path)
        output_path_chooser = PathChooser(output_path_model)

        design_matrix_default = self.getDataKWValue("DESIGN_MATRIX_PATH", default="")
        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.getAllCaseList())

        infer_iteration_check = QCheckBox()
        infer_iteration_check.setChecked(True)
        infer_iteration_check.setToolTip(CSVExportJob.INFER_HELP)

        dialog.addLabeledOption("Output file path", output_path_chooser)
        dialog.addLabeledOption("Design Matrix path", design_matrix_path_chooser)
        dialog.addLabeledOption("List of cases to export", list_edit)
        dialog.addLabeledOption("Infer iteration number", infer_iteration_check)

        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_check.isChecked()]

        raise CancelPluginException("User cancelled!")
Example #3
0
    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 = PathModel(default_csv_output_path)
        output_path_chooser = PathChooser(output_path_model)

        design_matrix_default = self.getDataKWValue("DESIGN_MATRIX_PATH",
                                                    default="")
        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.getAllCaseList())

        infer_iteration_check = QCheckBox()
        infer_iteration_check.setChecked(True)
        infer_iteration_check.setToolTip(CSVExportJob.INFER_HELP)

        drop_const_columns_check = QCheckBox()
        drop_const_columns_check.setChecked(False)
        drop_const_columns_check.setToolTip(
            "If checked, exclude columns whose value is the same for every entry"
        )

        dialog.addLabeledOption("Output file path", output_path_chooser)
        dialog.addLabeledOption("Design matrix path",
                                design_matrix_path_chooser)
        dialog.addLabeledOption("List of cases to export", list_edit)
        dialog.addLabeledOption("Infer iteration number",
                                infer_iteration_check)
        dialog.addLabeledOption("Drop constant columns",
                                drop_const_columns_check)

        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_check.isChecked(),
                drop_const_columns_check.isChecked(),
            ]

        raise CancelPluginException("User cancelled!")
Example #4
0
    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 = PathModel("output.csv")
        output_path_chooser = PathChooser(output_path_model)

        trajectory_model = PathModel("wellpath", must_be_a_directory=True, must_be_a_file=False, must_exist=True)
        trajectory_chooser = PathChooser(trajectory_model)

        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)

        infer_iteration_check = QCheckBox()
        infer_iteration_check.setChecked(True)
        infer_iteration_check.setToolTip(GenDataRFTCSVExportJob.INFER_HELP)

        dialog.addLabeledOption("Output file path", output_path_chooser)
        dialog.addLabeledOption("Trajectory file", trajectory_chooser)
        dialog.addLabeledOption("List of cases to export", list_edit)
        dialog.addLabeledOption("Infer iteration number", infer_iteration_check)

        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_check.isChecked()]
            except ValueError:
                pass

        raise CancelPluginException("User cancelled!")