summaryrefslogtreecommitdiff
path: root/numpy/ma/tests/test_extras.py
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2011-12-15 09:15:28 -0700
committerCharles Harris <charlesr.harris@gmail.com>2011-12-15 09:15:28 -0700
commit3d0b348450addcc33bd30e9c0b3ea5b10106ab4d (patch)
tree0cd387357a9d49b3e6d219bd83875d57d361ba58 /numpy/ma/tests/test_extras.py
parent5a683949d87fbad1dc93fb4fcb8b8293e7d19dc4 (diff)
parent008e5e9c6ee24b6675dc582373c4a14cbe5ec22e (diff)
downloadnumpy-3d0b348450addcc33bd30e9c0b3ea5b10106ab4d.tar.gz
Merge branch 'pull-176'
* pull-176: TST: Add test for weight modification. BUG: Handle weight correctly and don't modify the original. MAINT: Make masked ma.polyfit match current polyfit.
Diffstat (limited to 'numpy/ma/tests/test_extras.py')
-rw-r--r--numpy/ma/tests/test_extras.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/numpy/ma/tests/test_extras.py b/numpy/ma/tests/test_extras.py
index 082d36f95..f1b36a15d 100644
--- a/numpy/ma/tests/test_extras.py
+++ b/numpy/ma/tests/test_extras.py
@@ -630,7 +630,17 @@ class TestPolynomial(TestCase):
(c, r, k, s, d) = np.polyfit(x[1:-1], y[1:-1, :], 3, full=True)
for (a, a_) in zip((C, R, K, S, D), (c, r, k, s, d)):
assert_almost_equal(a, a_)
-
+ #
+ w = np.random.rand(10) + 1
+ wo = w.copy()
+ xs = x[1:-1]
+ ys = y[1:-1]
+ ws = w[1:-1]
+ (C, R, K, S, D) = polyfit(x, y, 3, full=True, w=w)
+ (c, r, k, s, d) = np.polyfit(xs, ys, 3, full=True, w=ws)
+ assert_equal(w, wo)
+ for (a, a_) in zip((C, R, K, S, D), (c, r, k, s, d)):
+ assert_almost_equal(a, a_)
class TestArraySetOps(TestCase):