Example #1
0
    def initializeOrCopy(self):
        selected_parameters = getItemsFromList(self.parametersList)
        selected_members = getItemsFromList(self.membersList)

        if len(selected_parameters) == 0 or len(selected_members) == 0:
            QtGui.QMessageBox.warning(self, "Missing data", "At least one parameter and one member must be selected!")
            return

        if self.toggleScratch.isChecked():
            self.initializeCaseFromScratch(selected_parameters, selected_members)
        elif self.toggleInitCopy.isChecked():
            self.initializeCaseFromCase(selected_parameters, selected_members)
        else:
            self.copyEnsemble(selected_parameters, selected_members)
Example #2
0
    def select(self, *states):
        """Used by the right click menu to select multiple running jobs"""
        self.view.simulationList.clearSelection()

        items = getItemsFromList(self.view.simulationList, lambda item : item, selected=False)

        for state in states:
            for item in items:
                if item.simulation.checkStatus(state):
                    item.setSelected(True)
Example #3
0
    def run(self):
        """Do pre run checks and start the simulation. A new dialog will be shown with simulation information."""
        ert = self.getModel()
        selectedMembers = getItemsFromList(self.membersList)

        selectedMembers = [int(member) for member in selectedMembers]

        if len(selectedMembers) == 0:
            QtGui.QMessageBox.warning(self, "Missing data",
                                      "At least one member must be selected!")
            return

        member_mask = ert.createBoolVector(self.membersList.count(),
                                           selectedMembers)
        if not ert.enkf.enkf_main_is_initialized(ert.main, member_mask):
            QtGui.QMessageBox.warning(
                self, "Case not initialized",
                "The case must be initialized before simulation can start!")
            return
        ert.freeBoolVector(member_mask)

        simFrom = self.simulateFrom.getSelectedValue()
        simTo = self.simulateTo.getSelectedValue()

        if self.rbAssimilation.isChecked():
            mode = self.run_mode_type["ENKF_ASSIMILATION"]
        else:
            if simTo == -1:  # -1 == End
                mode = self.run_mode_type["ENSEMBLE_PREDICTION"]
            else:
                mode = self.run_mode_type["ENSEMBLE_EXPERIMENT"]

        state = self.state_enum["ANALYZED"]
        if self.startState.currentText() == "Forecast" and not simFrom == 0:
            state = self.state_enum["FORECAST"]

        init_step_parameter = simFrom

        #if mode == run_mode_type["ENKF_ASSIMILATION"]:
        #    init_step_parameter = simFrom
        #elif mode == run_mode_type["ENSEMBLE_EXPERIMENT"]:
        #    init_step_parameter = 0
        #else:
        #    init_step_parameter = self.historyLength

        jobsdialog = SimulationsDialog(self)
        jobsdialog.start(ert=ert,
                         memberCount=self.membersList.count(),
                         selectedMembers=selectedMembers,
                         simFrom=simFrom,
                         simTo=simTo,
                         mode=mode,
                         state=state,
                         init_step_parameter=init_step_parameter)
Example #4
0
    def select(self, *states):
        """Used by the right click menu to select multiple running jobs"""
        self.view.simulationList.clearSelection()

        items = getItemsFromList(self.view.simulationList,
                                 lambda item: item,
                                 selected=False)

        for state in states:
            for item in items:
                if item.simulation.checkStatus(state):
                    item.setSelected(True)
Example #5
0
    def run(self):
        """Do pre run checks and start the simulation. A new dialog will be shown with simulation information."""
        ert = self.getModel()
        selectedMembers = getItemsFromList(self.membersList)

        selectedMembers = [int(member) for member in selectedMembers]

        if len(selectedMembers) == 0:
            QtGui.QMessageBox.warning(self, "Missing data", "At least one member must be selected!")
            return

        member_mask = ert.createBoolVector(self.membersList.count(), selectedMembers)
        if not ert.enkf.enkf_main_is_initialized(ert.main, member_mask):
            QtGui.QMessageBox.warning(self, "Case not initialized", "The case must be initialized before simulation can start!")
            return
        ert.freeBoolVector(member_mask)


        simFrom = self.simulateFrom.getSelectedValue()
        simTo = self.simulateTo.getSelectedValue()

        if self.rbAssimilation.isChecked():
            mode = self.run_mode_type["ENKF_ASSIMILATION"]
        else:
            if simTo == -1: # -1 == End
                mode = self.run_mode_type["ENSEMBLE_PREDICTION"]
            else:
                mode = self.run_mode_type["ENSEMBLE_EXPERIMENT"]

        state = self.state_enum["ANALYZED"]
        if self.startState.currentText() == "Forecast" and not simFrom == 0:
            state = self.state_enum["FORECAST"]

        init_step_parameter = simFrom

        #if mode == run_mode_type["ENKF_ASSIMILATION"]:
        #    init_step_parameter = simFrom
        #elif mode == run_mode_type["ENSEMBLE_EXPERIMENT"]:
        #    init_step_parameter = 0
        #else:
        #    init_step_parameter = self.historyLength

        jobsdialog = SimulationsDialog(self)
        jobsdialog.start(ert = ert,
                         memberCount = self.membersList.count(),
                         selectedMembers = selectedMembers,
                         simFrom = simFrom,
                         simTo = simTo,
                         mode = mode,
                         state = state,
                         init_step_parameter = init_step_parameter)
Example #6
0
 def selectSimulation(self):
     """Set a job as selected"""
     selection = getItemsFromList(self.view.simulationList, lambda item : item.simulation)
     self.view.simulationPanel.setSimulations(selection)
Example #7
0
 def selectSimulation(self):
     """Set a job as selected"""
     selection = getItemsFromList(self.view.simulationList,
                                  lambda item: item.simulation)
     self.view.simulationPanel.setSimulations(selection)