Ejemplo n.º 1
0
    def test_get_filename(self):
        with TestAreaContext("python/res_log/log") as work_area:
            test_log_filename = "log_test_file.txt"
            ResLog.init(1, test_log_filename, True)
            message = "This is fun"
            ResLog.log(1, message)

            self.assertEqual(ResLog.getFilename(), test_log_filename)
Ejemplo n.º 2
0
 def checkHaveSufficientRealizations(self, num_successful_realizations):
     if num_successful_realizations == 0:
         raise ErtRunError("Simulation failed! All realizations failed!")
     elif (not self.ert().analysisConfig().haveEnoughRealisations(
             num_successful_realizations, self._ensemble_size)):
         raise ErtRunError(
             "Too many simulations have failed! You can add/adjust MIN_REALIZATIONS to allow failures in your simulations.\n\n"
             "Check ERT log file '%s' or simulation folder for details." %
             ResLog.getFilename())
Ejemplo n.º 3
0
 def assertHaveSufficientRealizations(self, num_successful_realizations,
                                      active_realizations):
     if num_successful_realizations == 0:
         raise ErtRunError("Simulation failed! All realizations failed!")
     elif (num_successful_realizations < active_realizations):
         raise ErtRunError(
             "Too many simulations have failed! .\n\n"
             "Check ERT log file '%s' or simulation folder for details." %
             ResLog.getFilename())
Ejemplo n.º 4
0
def _assert_minium_realizations_success(ert, num_successful_realizations):
    if num_successful_realizations == 0:
        raise AssertionError("Simulation failed! All realizations failed!")
    elif not ert.analysisConfig().haveEnoughRealisations(
            num_successful_realizations, ert.getEnsembleSize()):
        raise AssertionError(
            "Too many simulations have failed! You can add/adjust MIN_REALIZATIONS to allow failures in your simulations.\n\n"
            "Check ERT log file '%s' or simulation folder for details." %
            ResLog.getFilename())
Ejemplo n.º 5
0
 def checkHaveSufficientRealizations(self, num_successful_realizations):
     if num_successful_realizations == 0:
         raise ErtRunError("Simulation failed! All realizations failed!")
     elif not self.ert().analysisConfig().haveEnoughRealisations(num_successful_realizations, self.ert().getEnsembleSize()):
         raise ErtRunError("Too many simulations have failed! You can add/adjust MIN_REALIZATIONS to allow failures in your simulations.\n\n"
                           "Check ERT log file '%s' or simulation folder for details." % ResLog.getFilename())
Ejemplo n.º 6
0
 def assertHaveSufficientRealizations(self, num_successful_realizations, active_realizations):
     if num_successful_realizations == 0:
         raise ErtRunError("Simulation failed! All realizations failed!")
     elif (num_successful_realizations < active_realizations):
         raise ErtRunError("Too many simulations have failed! .\n\n"
                           "Check ERT log file '%s' or simulation folder for details." % ResLog.getFilename())