summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
Diffstat (limited to 'numpy')
-rw-r--r--numpy/polynomial/polytemplate.py4
-rw-r--r--numpy/polynomial/tests/test_chebyshev.py14
-rw-r--r--numpy/polynomial/tests/test_polynomial.py14
3 files changed, 16 insertions, 16 deletions
diff --git a/numpy/polynomial/polytemplate.py b/numpy/polynomial/polytemplate.py
index 2a57a517f..1f17593dd 100644
--- a/numpy/polynomial/polytemplate.py
+++ b/numpy/polynomial/polytemplate.py
@@ -313,8 +313,8 @@ class $name(pu.PolyBase) :
"""
return len(self) - 1
- def reduce(self, deg) :
- """Reduce the degree of the series.
+ def cutdeg(self, deg) :
+ """Truncate series to the given degree.
Reduce the degree of the $name series to `deg` by discarding the
high order terms. If `deg` is greater than the current degree a
diff --git a/numpy/polynomial/tests/test_chebyshev.py b/numpy/polynomial/tests/test_chebyshev.py
index 17970ccc1..a893921ce 100644
--- a/numpy/polynomial/tests/test_chebyshev.py
+++ b/numpy/polynomial/tests/test_chebyshev.py
@@ -402,13 +402,13 @@ class TestChebyshevClass(TestCase) :
def test_degree(self) :
assert_equal(self.p1.degree(), 2)
- def test_reduce(self) :
- assert_raises(ValueError, self.p1.reduce, .5)
- assert_raises(ValueError, self.p1.reduce, -1)
- assert_equal(len(self.p1.reduce(3)), 3)
- assert_equal(len(self.p1.reduce(2)), 3)
- assert_equal(len(self.p1.reduce(1)), 2)
- assert_equal(len(self.p1.reduce(0)), 1)
+ def test_cutdeg(self) :
+ assert_raises(ValueError, self.p1.cutdeg, .5)
+ assert_raises(ValueError, self.p1.cutdeg, -1)
+ assert_equal(len(self.p1.cutdeg(3)), 3)
+ assert_equal(len(self.p1.cutdeg(2)), 3)
+ assert_equal(len(self.p1.cutdeg(1)), 2)
+ assert_equal(len(self.p1.cutdeg(0)), 1)
def test_convert(self) :
x = np.linspace(-1,1)
diff --git a/numpy/polynomial/tests/test_polynomial.py b/numpy/polynomial/tests/test_polynomial.py
index c8edcd308..1b8c0f8a5 100644
--- a/numpy/polynomial/tests/test_polynomial.py
+++ b/numpy/polynomial/tests/test_polynomial.py
@@ -373,13 +373,13 @@ class TestPolynomialClass(TestCase) :
def test_degree(self) :
assert_equal(self.p1.degree(), 2)
- def test_reduce(self) :
- assert_raises(ValueError, self.p1.reduce, .5)
- assert_raises(ValueError, self.p1.reduce, -1)
- assert_equal(len(self.p1.reduce(3)), 3)
- assert_equal(len(self.p1.reduce(2)), 3)
- assert_equal(len(self.p1.reduce(1)), 2)
- assert_equal(len(self.p1.reduce(0)), 1)
+ def test_cutdeg(self) :
+ assert_raises(ValueError, self.p1.cutdeg, .5)
+ assert_raises(ValueError, self.p1.cutdeg, -1)
+ assert_equal(len(self.p1.cutdeg(3)), 3)
+ assert_equal(len(self.p1.cutdeg(2)), 3)
+ assert_equal(len(self.p1.cutdeg(1)), 2)
+ assert_equal(len(self.p1.cutdeg(0)), 1)
def test_convert(self) :
x = np.linspace(-1,1)