From 4dd71a3ab7bd019e36998e7c5f98ec2345539f18 Mon Sep 17 00:00:00 2001 From: Jonathan Underwood Date: Thu, 3 Dec 2015 14:49:31 +0000 Subject: TST: Add tests for check_fit with deg specified as list --- numpy/polynomial/tests/test_classes.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'numpy/polynomial/tests/test_classes.py') 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): -- cgit v1.2.1