Example #1
0
    def __init__(self, iterable=False, load_all = False, help_link=""):
        QWidget.__init__(self)
        self._iterable = iterable

        addHelpToWidget(self, help_link)

        layout = QHBoxLayout()

        analysis_module_combo = QComboBox()

        self._module_names = getAnalysisModuleNames(self._iterable)
        if load_all:
            self._module_names += getAnalysisModuleNames(not self._iterable)

        suffix = {'STD_ENKF': " - Recommended"}
        for module_name in self._module_names:
            analysis_module_combo.addItem(module_name + suffix.get(module_name, ""))

        self._current_module_name = self._getCurrentAnalysisModuleName()
        if self._current_module_name is not None:
            analysis_module_combo.setCurrentIndex(self._module_names.index(self._current_module_name))

        analysis_module_combo.currentIndexChanged[int].connect(self.analysisModuleChanged)

        variables_popup_button = QToolButton()
        variables_popup_button.setIcon(resourceIcon("ide/small/cog_edit.png"))
        variables_popup_button.clicked.connect(self.showVariablesPopup)
        variables_popup_button.setMaximumSize(20, 20)

        layout.addWidget(analysis_module_combo, 0, Qt.AlignLeft)
        layout.addWidget(variables_popup_button, 0, Qt.AlignLeft)
        layout.setContentsMargins(QMargins(0, 0, 0, 0))
        layout.addStretch()

        self.setLayout(layout)
Example #2
0
    def __init__(self, iterable=False, load_all = False, help_link=""):
        QWidget.__init__(self)
        self._iterable = iterable

        addHelpToWidget(self, help_link)

        layout = QHBoxLayout()

        analysis_module_combo = QComboBox()

        self._module_names = getAnalysisModuleNames(self._iterable)
        if load_all:
            self._module_names += getAnalysisModuleNames(not self._iterable)

        for module_name in self._module_names:
            analysis_module_combo.addItem(module_name)

        self._current_module_name = self._getCurrentAnalysisModuleName()
        if self._current_module_name is not None:
            analysis_module_combo.setCurrentIndex(self._module_names.index(self._current_module_name))

        analysis_module_combo.currentIndexChanged[int].connect(self.analysisModuleChanged)

        variables_popup_button = QToolButton()
        variables_popup_button.setIcon(resourceIcon("ide/small/cog_edit.png"))
        variables_popup_button.clicked.connect(self.showVariablesPopup)
        variables_popup_button.setMaximumSize(20, 20)

        layout.addWidget(analysis_module_combo, 0, Qt.AlignLeft)
        layout.addWidget(variables_popup_button, 0, Qt.AlignLeft)
        layout.setContentsMargins(QMargins(0, 0, 0, 0))
        layout.addStretch()

        self.setLayout(layout)
    def _getCurrentAnalysisModuleName(self):
        active_name = getCurrentAnalysisModuleName()
        modules = getAnalysisModuleNames(self._iterable)

        if active_name in modules:
            return active_name
        elif "STD_ENKF" in modules and not self._iterable:
            return "STD_ENKF"
        elif "RML_ENKF" in modules and self._iterable:
            return "RML_ENKF"
        elif len(modules) > 0:
            return modules[0]

        return None
Example #4
0
    def _getCurrentAnalysisModuleName(self):
        active_name = getCurrentAnalysisModuleName()
        modules = getAnalysisModuleNames(self._iterable)

        if active_name in modules:
            return active_name
        elif "STD_ENKF" in modules and not self._iterable:
            return "STD_ENKF"
        elif "RML_ENKF" in modules and self._iterable:
            return "RML_ENKF"
        elif len(modules) > 0:
            return modules[0]

        return None
Example #5
0
File: cli.py Project: wouterjdb/ert
def _setup_ensemble_smoother(args):
    model = EnsembleSmoother()
    iterable = False
    active_name = ERT.ert.analysisConfig().activeModuleName()
    modules = ertmodel.getAnalysisModuleNames(iterable=iterable)
    simulations_argument = {
        "active_realizations":
        _realizations(args),
        "target_case":
        _target_case_name(args, format_mode=False),
        "analysis_module":
        _get_analysis_module_name(active_name, modules, iterable=iterable),
    }
    return model, simulations_argument
Example #6
0
File: cli.py Project: wouterjdb/ert
def _setup_multiple_data_assimilation(args):
    model = MultipleDataAssimilation()
    iterable = False
    active_name = ERT.ert.analysisConfig().activeModuleName()
    modules = ertmodel.getAnalysisModuleNames(iterable=iterable)
    simulations_argument = {
        "active_realizations":
        _realizations(args),
        "target_case":
        _target_case_name(args, format_mode=True),
        "analysis_module":
        _get_analysis_module_name(active_name, modules, iterable=iterable),
        "weights":
        args.weights
    }
    return model, simulations_argument
 def analysisModuleChanged(self, index):
     modules = getAnalysisModuleNames(self._iterable)
     self._current_module_name = modules[index]
Example #8
0
 def analysisModuleChanged(self, index):
     modules = getAnalysisModuleNames(self._iterable)
     self._current_module_name = modules[index]