def test_as_kwargs_adjust_nlags(self): if not PYKRIGE_AVAILABLE: # pragma: no cover return True args = pykrige_interface.pykrige_as_kwargs(self.V, adjust_nlags=True) self.assertEqual(args['nlags'], self.V.n_lags)
def test_as_kwargs_adjust_maxlag(self): V = self.V.clone() # now maxlag should be changed args = pykrige_interface.pykrige_as_kwargs(V, adjust_maxlag=True) # should be None self.assertIsNone(V.maxlag) # transform should change xi = np.arange(1, 20) yi = V.transform(xi) # test changed values assert_array_almost_equal(yi, args['variogram_function']([], xi))
def test_as_kwargs(self): args = pykrige_interface.pykrige_as_kwargs(self.V) pars = pykrige_interface.pykrige_params(self.V) # test self.assertEqual(args['variogram_model'], 'custom') assert_array_almost_equal(pars, args['variogram_parameters']) xi = np.arange(1, 80) yi = self.V.transform(xi) assert_array_almost_equal( yi, args['variogram_function']([], xi), decimal=6 )
def test_as_kwargs(self): if not PYKRIGE_AVAILABLE: # pragma: no cover return True args = pykrige_interface.pykrige_as_kwargs(self.V) pars = pykrige_interface.pykrige_params(self.V) # test self.assertEqual(args['variogram_model'], 'custom') assert_array_almost_equal(pars, args['variogram_parameters']) xi = np.arange(1, 80) yi = self.V.transform(xi) assert_array_almost_equal(yi, args['variogram_function']([], xi), decimal=6)
def test_as_kwargs_adjust_nlags(self): args = pykrige_interface.pykrige_as_kwargs(self.V, adjust_nlags=True) self.assertEqual(args['nlags'], self.V.n_lags)