def __init__(self):
        SimulationConfigPanel.__init__(self, EnsembleSmoother( getQueueConfig( ) ))

        layout = QFormLayout()

        case_selector = CaseSelector()
        layout.addRow("Current case:", case_selector)

        run_path_label = QLabel("<b>%s</b>" % getRunPath())
        addHelpToWidget(run_path_label, "config/simulation/runpath")
        layout.addRow("Runpath:", run_path_label)

        number_of_realizations_label = QLabel("<b>%d</b>" % getRealizationCount())
        addHelpToWidget(number_of_realizations_label, "config/ensemble/num_realizations")
        layout.addRow(QLabel("Number of realizations:"), number_of_realizations_label)

        self._target_case_model = TargetCaseModel()
        self._target_case_field = StringBox(self._target_case_model, "config/simulation/target_case")
        self._target_case_field.setValidator(ProperNameArgument())
        layout.addRow("Target case:", self._target_case_field)

        self._analysis_module_selector = AnalysisModuleSelector(iterable=False, help_link="config/analysis/analysis_module")
        layout.addRow("Analysis Module:", self._analysis_module_selector)

        self._active_realizations_model = ActiveRealizationsModel()
        self._active_realizations_field = StringBox(self._active_realizations_model, "config/simulation/active_realizations")
        self._active_realizations_field.setValidator(RangeStringArgument(getRealizationCount()))
        layout.addRow("Active realizations", self._active_realizations_field)

        self._target_case_field.getValidationSupport().validationChanged.connect(self.simulationConfigurationChanged)
        self._active_realizations_field.getValidationSupport().validationChanged.connect(self.simulationConfigurationChanged)

        self.setLayout(layout)
    def __init__(self):
        SimulationConfigPanel.__init__(self, EnsembleExperiment)

        layout = QFormLayout()

        case_selector = CaseSelector()
        layout.addRow("Current case:", case_selector)

        run_path_label = QLabel("<b>%s</b>" % getRunPath())
        addHelpToWidget(run_path_label, "config/simulation/runpath")
        layout.addRow("Runpath:", run_path_label)

        number_of_realizations_label = QLabel("<b>%d</b>" %
                                              getRealizationCount())
        addHelpToWidget(number_of_realizations_label,
                        "config/ensemble/num_realizations")
        layout.addRow(QLabel("Number of realizations:"),
                      number_of_realizations_label)

        self._active_realizations_model = ActiveRealizationsModel()
        self._active_realizations_field = StringBox(
            self._active_realizations_model,
            "config/simulation/active_realizations")
        self._active_realizations_field.setValidator(
            RangeStringArgument(getRealizationCount()))
        layout.addRow("Active realizations", self._active_realizations_field)

        self._active_realizations_field.getValidationSupport(
        ).validationChanged.connect(self.simulationConfigurationChanged)

        self.setLayout(layout)
Esempio n. 3
0
    def __init__(self):
        SimulationConfigPanel.__init__(self, EnsembleExperiment())

        layout = QFormLayout()

        case_selector = CaseSelector()
        layout.addRow("Current case:", case_selector)

        run_path_label = QLabel("<b>%s</b>" % getRunPath())
        addHelpToWidget(run_path_label, "config/simulation/runpath")
        layout.addRow("Runpath:", run_path_label)

        number_of_realizations_label = QLabel("<b>%d</b>" % getRealizationCount())
        addHelpToWidget(number_of_realizations_label, "config/ensemble/num_realizations")
        layout.addRow(QLabel("Number of realizations:"), number_of_realizations_label)

        self._active_realizations_model = ActiveRealizationsModel()
        self._active_realizations_field = StringBox(
            self._active_realizations_model, "config/simulation/active_realizations"
        )
        self._active_realizations_field.setValidator(RangeStringArgument(getRealizationCount()))
        layout.addRow("Active realizations", self._active_realizations_field)

        self._active_realizations_field.getValidationSupport().validationChanged.connect(
            self.simulationConfigurationChanged
        )

        self.setLayout(layout)
    def __init__(self):
        SimulationConfigPanel.__init__(self, IteratedEnsembleSmoother)

        layout = QFormLayout()

        case_selector = CaseSelector()
        layout.addRow("Current case:", case_selector)

        run_path_label = QLabel("<b>%s</b>" % getRunPath())
        addHelpToWidget(run_path_label, "config/simulation/runpath")
        layout.addRow("Runpath:", run_path_label)

        number_of_realizations_label = QLabel("<b>%d</b>" %
                                              getRealizationCount())
        addHelpToWidget(number_of_realizations_label,
                        "config/ensemble/num_realizations")
        layout.addRow(QLabel("Number of realizations:"),
                      number_of_realizations_label)

        # The num_iterations_spinner does not track any external changes (will that ever happen?)
        num_iterations_spinner = QSpinBox()
        num_iterations_spinner.setMinimum(1)
        num_iterations_spinner.setMaximum(100)
        num_iterations_spinner.setValue(getNumberOfIterations())
        addHelpToWidget(num_iterations_spinner,
                        "config/simulation/number_of_iterations")
        num_iterations_spinner.valueChanged[int].connect(setNumberOfIterations)

        layout.addRow("Number of iterations:", num_iterations_spinner)

        self._iterated_target_case_format_model = TargetCaseModel(
            format_mode=True)
        self._iterated_target_case_format_field = StringBox(
            self._iterated_target_case_format_model,
            "config/simulation/iterated_target_case_format",
        )
        self._iterated_target_case_format_field.setValidator(
            ProperNameFormatArgument())
        layout.addRow("Target case format:",
                      self._iterated_target_case_format_field)

        self._analysis_module_selector = AnalysisModuleSelector(
            iterable=True, help_link="config/analysis/analysis_module")
        layout.addRow("Analysis Module:", self._analysis_module_selector)

        self._active_realizations_model = ActiveRealizationsModel()
        self._active_realizations_field = StringBox(
            self._active_realizations_model,
            "config/simulation/active_realizations")
        self._active_realizations_field.setValidator(
            RangeStringArgument(getRealizationCount()))
        layout.addRow("Active realizations", self._active_realizations_field)

        self._iterated_target_case_format_field.getValidationSupport(
        ).validationChanged.connect(self.simulationConfigurationChanged)
        self._active_realizations_field.getValidationSupport(
        ).validationChanged.connect(self.simulationConfigurationChanged)

        self.setLayout(layout)
