File: test_regression.py

package info (click to toggle)
python-scipy 0.10.1%2Bdfsg2-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 42,232 kB
  • sloc: cpp: 224,773; ansic: 103,496; python: 85,210; fortran: 79,130; makefile: 272; sh: 43
file content (13 lines) | stat: -rw-r--r-- 433 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
import numpy as np
import scipy.interpolate as interp
from numpy.testing import assert_almost_equal, TestCase

class TestRegression(TestCase):
    def test_spalde_scalar_input(self):
        """Ticket #629"""
        x = np.linspace(0,10)
        y = x**3
        tck = interp.splrep(x, y, k=3, t=[5])
        res = interp.spalde(np.float64(1), tck)
        des = np.array([ 1.,  3.,  6.,  6.])
        assert_almost_equal(res, des)