File: test_regression.py

package info (click to toggle)
python-scipy 0.14.0-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 52,228 kB
  • ctags: 63,719
  • sloc: python: 112,726; fortran: 88,685; cpp: 86,979; ansic: 85,860; makefile: 530; sh: 236
file content (16 lines) | stat: -rw-r--r-- 496 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from __future__ import division, print_function, absolute_import

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)