Esempio n. 5
0
    def __init__(self):
        SimulationConfigPanel.__init__(self, MultipleDataAssimilation)

        layout = QFormLayout()

        case_selector = CaseSelector()
        layout.addRow("Current case:", case_selector)

        run_path_label = QLabel("<b>%s</b>" % getRunPath())
        addHelpToWidget(run_path_label, "config/simulation/runpath")
        layout.addRow("Runpath:", run_path_label)

        number_of_realizations_label = QLabel("<b>%d</b>" %
                                              getRealizationCount())
        addHelpToWidget(number_of_realizations_label,
                        "config/ensemble/num_realizations")
        layout.addRow(QLabel("Number of realizations:"),
                      number_of_realizations_label)

        self._target_case_format_model = TargetCaseModel(format_mode=True)
        self._target_case_format_field = StringBox(
            self._target_case_format_model,
            "config/simulation/target_case_format")
        self._target_case_format_field.setValidator(ProperNameFormatArgument())
        layout.addRow("Target case format:", self._target_case_format_field)

        self.weights = MultipleDataAssimilation.default_weights
        self._createInputForWeights(layout)

        self._iter_field = StringBox(
            IterValueModel(),
            "config/simulation/iter_num",
        )
        self._iter_field.setValidator(IntegerArgument(from_value=0), )
        layout.addRow("Start iteration:", self._iter_field)

        self._analysis_module_selector = AnalysisModuleSelector(
            iterable=False, help_link="config/analysis/analysis_module")
        layout.addRow("Analysis Module:", self._analysis_module_selector)

        self._active_realizations_model = ActiveRealizationsModel()
        self._active_realizations_field = StringBox(
            self._active_realizations_model,
            "config/simulation/active_realizations")
        self._active_realizations_field.setValidator(
            RangeStringArgument(getRealizationCount()))
        layout.addRow("Active realizations:", self._active_realizations_field)

        self._target_case_format_field.getValidationSupport(
        ).validationChanged.connect(self.simulationConfigurationChanged)
        self._active_realizations_field.getValidationSupport(
        ).validationChanged.connect(self.simulationConfigurationChanged)
        self._relative_iteration_weights_box.getValidationSupport(
        ).validationChanged.connect(self.simulationConfigurationChanged)

        self.setLayout(layout)
    def __init__(self, advanced_option=False):
        SimulationConfigPanel.__init__(self, IteratedEnsembleSmoother(), advanced_option)

        layout = QFormLayout()

        case_selector = CaseSelector()
        layout.addRow("Current case:", case_selector)

        run_path_label = QLabel("<b>%s</b>" % getRunPath())
        addHelpToWidget(run_path_label, "config/simulation/runpath")
        layout.addRow("Runpath:", run_path_label)

        number_of_realizations_label = QLabel("<b>%d</b>" % getRealizationCount())
        addHelpToWidget(number_of_realizations_label, "config/ensemble/num_realizations")
        layout.addRow(QLabel("Number of realizations:"), number_of_realizations_label)

        # The num_iterations_spinner does not track any external changes (will that ever happen?)
        num_iterations_spinner = QSpinBox()
        num_iterations_spinner.setMinimum(1)
        num_iterations_spinner.setMaximum(100)
        num_iterations_spinner.setValue(getNumberOfIterations())
        addHelpToWidget(num_iterations_spinner, "config/simulation/number_of_iterations")
        num_iterations_spinner.valueChanged[int].connect(setNumberOfIterations)

        layout.addRow("Number of iterations:", num_iterations_spinner)

        self._iterated_target_case_format_model = TargetCaseModel(format_mode=True)
        self._iterated_target_case_format_field = StringBox(self._iterated_target_case_format_model, "config/simulation/iterated_target_case_format")
        self._iterated_target_case_format_field.setValidator(ProperNameFormatArgument())
        layout.addRow("Target case format:", self._iterated_target_case_format_field)


        self._analysis_module_selector = AnalysisModuleSelector(iterable=True, help_link="config/analysis/analysis_module")
        layout.addRow("Analysis Module:", self._analysis_module_selector)

        self._active_realizations_model = ActiveRealizationsModel()
        self._active_realizations_field = StringBox(self._active_realizations_model, "config/simulation/active_realizations")
        self._active_realizations_field.setValidator(RangeStringArgument(getRealizationCount()))
        layout.addRow("Active realizations", self._active_realizations_field)


        self._iterated_target_case_format_field.getValidationSupport().validationChanged.connect(self.simulationConfigurationChanged)
        self._active_realizations_field.getValidationSupport().validationChanged.connect(self.simulationConfigurationChanged)

        self.setLayout(layout)
