示例#1
0
    def test_stat_quantiles(self):
        rng = RandomNumberGenerator()
        rng.setState("0123456789ABCDEF")
        v = DoubleVector()
        for i in range(100000):
            v.append(rng.getDouble())

        self.assertAlmostEqual(quantile(v, 0.1), 0.1, 2)
        self.assertAlmostEqual(quantile_sorted(v, 0.2), 0.2, 2)
        self.assertAlmostEqual(quantile_sorted(v, 0.3), 0.3, 2)
        self.assertAlmostEqual(quantile_sorted(v, 0.4), 0.4, 2)
        self.assertAlmostEqual(quantile_sorted(v, 0.5), 0.5, 2)
示例#2
0
    def setUp(self):
        if sys.platform.lower() == "darwin":
            self.libname = "rml_enkf.dylib"
        else:
            self.libname = "rml_enkf.so"

        self.rng = RandomNumberGenerator(RngAlgTypeEnum.MZRAN,
                                         RngInitModeEnum.INIT_DEFAULT)
示例#3
0
 def setUp(self):
     self.rng = RandomNumberGenerator(RngAlgTypeEnum.MZRAN,
                                      RngInitModeEnum.INIT_DEFAULT)
     if sys.platform.lower() == 'darwin':
         self.libname = res.res_lib_path + "/std_enkf_debug.dylib"
     else:
         self.libname = res.res_lib_path + "/std_enkf_debug.so"
     self.module = AnalysisModule(lib_name=self.libname)
示例#4
0
 def setUp(self):
     self.rng = RandomNumberGenerator(RngAlgTypeEnum.MZRAN,
                                      RngInitModeEnum.INIT_DEFAULT)
     if sys.platform.lower() == 'darwin':
         lib_name = "std_enkf_debug.dylib"
     else:
         lib_name = "std_enkf_debug.so"
     self.libname = find_file(self.SOURCE_ROOT, lib_name)
     if self.libname:
         self.module = AnalysisModule(lib_name=self.libname)
     else:
         pytest.skip('Debug library not found')
示例#5
0
 def setUp(self):
     self.libname = res.res_lib_path + "/rml_enkf.so"
     self.rng = RandomNumberGenerator(RngAlgTypeEnum.MZRAN,
                                      RngInitModeEnum.INIT_DEFAULT)
示例#6
0
 def setUp(self):
     self.rng = RandomNumberGenerator(RngAlgTypeEnum.MZRAN,
                                      RngInitModeEnum.INIT_DEFAULT)
     self.libname = res.res_lib_path + "/std_enkf_debug.so"
     self.module = AnalysisModule(lib_name=self.libname)
示例#7
0
 def setUp(self):
     self.rng = RandomNumberGenerator(RngAlgTypeEnum.MZRAN,
                                      RngInitModeEnum.INIT_DEFAULT)
     self.module = AnalysisModule(name="STD_ENKF")
示例#8
0
 def setUp(self):
     self.rng = RandomNumberGenerator(RngAlgTypeEnum.MZRAN,
                                      RngInitModeEnum.INIT_DEFAULT)