Beispiel #1
0
    def __init__(self, analysis_module_name, parent=None):
        QWidget.__init__(self, parent)

        self._analysis_module_name = analysis_module_name

        layout = QFormLayout()
        variable_names = AnalysisModuleVariablesModel.getVariableNames(
            self._analysis_module_name)

        if len(variable_names) == 0:
            label = QString("No variables found to edit")
            boxlayout = QHBoxLayout()
            layout.addRow(label, boxlayout)

        else:
            analysis_module_variables_model = AnalysisModuleVariablesModel
            self.blockSignals(True)

            variable_names2 = self.sortVariables(variable_names)
            for variable_name in variable_names2:
                variable_type = analysis_module_variables_model.getVariableType(
                    variable_name)
                variable_value = analysis_module_variables_model.getVariableValue(
                    self._analysis_module_name, variable_name)

                label_name = analysis_module_variables_model.getVariableLabelName(
                    variable_name)
                if variable_type == bool:
                    spinner = self.createCheckBox(variable_name,
                                                  variable_value,
                                                  variable_type)

                elif variable_type == float:
                    spinner = self.createDoubleSpinBox(
                        variable_name, variable_value, variable_type,
                        analysis_module_variables_model)

                elif variable_type == str:
                    spinner = self.createLineEdit(variable_name,
                                                  variable_value,
                                                  variable_type)

                elif variable_type == int:
                    spinner = self.createSpinBox(
                        variable_name, variable_value, variable_type,
                        analysis_module_variables_model)

                layout.addRow(label_name, spinner)
                if variable_name == "LAMBDA0":
                    label = QLabel(
                        "<span style=\"font-size:12pt; font-weight:300;font-style:italic;\"> Initial Lambda of -1.00 signifies that the value will be calculated</span>"
                    )
                    layout.addRow(label, None)

        self.setLayout(layout)
        self.blockSignals(False)
Beispiel #2
0
    def __init__(self, analysis_module_name, parent=None):
        QWidget.__init__(self, parent)

        self._analysis_module_name = analysis_module_name

        layout = QFormLayout()
        variable_names = AnalysisModuleVariablesModel.getVariableNames(self._analysis_module_name)

        if len(variable_names) == 0:
            label = QString("No variables found to edit")
            boxlayout = QHBoxLayout()
            layout.addRow(label, boxlayout)

        else:
            analysis_module_variables_model = AnalysisModuleVariablesModel
            self.blockSignals(True)

            variable_names2 = self.sortVariables(variable_names)
            for variable_name in variable_names2:
                variable_type = analysis_module_variables_model.getVariableType(variable_name)
                variable_value = analysis_module_variables_model.getVariableValue(
                    self._analysis_module_name, variable_name
                )

                label_name = analysis_module_variables_model.getVariableLabelName(variable_name)
                if variable_type == bool:
                    spinner = self.createCheckBox(variable_name, variable_value, variable_type)

                elif variable_type == float:
                    spinner = self.createDoubleSpinBox(
                        variable_name, variable_value, variable_type, analysis_module_variables_model
                    )

                elif variable_type == str:
                    spinner = self.createLineEdit(variable_name, variable_value, variable_type)

                elif variable_type == int:
                    spinner = self.createSpinBox(
                        variable_name, variable_value, variable_type, analysis_module_variables_model
                    )

                layout.addRow(label_name, spinner)
                if variable_name == "LAMBDA0":
                    label = QLabel(
                        '<span style="font-size:12pt; font-weight:300;font-style:italic;"> Initial Lambda of -1.00 signifies that the value will be calculated</span>'
                    )
                    layout.addRow(label, None)

        self.setLayout(layout)
        self.blockSignals(False)