Esempio n. 7
0
    def __init__(self):
        SimulationConfigPanel.__init__(self, EnsembleExperiment)
        self.setObjectName("Ensemble_experiment_panel")

        layout = QFormLayout()

        self._case_selector = CaseSelector()
        layout.addRow("Current case:", self._case_selector)

        run_path_label = QLabel("<b>%s</b>" % getRunPath())
        addHelpToWidget(run_path_label, "config/simulation/runpath")
        layout.addRow("Runpath:", run_path_label)

        number_of_realizations_label = QLabel("<b>%d</b>" %
                                              getRealizationCount())
        addHelpToWidget(number_of_realizations_label,
                        "config/ensemble/num_realizations")
        layout.addRow(QLabel("Number of realizations:"),
                      number_of_realizations_label)

        self._active_realizations_field = StringBox(
            ActiveRealizationsModel(),
            "config/simulation/active_realizations",
        )
        self._active_realizations_field.setValidator(
            RangeStringArgument(getRealizationCount()), )
        layout.addRow("Active realizations", self._active_realizations_field)

        self._iter_field = StringBox(
            IterValueModel(),
            "config/simulation/iter_num",
        )
        self._iter_field.setValidator(IntegerArgument(from_value=0), )
        layout.addRow("Iteration", self._iter_field)

        self.setLayout(layout)

        self._active_realizations_field.getValidationSupport(
        ).validationChanged.connect(self.simulationConfigurationChanged)
        self._case_selector.currentIndexChanged.connect(
            self._realizations_from_fs)

        self._realizations_from_fs()  # update with the current case
Esempio n. 8
0
    def getActiveRealizationsMask(self):
        count = getRealizationCount()

        mask = BoolVector(default_value=False, initial_size = count)
        if not mask.updateActiveMask(self.getValue()):
            raise ValueError('Error while parsing range string "%s"!' % self.getValue())

        if len(mask) != count:
            raise ValueError("Mask size changed %d != %d!" % (count, len(mask)))

        return mask
    def getActiveRealizationsMask(self):
        count = getRealizationCount()

        mask = BoolVector(default_value=False, initial_size = count)
        if not mask.updateActiveMask(self.getValue()):
            raise ValueError('Error while parsing range string "%s"!' % self.getValue())

        if len(mask) != count:
            raise ValueError("Mask size changed %d != %d!" % (count, len(mask)))

        return mask
Esempio n. 10
0
    def getActiveRealizationsMask(self):
        count = getRealizationCount()

        mask = BoolVector.createActiveMask(self.getValue())

        if mask is None:
            raise ValueError("Error while parsing range string!")

        if len(mask) > count:
            raise ValueError("Mask size changed %d != %d!" % (count, len(mask)))

        return mask
Esempio n. 11
0
    def getActiveRealizationsMask(self):
        count = getRealizationCount()

        mask = BoolVector.createActiveMask(self.getValue())

        if mask is None:
            raise ValueError("Error while parsing range string!")

        if len(mask) > count:
            raise ValueError("Mask size changed %d != %d!" %
                             (count, len(mask)))

        return mask
Esempio n. 12
0
    def getVariableMaximumValue(cls, name):
        if name == "CV_NFOLDS":
            return getRealizationCount() - 1

        return cls._VARIABLE_NAMES[name]["max"]
Esempio n. 13
0
 def getDefaultValue(self):
     size = getRealizationCount()
     return "0-%d" % (size - 1)
Esempio n. 14
0
    def getVariableMaximumValue(cls, name):
        if name == "CV_NFOLDS":
            return getRealizationCount() - 1

        return cls._VARIABLE_NAMES[name]["max"]
Esempio n. 15
0
 def getMemberList():
     return [str(member) for member in range(getRealizationCount())]
Esempio n. 16
0
 def getDefaultValue(self):
     size = getRealizationCount()
     return "0-%d" % (size - 1)
Esempio n. 17
0
 def getMemberList():
     return [str(member) for member in range(getRealizationCount())]