test_regression.py 484 B

12345678910111213141516
  1. from __future__ import division, print_function, absolute_import
  2. import numpy as np
  3. import scipy.interpolate as interp
  4. from numpy.testing import assert_almost_equal
  5. class TestRegression(object):
  6. def test_spalde_scalar_input(self):
  7. """Ticket #629"""
  8. x = np.linspace(0,10)
  9. y = x**3
  10. tck = interp.splrep(x, y, k=3, t=[5])
  11. res = interp.spalde(np.float64(1), tck)
  12. des = np.array([1., 3., 6., 6.])
  13. assert_almost_equal(res, des)