Revision: 661 http://rpy.svn.sourceforge.net/rpy/?rev=661&view=rev Author: lgautier Date: 2008-10-20 18:37:54 +0000 (Mon, 20 Oct 2008)
Log Message: ----------- Bug fix: __pow__ was missing from the delegator object for robjects.RVector (while the documentation was claiming it was there) # bug report by Robert Nuske Modified Paths: -------------- branches/rpy_nextgen/NEWS branches/rpy_nextgen/rpy/robjects/__init__.py branches/rpy_nextgen/rpy/robjects/tests/testRVector.py Modified: branches/rpy_nextgen/NEWS =================================================================== --- branches/rpy_nextgen/NEWS 2008-10-16 17:50:41 UTC (rev 660) +++ branches/rpy_nextgen/NEWS 2008-10-20 18:37:54 UTC (rev 661) @@ -6,7 +6,9 @@ - conditional typedef in rinterface.c to compile under win32 # reported and initial proposed fix from Paul Harrington +- __pow__ was missing from the delegator object for robjects.RVector (while the documentation was claiming it was there) # bug report by Robert Nuske + Release 2.0.0b1 =============== Modified: branches/rpy_nextgen/rpy/robjects/__init__.py =================================================================== --- branches/rpy_nextgen/rpy/robjects/__init__.py 2008-10-16 17:50:41 UTC (rev 660) +++ branches/rpy_nextgen/rpy/robjects/__init__.py 2008-10-20 18:37:54 UTC (rev 661) @@ -185,6 +185,10 @@ res = r.get("*")(self._parent, x) return res + def __pow__(self, x): + res = r.get("^")(self._parent, x) + return res + def __div__(self, x): res = r.get("/")(self._parent, x) return res Modified: branches/rpy_nextgen/rpy/robjects/tests/testRVector.py =================================================================== --- branches/rpy_nextgen/rpy/robjects/tests/testRVector.py 2008-10-16 17:50:41 UTC (rev 660) +++ branches/rpy_nextgen/rpy/robjects/tests/testRVector.py 2008-10-20 18:37:54 UTC (rev 661) @@ -49,6 +49,13 @@ for i, li in enumerate(mySeq): self.assertEquals(li * 2, mySeqAdd[i]) + def testRPowerOperator(self): + seq_R = robjects.r["seq"] + mySeq = seq_R(0, 10) + mySeqPow = mySeq.r ** 2 + for i, li in enumerate(mySeq): + self.assertEquals(li ** 2, mySeqPow[i]) + def testSubsetByIndex(self): seq_R = robjects.baseNameSpaceEnv["seq"] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ rpy-list mailing list rpy-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rpy-list