Beispiel #3
0
    def __init__(self, analysis_module_name, parent=None):
        QWidget.__init__(self, parent)

        self._analysis_module_name = analysis_module_name

        layout = QFormLayout()
        variable_names = AnalysisModuleVariablesModel.getVariableNames(
            self._analysis_module_name)

        if len(variable_names) == 0:
            label = QLabel("No variables found to edit")
            boxlayout = QHBoxLayout()
            layout.addRow(label, boxlayout)

        else:
            analysis_module_variables_model = AnalysisModuleVariablesModel
            self.blockSignals(True)

            variable_names2 = self.sortVariables(variable_names)
            for variable_name in variable_names2:
                variable_type = analysis_module_variables_model.getVariableType(
                    variable_name)
                variable_value = analysis_module_variables_model.getVariableValue(
                    self._analysis_module_name, variable_name)

                label_name = analysis_module_variables_model.getVariableLabelName(
                    variable_name)
                if variable_type == bool:
                    spinner = self.createCheckBox(variable_name,
                                                  variable_value,
                                                  variable_type)

                elif variable_type == float:
                    spinner = self.createDoubleSpinBox(
                        variable_name,
                        variable_value,
                        variable_type,
                        analysis_module_variables_model,
                    )

                elif variable_type == str:
                    spinner = self.createLineEdit(variable_name,
                                                  variable_value,
                                                  variable_type)

                elif variable_type == int:
                    spinner = self.createSpinBox(
                        variable_name,
                        variable_value,
                        variable_type,
                        analysis_module_variables_model,
                    )

                layout.addRow(label_name, spinner)

                if variable_name == "IES_INVERSION":
                    label = QLabel(
                        '<span style="font-size:10pt; font-weight:300;font-style:italic;">   0: Exact inversion with diagonal R=I</span>'
                    )
                    layout.addRow(label, None)
                    label = QLabel(
                        '<span style="font-size:10pt; font-weight:300;font-style:italic;">   1: Subspace inversion with exact R  </span>'
                    )
                    layout.addRow(label, None)
                    label = QLabel(
                        '<span style="font-size:10pt; font-weight:300;font-style:italic;">   2: Subspace inversion using R=EE\'   </span>'
                    )
                    layout.addRow(label, None)
                    label = QLabel(
                        '<span style="font-size:10pt; font-weight:300;font-style:italic;">   3: Subspace inversion using E       </span>'
                    )
                    layout.addRow(label, None)

                if variable_name == "IES_DEC_STEPLENGTH":
                    label = QLabel(
                        '<span style="font-size:10pt; font-weight:300;font-style:italic;">   A good start is max steplength of 0.6, min steplength of 0.3, and decline of 2.5</span>'
                    )
                    layout.addRow(label, None)
                    label = QLabel(
                        '<span style="font-size:10pt; font-weight:300;font-style:italic;">   A steplength of 1.0 and one iteration results in ES update</span>'
                    )
                    layout.addRow(label, None)

                if variable_name == "IES_AAPROJECTION":
                    label = QLabel(
                        '<span style="font-size:10pt; font-weight:300;font-style:italic;">   Only impacts estimate when n less than N-1</span>'
                    )
                    label = QLabel(
                        '<span style="font-size:10pt; font-weight:300;font-style:italic;">   Any benefit of using the projection is unclear</span>'
                    )
                    layout.addRow(label, None)

        self.setLayout(layout)
        self.blockSignals(False)
    def __init__(self, analysis_module_name: str, facade: LibresFacade):
        QWidget.__init__(self)
        self.facade = facade
        self._analysis_module_name = analysis_module_name

        layout = QFormLayout()
        variable_names = AnalysisModuleVariablesModel.getVariableNames(
            facade=self.facade,
            analysis_module_name=self._analysis_module_name)

        if len(variable_names) == 0:
            label = QLabel("No variables found to edit")
            boxlayout = QHBoxLayout()
            layout.addRow(label, boxlayout)

        else:
            analysis_module_variables_model = AnalysisModuleVariablesModel
            self.blockSignals(True)

            for variable_name in variable_names:
                variable_type = analysis_module_variables_model.getVariableType(
                    variable_name)
                variable_value = analysis_module_variables_model.getVariableValue(
                    self.facade, self._analysis_module_name, variable_name)

                label_name = analysis_module_variables_model.getVariableLabelName(
                    variable_name)
                if variable_type == bool:
                    spinner = self.createCheckBox(variable_name,
                                                  variable_value,
                                                  variable_type)

                elif variable_type == float:
                    spinner = self.createDoubleSpinBox(
                        variable_name,
                        variable_value,
                        variable_type,
                        analysis_module_variables_model,
                    )

                elif variable_type == int:
                    spinner = self.createSpinBox(
                        variable_name,
                        variable_value,
                        analysis_module_variables_model,
                    )

                layout.addRow(label_name, spinner)

                if variable_name == "IES_INVERSION":
                    label = QLabel(
                        "<span style="
                        '"font-size:10pt; font-weight:300;font-style:italic;">   '
                        "0: Exact inversion with diagonal R=I</span>")
                    layout.addRow(label, None)
                    label = QLabel(
                        "<span style="
                        '"font-size:10pt; font-weight:300;font-style:italic;">   '
                        "1: Subspace inversion with exact R  </span>")
                    layout.addRow(label, None)
                    label = QLabel(
                        "<span style="
                        '"font-size:10pt; font-weight:300;font-style:italic;">   '
                        "2: Subspace inversion using R=EE'   </span>")
                    layout.addRow(label, None)
                    label = QLabel(
                        "<span style="
                        '"font-size:10pt; font-weight:300;font-style:italic;">   '
                        "3: Subspace inversion using E       </span>")
                    layout.addRow(label, None)

                if variable_name == "IES_DEC_STEPLENGTH":
                    label = QLabel(
                        "<span style="
                        '"font-size:10pt; font-weight:300;font-style:italic;">   '
                        "A good start is max steplength of 0.6, min steplength of 0.3, "
                        "and decline of 2.5</span>")
                    layout.addRow(label, None)
                    label = QLabel(
                        "<span style="
                        '"font-size:10pt; font-weight:300;font-style:italic;">   '
                        "A steplength of 1.0 and one iteration "
                        "results in ES update</span>")
                    layout.addRow(label, None)

        # Truncation of the eigenvalue spectrum is not possible when using exact
        # inversion, hence the spinners for setting the amount of truncation are
        # deactivated for exact inversion.
        inversion_spinner = self.widget_from_layout(layout, "IES_INVERSION")
        truncation_spinner = self.widget_from_layout(layout, "ENKF_TRUNCATION")
        self.update_truncation_spinners(inversion_spinner.value(),
                                        truncation_spinner)
        inversion_spinner.valueChanged.connect(
            lambda value: self.update_truncation_spinners(
                value, truncation_spinner))

        self.setLayout(layout)
        self.blockSignals(False)