Exemple #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 = 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)]
Exemple #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 = 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!")
Exemple #3
0
    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("Relative 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.addSpace()
        dialog.addWidget(
            QLabel("Example Custom Relative Weights: '8,4,2,1'\n"
                   "This means MDA-ES will half the weight\n"
                   "applied to the Observation Errors from one\n"
                   "iteration to the next across 4 iterations."), "Note")

        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!")
Exemple #4
0
    def __init__(self):
        RowPanel.__init__(self, "Queue System")

        # self.startTabs("LSF")
        self.addLabeledSeparator("LSF")
        self.addRow(
            StringBox(LsfQueue(), "LSF Queue",
                      "config/queue_system/lsf_queue"))
        self.addRow(
            IntegerSpinner(LsfMaxRunning(), "Max running",
                           "config/queue_system/max_running_lsf"))
        self.addRow(
            StringBox(LsfRequest(), "Resources",
                      "config/queue_system/lsf_resources"))
        self.addSpace(10)

        # self.addTab("RSH")
        self.addLabeledSeparator("RSH")
        self.addRow(
            PathChooser(RshCommand(), "Command",
                        "config/queue_system/rsh_command"))
        self.addRow(
            IntegerSpinner(RshMaxRunning(), "Max running",
                           "config/queue_system/max_running_rsh"))

        keyword_table = KeywordTable(RshHostListModel(), "Host List",
                                     "config/queue_system/rsh_host_list")
        keyword_table.setColumnHeaders(keyword_name="Host",
                                       value_name="Number of Jobs")
        self.addRow(keyword_table)
        self.addSpace(10)

        # self.addTab("LOCAL")
        self.addLabeledSeparator("Local")
        self.addRow(
            IntegerSpinner(LocalMaxRunning(), "Max running",
                           "config/queue_system/max_running_local"))
        self.addSpace(20)
Exemple #5
0
    def __init__(self, setter):
        """
        Takes as argument a setter for the simulation model to set the current
        value of this widget.
        """
        super(TextOrFile, self).__init__()
        self.model_setter = setter

        iteration_weights_path_model = DefaultPathModel("", must_exist=True)
        iteration_weights_path_chooser = PathChooser(
            iteration_weights_path_model, path_label="Iteration weights file")
        iteration_weights_path_model.observable().attach(
            DefaultPathModel.PATH_CHANGED_EVENT, self._valueChanged)

        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())
        custom_iteration_weights_model.observable().attach(
            StringModel.VALUE_CHANGED_EVENT, self._valueChanged)

        self.addHelpedWidget("Custom", custom_iteration_weights_box)
        self.addHelpedWidget("File", iteration_weights_path_chooser)