[Numpy-svn] r8458 - in trunk: doc/release numpy/polynomial numpy/polynomial/tests

numpy-svn@scip... numpy-svn@scip...
Sun Jun 6 22:43:19 CDT 2010


Author: charris
Date: 2010-06-06 22:43:19 -0500 (Sun, 06 Jun 2010)
New Revision: 8458

Modified:
   trunk/doc/release/2.0.0-notes.rst
   trunk/numpy/polynomial/polytemplate.py
   trunk/numpy/polynomial/tests/test_chebyshev.py
   trunk/numpy/polynomial/tests/test_polynomial.py
Log:
CHG: Rename reduce method in polytemplate to cutdeg. Reduce is just too
much like a ufunc and a bit vague.

Modified: trunk/doc/release/2.0.0-notes.rst
===================================================================
--- trunk/doc/release/2.0.0-notes.rst	2010-06-07 03:43:07 UTC (rev 8457)
+++ trunk/doc/release/2.0.0-notes.rst	2010-06-07 03:43:19 UTC (rev 8458)
@@ -77,7 +77,7 @@
   derivations is a non-negative integer. The number 0 is a valid value for both
   functions.
 * A degree method has been added to the Polynomial class.
-* A reduce method has been added to the Polynomial class. It operates like
+* A cutdeg method has been added to the Polynomial class. It operates like
   truncate except that the argument is the desired degree of the result,
   not the number of coefficients.
 * The fit class function of the Polynomial class now uses None as the default
@@ -91,7 +91,7 @@
   derivations is a non-negative integer. The number 0 is a valid value for both
   functions.
 * A degree method has been added to the Chebyshev class.
-* A reduce method has been added to the Chebyshev class. It operates like
+* A cutdeg method has been added to the Chebyshev class. It operates like
   truncate except that the argument is the desired degree of the result,
   not the number of coefficients.
 * The fit class function of the Chebyshev class now uses None as the default

Modified: trunk/numpy/polynomial/polytemplate.py
===================================================================
--- trunk/numpy/polynomial/polytemplate.py	2010-06-07 03:43:07 UTC (rev 8457)
+++ trunk/numpy/polynomial/polytemplate.py	2010-06-07 03:43:19 UTC (rev 8458)
@@ -313,8 +313,8 @@
         """
         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

Modified: trunk/numpy/polynomial/tests/test_chebyshev.py
===================================================================
--- trunk/numpy/polynomial/tests/test_chebyshev.py	2010-06-07 03:43:07 UTC (rev 8457)
+++ trunk/numpy/polynomial/tests/test_chebyshev.py	2010-06-07 03:43:19 UTC (rev 8458)
@@ -402,13 +402,13 @@
     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)

Modified: trunk/numpy/polynomial/tests/test_polynomial.py
===================================================================
--- trunk/numpy/polynomial/tests/test_polynomial.py	2010-06-07 03:43:07 UTC (rev 8457)
+++ trunk/numpy/polynomial/tests/test_polynomial.py	2010-06-07 03:43:19 UTC (rev 8458)
@@ -373,13 +373,13 @@
     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)



More information about the Numpy-svn mailing list