Ejemplo n.º 1
0
 def test_min_points_larger_max_points(self):
     with self.assertRaises(ValueError) as e:
         OrdinaryKriging(self.V, min_points=10, max_points=5)
         self.assertEqual(str(e),
                          'min_points can\'t be larger than max_points.')
Ejemplo n.º 2
0
 def test_max_points_type_check(self):
     with self.assertRaises(ValueError) as e:
         OrdinaryKriging(self.V, max_points=4.0)
         self.assertEqual(str(e), 'max_points has to be an integer.')
Ejemplo n.º 3
0
 def test_coordinates_and_values(self):
     ok = OrdinaryKriging(self.V)
     assert_array_almost_equal(self.c, ok.coords)
Ejemplo n.º 4
0
 def test_min_points_negative(self):
     with self.assertRaises(ValueError) as e:
         OrdinaryKriging(self.V, min_points=-2)
         self.assertEqual(str(e), 'min_points can\'t be negative.')
Ejemplo n.º 5
0
 def test_solver_AttributeError(self):
     with self.assertRaises(AttributeError) as e:
         OrdinaryKriging(self.V, solver='peter')
         self.assertEqual(str(e),
                          "solver has to be ['inv', 'numpy', 'scipy']")
Ejemplo n.º 6
0
 def test_precision_ValueError(self):
     with self.assertRaises(ValueError) as e:
         OrdinaryKriging(self.V, precision=0)
         self.assertEqual(str(e), 'The precision has be be > 1')
Ejemplo n.º 7
0
 def test_precision_TypeError(self):
     with self.assertRaises(TypeError) as e:
         OrdinaryKriging(self.V, precision='5.5')
         self.assertEqual(str(e), 'precision has to be of type int')
Ejemplo n.º 8
0
 def test_mode_unknown(self):
     with self.assertRaises(ValueError) as e:
         OrdinaryKriging(self.V, mode='foo')
         self.assertEqual(str(e),
                          "mode has to be one of 'exact', 'estimate'.")
Ejemplo n.º 9
0
    def test_max_points_negative(self):
        with self.assertRaises(ValueError) as e:
            ok = OrdinaryKriging(self.V, max_points=10)
            ok.max_points = -2

        self.assertEqual(str(e.exception), 'max_points can\'t be negative.')