summaryrefslogtreecommitdiff
path: root/numpy/polynomial/tests/test_classes.py
diff options
context:
space:
mode:
authorJonathan Underwood <jonathan.underwood@gmail.com>2015-12-03 14:49:31 +0000
committerJonathan Underwood <jonathan.underwood@gmail.com>2016-01-18 14:26:14 +0000
commit4dd71a3ab7bd019e36998e7c5f98ec2345539f18 (patch)
treeaa4b083b71f75daaaf9ad4065bae4cef8294e1f8 /numpy/polynomial/tests/test_classes.py
parent5f7b1af4e652c2ab631634d9778a3a4015e41ced (diff)
downloadnumpy-4dd71a3ab7bd019e36998e7c5f98ec2345539f18.tar.gz
TST: Add tests for check_fit with deg specified as list
Diffstat (limited to 'numpy/polynomial/tests/test_classes.py')
-rw-r--r--numpy/polynomial/tests/test_classes.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/numpy/polynomial/tests/test_classes.py b/numpy/polynomial/tests/test_classes.py
index cd5a54687..a7cf7209c 100644
--- a/numpy/polynomial/tests/test_classes.py
+++ b/numpy/polynomial/tests/test_classes.py
@@ -173,11 +173,18 @@ def check_fit(Poly):
assert_almost_equal(p(x), y)
assert_almost_equal(p.domain, d)
assert_almost_equal(p.window, w)
+ p = Poly.fit(x, y, [0, 1, 2, 3], domain=d, window=w)
+ assert_almost_equal(p(x), y)
+ assert_almost_equal(p.domain, d)
+ assert_almost_equal(p.window, w)
# check with class domain default
p = Poly.fit(x, y, 3, [])
assert_equal(p.domain, Poly.domain)
assert_equal(p.window, Poly.window)
+ p = Poly.fit(x, y, [0, 1, 2, 3], [])
+ assert_equal(p.domain, Poly.domain)
+ assert_equal(p.window, Poly.window)
# check that fit accepts weights.
w = np.zeros_like(x)
@@ -185,7 +192,9 @@ def check_fit(Poly):
w[::2] = 1
p1 = Poly.fit(x[::2], z[::2], 3)
p2 = Poly.fit(x, z, 3, w=w)
+ p3 = Poly.fit(x, z, [0, 1, 2, 3], w=w)
assert_almost_equal(p1(x), p2(x))
+ assert_almost_equal(p2(x), p3(x))
def check_equal(Poly):