Re: [Rpy] rpy2 on windows

2008-10-27 Thread laurent oget
Here is the log of the rpy2 unit test on XP with R 2.7.2. Should I try
rebuilding from SVN? Anybody interested in this windows build?

Laurent

C:\laurent\rpy2-2.0.0b1python rpy\tests.py
..Error in .Primitive([)(0:10, list(a, b, c)) :
  invalid subscript type 'list'
...Warning message:
closing unused connection 3 (C:\Temp\Garbage\RtmpJSZtrJ\file678418be)
.E..FLoading required package: splines
..Error in function (x)  : object y not found
...Error in .Primitive(sum)(c(a, b, c, d, e, f, g, h, i,  :
  invalid 'type' (character) of argument
..F.
F[1] 3
F...
==
ERROR: testNewString (rpy2.rinterface.tests.test_SexpVector.SexpVectorTestCase)
--
Traceback (most recent call last):
  File C:\Python25\Lib\site-packages\rpy2\rinterface\tests\test_SexpVector.py,
line 95, in testNewStrin
g
ri.NA_STRING[0]
ValueError: Cannot handle type 9

==
FAIL: testNewWithoutInit
(rpy2.rinterface.tests.test_SexpVector.SexpVectorTestCase)
--
Traceback (most recent call last):
  File C:\Python25\Lib\site-packages\rpy2\rinterface\tests\test_SexpVector.py,
line 37, in testNewWitho
utInit
self.assertTrue(False) # worked when tested, but calling
endEmbeddedR causes trouble
AssertionError

==
FAIL: testCallErrorWhenEndedR
(rpy2.rinterface.tests.test_EmbeddedR.EmbeddedRTestCase)
--
Traceback (most recent call last):
  File C:\Python25\Lib\site-packages\rpy2\rinterface\tests\test_EmbeddedR.py,
line 30, in testCallError
WhenEndedR
self.assertTrue(False) # worked when tested, but calling
endEmbeddedR causes trouble
AssertionError

==
FAIL: testSetReadConsole
(rpy2.rinterface.tests.test_EmbeddedR.EmbeddedRTestCase)
--
Traceback (most recent call last):
  File C:\Python25\Lib\site-packages\rpy2\rinterface\tests\test_EmbeddedR.py,
line 25, in testSetReadCo
nsole
self.assertEquals(yes.strip(), res[0])
AssertionError: 'yes' != ''

==
FAIL: testSetWriteConsole
(rpy2.rinterface.tests.test_EmbeddedR.EmbeddedRTestCase)
--
Traceback (most recent call last):
  File C:\Python25\Lib\site-packages\rpy2\rinterface\tests\test_EmbeddedR.py,
line 16, in testSetWriteC
onsole
self.assertEquals('[1] 3\n', str.join('', buf))
AssertionError: '[1] 3\n' != ''

--
Ran 144 tests in 2.534s

FAILED (failures=4, errors=1)

C:\laurent\rpy2-2.0.0b1




2008/10/23 laurent [EMAIL PROTECTED]:


 On Wed, 2008-10-22 at 22:33 -0400, laurent oget wrote:
 After some more tinkering, I was able to build a windows installer for rpy2.

 Good !

 I'll test it tomorrow.

 More tests will fail, as some of the features are not working with
 winXP, I think (the callback functions for console input and output for
 example).

 (more comments below).

 Laurent

 2008/10/22 laurent oget [EMAIL PROTECTED]:
  I could not find a machine with VS 2003 so i tried my chance with
  MINGW/MSYS, following
 
  http://boodebr.org/main/python/build-windows-extensions
 
  I installed MSYS and MINGW and ran python setup.py bdist_wininst
 
  A few issues i found:
 
  -windows is confused between rinterface.h (from rpy) and Rinterface.h 
  (from R)
  -Rinterface.h is not shipped with the windows binary installer of R
  -windows/mingw does not know what to do with uintptr_t
 
  i worked around those 3 by:
  -replacing uintptr_t with unsigned int

 The SVN version has a patch for that one:
 svn diff -r660:653 rpy/rinterface/rinterface.c

  -renaming rinterface.h to r_interface.h

 Odd you had to do so.
 It used to work on the winXP machine I used for the previous builds.

  -copying RInterface.h from a src distribution of R

 So Rinterface.h is no longer distributed with the R win32 binaries...
 that's annoying.

  now
 
  i am stuck with a mysterious
 
 
  writing build\temp.win32-2.5\Release\rpy\rinterface\rinterface.def
  Traceback (most recent call last):
   File setup.py, line 156, in module
 [pack_name + '.rinterface', pack_name + '.rinterface.tests']
   File C:\Python25\lib\distutils\core.py, line 151, in setup
 dist.run_commands()
   File C:\Python25\lib\distutils\dist.py, line 974, in run_commands
 self.run_command(cmd)
   File C:\Python25\lib\distutils\dist.py, line 994, in run_command
 cmd_obj.run()
   File 

Re: [Rpy] rpy2 on windows

2008-10-27 Thread laurent
Great work !

(the tests failing are expected to fail - the first is yet to be fixed
for all platforms, the next two are failing because stop and restarting
the embedded R is causing great trouble, the last two are expected to
fail under win32 at the moment).

I am surely interested in seeing this build distributed.
Having that one (2.0.0beta1) on sourceforge would be nice as it would
provide a similar reference for testing under win32 (although SVN is
supposed to be always better than snapshots).




L.



On Mon, 2008-10-27 at 11:18 -0400, laurent oget wrote:
 Here is the log of the rpy2 unit test on XP with R 2.7.2. Should I try
 rebuilding from SVN? Anybody interested in this windows build?
 
 Laurent
 
 C:\laurent\rpy2-2.0.0b1python rpy\tests.py
 ..Error in .Primitive([)(0:10, list(a, b, c)) :
   invalid subscript type 'list'
 ...Warning message:
 closing unused connection 3 (C:\Temp\Garbage\RtmpJSZtrJ\file678418be)
 .E..FLoading required package: splines
 ..Error in function (x)  : object y not found
 ...Error in .Primitive(sum)(c(a, b, c, d, e, f, g, h, i,  
 :
   invalid 'type' (character) of argument
 ..F.
 F[1] 3
 F...
 ==
 ERROR: testNewString 
 (rpy2.rinterface.tests.test_SexpVector.SexpVectorTestCase)
 --
 Traceback (most recent call last):
   File 
 C:\Python25\Lib\site-packages\rpy2\rinterface\tests\test_SexpVector.py,
 line 95, in testNewStrin
 g
 ri.NA_STRING[0]
 ValueError: Cannot handle type 9
 
 ==
 FAIL: testNewWithoutInit
 (rpy2.rinterface.tests.test_SexpVector.SexpVectorTestCase)
 --
 Traceback (most recent call last):
   File 
 C:\Python25\Lib\site-packages\rpy2\rinterface\tests\test_SexpVector.py,
 line 37, in testNewWitho
 utInit
 self.assertTrue(False) # worked when tested, but calling
 endEmbeddedR causes trouble
 AssertionError
 
 ==
 FAIL: testCallErrorWhenEndedR
 (rpy2.rinterface.tests.test_EmbeddedR.EmbeddedRTestCase)
 --
 Traceback (most recent call last):
   File 
 C:\Python25\Lib\site-packages\rpy2\rinterface\tests\test_EmbeddedR.py,
 line 30, in testCallError
 WhenEndedR
 self.assertTrue(False) # worked when tested, but calling
 endEmbeddedR causes trouble
 AssertionError
 
 ==
 FAIL: testSetReadConsole
 (rpy2.rinterface.tests.test_EmbeddedR.EmbeddedRTestCase)
 --
 Traceback (most recent call last):
   File 
 C:\Python25\Lib\site-packages\rpy2\rinterface\tests\test_EmbeddedR.py,
 line 25, in testSetReadCo
 nsole
 self.assertEquals(yes.strip(), res[0])
 AssertionError: 'yes' != ''
 
 ==
 FAIL: testSetWriteConsole
 (rpy2.rinterface.tests.test_EmbeddedR.EmbeddedRTestCase)
 --
 Traceback (most recent call last):
   File 
 C:\Python25\Lib\site-packages\rpy2\rinterface\tests\test_EmbeddedR.py,
 line 16, in testSetWriteC
 onsole
 self.assertEquals('[1] 3\n', str.join('', buf))
 AssertionError: '[1] 3\n' != ''
 
 --
 Ran 144 tests in 2.534s
 
 FAILED (failures=4, errors=1)
 
 C:\laurent\rpy2-2.0.0b1
 
 
 
 
 2008/10/23 laurent [EMAIL PROTECTED]:
 
 
  On Wed, 2008-10-22 at 22:33 -0400, laurent oget wrote:
  After some more tinkering, I was able to build a windows installer for 
  rpy2.
 
  Good !
 
  I'll test it tomorrow.
 
  More tests will fail, as some of the features are not working with
  winXP, I think (the callback functions for console input and output for
  example).
 
  (more comments below).
 
  Laurent
 
  2008/10/22 laurent oget [EMAIL PROTECTED]:
   I could not find a machine with VS 2003 so i tried my chance with
   MINGW/MSYS, following
  
   http://boodebr.org/main/python/build-windows-extensions
  
   I installed MSYS and MINGW and ran python setup.py bdist_wininst
  
   A few issues i found:
  
   -windows is confused between rinterface.h (from rpy) and Rinterface.h 
   (from R)
   -Rinterface.h is not shipped with the windows binary installer of R
   -windows/mingw does not know what to do with uintptr_t
  
   i worked around those 3 by:
   -replacing uintptr_t with unsigned int
 
  The SVN version has a patch for that one:
  svn diff -r660:653 rpy/rinterface/rinterface.c
 
   -renaming rinterface.h to r_interface.h
 
  Odd you had to do so.
  It used to work on the winXP machine I used 

Re: [Rpy] rpy 1.0.3 wants Rdevices.h, but R 2.8.0 (beta) has none to give

2008-10-27 Thread laurent oget
I ran into similar issues while trying to build rpy2 on windows, and i
ended up having to steal header files from the source distribution of
R. How much work would it be to do this?

Laurent Oget

2008/10/20 Dirk Eddelbuettel [EMAIL PROTECTED]:

 On 20 October 2008 at 11:42, laurent oget wrote:
 | I have built and used Rpy2 on ubuntu so it can be done, however the
 | API are different and replacing rpy with rpy2 in ubuntu packages will
 | break a lot of code using rpy.

 Sure, but that wasn't the question.

 The question was about rpy (v1) now becoming 'unbuildable' as R 2.8.0, out as
 of this morning, dramatically reduced the number of exported header files.

 We may have to modify the rpy (v1) source distribution to bring whatever is
 needed in from the R headers --- and carefully test that it still works.  If
 we don't do that, rpy in Debian turns into 'fails to build from source' and
 disappears from Debian and then Ubuntu.  That is likely to break some code
 too.

 Dirk

 --
 Three out of two people have difficulties with fractions.

 -
 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=100url=/
 ___
 rpy-list mailing list
 rpy-list@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/rpy-list


-
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=100url=/
___
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list


[Rpy] rpy2 rpy_classic

2008-10-27 Thread Denham Robert
I am having problems with rp2.rpy_classic with conversions.  If I do:

 
$ python
Python 2.5.2 (r252:60911, Aug 20 2008, 17:14:32) 
[GCC 4.1.2 20070115 (prerelease) (SUSE Linux)] on linux2
Type help, copyright, credits or license for more information.
 from rpy2.rpy_classic import *
 set_default_mode(NO_CONVERSION)
 x = r.seq(1, 3, by=0.5)
 print x
rpy2.rpy_classic.Robj object at 0x2ba5a898c710
 
 set_default_mode(BASIC_CONVERSION)
 x = r.seq(1, 3, by=0.5)
Traceback (most recent call last):
  File stdin, line 1, in module
  File
/opt/freeware/Python/Python-2.5.2/lib/python2.5/site-packages/rpy2/rpy_
classic.py, line 215, in __call__
res = rpy2py(res)
  File
/opt/freeware/Python/Python-2.5.2/lib/python2.5/site-packages/rpy2/rpy_
classic.py, line 174, in rpy2py
res = rpy2py_basic(obj)
  File
/opt/freeware/Python/Python-2.5.2/lib/python2.5/site-packages/rpy2/rpy_
classic.py, line 154, in rpy2py_basic
if obj.typeof() in [ri.INTSXP, ri.REALSXP, ri.CPLXSXP, 
TypeError: 'int' object is not callable
 
 

So with no conversion I can use seq(1,3), but with basic conversion I
can't seem to.  I am using python 2.5.2, R-2.8.0 on Suse x86_64.  Any
suggestions as to why the conversion doesn't work?

I have tried other examples, like
 
$ python
Python 2.5.2 (r252:60911, Aug 20 2008, 17:14:32) 
[GCC 4.1.2 20070115 (prerelease) (SUSE Linux)] on linux2
Type help, copyright, credits or license for more information.
 import rpy2.robjects as robjects
 x = robjects.r.seq(1, 10)
 print x
 [1]  1  2  3  4  5  6  7  8  9 10
 x.r[-1]
2:10
 

and they work fine.

I did the test of the install and got results like this:
$ python
Python 2.5.2 (r252:60911, Aug 20 2008, 17:14:32) 
[GCC 4.1.2 20070115 (prerelease) (SUSE Linux)] on linux2
Type help, copyright, credits or license for more information.
 import rpy2.tests
 import unittest
 tr = unittest.TextTestRunner(verbosity = 1)
 suite = rpy2.tests.suite()
 tr.run(suite)
..Error in .Primitive([)(0:10, list(a, b, c)) : 
  invalid subscript type 'list'

E..FLoading
required package: splines

..Error in function (x)  : object y not found

...Error in .Primitive(sum)(c(a, b, c, d, e, f, g, h,
i,  : 
  invalid 'type' (character) of argument

..F..
==
ERROR: testNewString
(rpy2.rinterface.tests.test_SexpVector.SexpVectorTestCase)
--
Traceback (most recent call last):
  File
/opt/freeware/Python/Python-2.5.2/lib/python2.5/site-packages/rpy2/rint
erface/tests/test_SexpVector.py, line 95, in testNewString
ri.NA_STRING[0]
ValueError: Cannot handle type 9

==
FAIL: testNewWithoutInit
(rpy2.rinterface.tests.test_SexpVector.SexpVectorTestCase)
--
Traceback (most recent call last):
  File
/opt/freeware/Python/Python-2.5.2/lib/python2.5/site-packages/rpy2/rint
erface/tests/test_SexpVector.py, line 37, in testNewWithoutInit
self.assertTrue(False) # worked when tested, but calling
endEmbeddedR causes trouble
AssertionError

==
FAIL: testCallErrorWhenEndedR
(rpy2.rinterface.tests.test_EmbeddedR.EmbeddedRTestCase)
--
Traceback (most recent call last):
  File
/opt/freeware/Python/Python-2.5.2/lib/python2.5/site-packages/rpy2/rint
erface/tests/test_EmbeddedR.py, line 30, in testCallErrorWhenEndedR
self.assertTrue(False) # worked when tested, but calling
endEmbeddedR causes trouble
AssertionError

--
Ran 144 tests in 0.195s

FAILED (failures=2, errors=1)
unittest._TextTestResult run=144 errors=1 failures=2



The information in this email together with any attachments is
intended only for the person or entity to which it is addressed
and may contain confidential and/or privileged material.
Any form of review, disclosure, modification, distribution
and/or publication of this email message is prohibited, unless
as a necessary part of Departmental business.
If you have received this message in error, you are asked to
inform the sender as quickly as possible and delete this message
and any copies of this message from your computer and/or your
computer system network.



-
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