diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2016-01-18 08:41:27 -0700 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2016-01-18 08:41:27 -0700 |
commit | aa824670cf6ad21c2f921856ba4eec00781347fe (patch) | |
tree | 4eb4b2157c37781a94626034a17917f303e7df50 /numpy/polynomial/tests/test_classes.py | |
parent | 9872212bdfb3bb81f66840bb3914dc56896beba7 (diff) | |
parent | 082e1a8e690f304d1ce5b73aa03d179a25cdf3c6 (diff) | |
download | numpy-aa824670cf6ad21c2f921856ba4eec00781347fe.tar.gz |
Merge pull request #6360 from jonathanunderwood/legfit_restrict_terms
ENH: Allow specification of terms to fit in polynomial fitting functions
Diffstat (limited to 'numpy/polynomial/tests/test_classes.py')
-rw-r--r-- | numpy/polynomial/tests/test_classes.py | 9 |
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): |