Revision: 642 http://rpy.svn.sourceforge.net/rpy/?rev=642&view=rev Author: lgautier Date: 2008-08-25 09:20:41 +0000 (Mon, 25 Aug 2008)
Log Message: ----------- rinterface: - initEmbeddedR() renamed to initr() - endEmbeddedR() renamed to endr() Modified Paths: -------------- branches/rpy_nextgen/NEWS branches/rpy_nextgen/doc/source/rinterface.rst branches/rpy_nextgen/rpy/rinterface/rinterface.c branches/rpy_nextgen/rpy/rinterface/tests/test_EmbeddedR.py branches/rpy_nextgen/rpy/rinterface/tests/test_Sexp.py branches/rpy_nextgen/rpy/rinterface/tests/test_SexpClosure.py branches/rpy_nextgen/rpy/rinterface/tests/test_SexpEnvironment.py branches/rpy_nextgen/rpy/rinterface/tests/test_SexpVector.py branches/rpy_nextgen/rpy/rinterface/tests/test_SexpVectorNumeric.py branches/rpy_nextgen/rpy/robjects/__init__.py branches/rpy_nextgen/rpy/rpy_classic.py Modified: branches/rpy_nextgen/NEWS =================================================================== --- branches/rpy_nextgen/NEWS 2008-08-25 07:08:15 UTC (rev 641) +++ branches/rpy_nextgen/NEWS 2008-08-25 09:20:41 UTC (rev 642) @@ -46,7 +46,11 @@ - R objects of type EXPRSXP are now handled as vectors (... but this may change again) +- :func:`initEmbeddedR` renamed to :func:`initr` +- :func:`endEmbeddedR` renamed to :func:`endr` + + :mod:`rpy2.robjects`: - :class:`R` remains a singleton, but does not throw an exception when multiple instances are requested Modified: branches/rpy_nextgen/doc/source/rinterface.rst =================================================================== --- branches/rpy_nextgen/doc/source/rinterface.rst 2008-08-25 07:08:15 UTC (rev 641) +++ branches/rpy_nextgen/doc/source/rinterface.rst 2008-08-25 09:20:41 UTC (rev 642) @@ -29,20 +29,20 @@ -------------- One has to initialize R before much can be done. -The function :func:`initEmbeddedR` lets one initialize +The function :func:`initr` lets one initialize the embedded R. -This is done with the function :meth:`initEmbeddedR`. +This is done with the function :meth:`initr`. -.. autofunction:: initEmbeddedR() +.. autofunction:: initr() ->>> rinterface.initEmbeddedR() +>>> rinterface.initr() Initialization should only be performed once. To avoid unpredictable results when using the embedded R, -subsequent calls to :func:`initEmbeddedR` will not have any effect. +subsequent calls to :func:`initr` will not have any effect. Parameters for the initialization are in the module variable `initOptions`. @@ -51,7 +51,7 @@ single: initialize R_HOME .. note:: - If calling :func:`initEmbeddedR` returns an error stating that + If calling :func:`initr` returns an error stating that :envvar:`R_HOME` is not defined, you should either have the :program:`R` executable in your path (:envvar:`PATH` on unix-alikes, or :envvar:`Path` on Microsoft Windows) or have the environment variable :envvar:`R_HOME` defined. Modified: branches/rpy_nextgen/rpy/rinterface/rinterface.c =================================================================== --- branches/rpy_nextgen/rpy/rinterface/rinterface.c 2008-08-25 07:08:15 UTC (rev 641) +++ branches/rpy_nextgen/rpy/rinterface/rinterface.c 2008-08-25 09:20:41 UTC (rev 642) @@ -2341,9 +2341,9 @@ /* --- List of functions defined in the module --- */ static PyMethodDef EmbeddedR_methods[] = { - {"initEmbeddedR", (PyCFunction)EmbeddedR_init, METH_NOARGS, + {"initr", (PyCFunction)EmbeddedR_init, METH_NOARGS, EmbeddedR_init_doc}, - {"endEmbeddedR", (PyCFunction)EmbeddedR_end, METH_O, + {"endr", (PyCFunction)EmbeddedR_end, METH_O, EmbeddedR_end_doc}, {"setWriteConsole", (PyCFunction)EmbeddedR_setWriteConsole, METH_VARARGS, EmbeddedR_setWriteConsole_doc}, Modified: branches/rpy_nextgen/rpy/rinterface/tests/test_EmbeddedR.py =================================================================== --- branches/rpy_nextgen/rpy/rinterface/tests/test_EmbeddedR.py 2008-08-25 07:08:15 UTC (rev 641) +++ branches/rpy_nextgen/rpy/rinterface/tests/test_EmbeddedR.py 2008-08-25 09:20:41 UTC (rev 642) @@ -1,7 +1,7 @@ import unittest import rpy2.rinterface as rinterface -rinterface.initEmbeddedR() +rinterface.initr() class EmbeddedRTestCase(unittest.TestCase): def testSetWriteConsole(self): @@ -28,9 +28,9 @@ def testCallErrorWhenEndedR(self): self.assertTrue(False) # worked when tested, but calling endEmbeddedR causes trouble t = rinterface.baseNameSpaceEnv['date'] - rinterface.endEmbeddedR(1) + rinterface.endr(1) self.assertRaises(RuntimeError, t) - rinterface.initEmbeddedR() + rinterface.initr() class ObjectDispatchTestCase(unittest.TestCase): Modified: branches/rpy_nextgen/rpy/rinterface/tests/test_Sexp.py =================================================================== --- branches/rpy_nextgen/rpy/rinterface/tests/test_Sexp.py 2008-08-25 07:08:15 UTC (rev 641) +++ branches/rpy_nextgen/rpy/rinterface/tests/test_Sexp.py 2008-08-25 09:20:41 UTC (rev 642) @@ -1,15 +1,10 @@ import unittest import rpy2.rinterface as rinterface -rinterface.initEmbeddedR() +rinterface.initr() class SexpTestCase(unittest.TestCase): - #def setUpt(self): - # rinterface.initEmbeddedR("foo", "--no-save") - #def tearDown(self): - # rinterface.endEmbeddedR(1); - def testNew_invalid(self): x = "a" Modified: branches/rpy_nextgen/rpy/rinterface/tests/test_SexpClosure.py =================================================================== --- branches/rpy_nextgen/rpy/rinterface/tests/test_SexpClosure.py 2008-08-25 07:08:15 UTC (rev 641) +++ branches/rpy_nextgen/rpy/rinterface/tests/test_SexpClosure.py 2008-08-25 09:20:41 UTC (rev 642) @@ -2,15 +2,10 @@ import rpy2.rinterface as rinterface import rpy2.rlike.container as rlc -rinterface.initEmbeddedR() +rinterface.initr() class SexpClosureTestCase(unittest.TestCase): - #def setUp(self): - # rinterface.initEmbeddedR("foo", "--no-save") - #def tearDown(self): - # rinterface.endEmbeddedR(1); - def testNew(self): x = "a" self.assertRaises(ValueError, rinterface.SexpClosure, x) Modified: branches/rpy_nextgen/rpy/rinterface/tests/test_SexpEnvironment.py =================================================================== --- branches/rpy_nextgen/rpy/rinterface/tests/test_SexpEnvironment.py 2008-08-25 07:08:15 UTC (rev 641) +++ branches/rpy_nextgen/rpy/rinterface/tests/test_SexpEnvironment.py 2008-08-25 09:20:41 UTC (rev 642) @@ -1,15 +1,10 @@ import unittest import rpy2.rinterface as rinterface -rinterface.initEmbeddedR() +rinterface.initr() class SexpEnvironmentTestCase(unittest.TestCase): - #def setUpt(self): - # rinterface.initEmbeddedR("foo", "--vanilla", "--no-save") - #def tearDown(self): - # rinterface.endEmbeddedR(0); - def testNew(self): sexp = rinterface.globalEnv sexp_new = rinterface.SexpEnvironment(sexp) Modified: branches/rpy_nextgen/rpy/rinterface/tests/test_SexpVector.py =================================================================== --- branches/rpy_nextgen/rpy/rinterface/tests/test_SexpVector.py 2008-08-25 07:08:15 UTC (rev 641) +++ branches/rpy_nextgen/rpy/rinterface/tests/test_SexpVector.py 2008-08-25 09:20:41 UTC (rev 642) @@ -2,7 +2,7 @@ import sys import rpy2.rinterface as ri -ri.initEmbeddedR() +ri.initr() def floatEqual(x, y, epsilon = 0.00000001): return abs(x - y) < epsilon @@ -28,22 +28,17 @@ self.assertTrue(ok) class SexpVectorTestCase(unittest.TestCase): - #def setUpt(self): - # ri.initEmbeddedR("foo", "--no-save") - #def tearDown(self): - # ri.endEmbeddedR(1); - def testMissinfType(self): self.assertRaises(ValueError, ri.SexpVector, [2, ]) #FIXME: end and initializing again causes currently a lot a trouble... def testNewWithoutInit(self): self.assertTrue(False) # worked when tested, but calling endEmbeddedR causes trouble - ri.endEmbeddedR(1) + ri.endr(1) self.assertRaises(RuntimeError, ri.SexpVector, [1,2], ri.INTSXP) #FIXME: trouble... does not initialize R when failing the test - ri.initEmbeddedR() + ri.initr() def testNewBool(self): sexp = ri.SexpVector([True, ], ri.LGLSXP) Modified: branches/rpy_nextgen/rpy/rinterface/tests/test_SexpVectorNumeric.py =================================================================== --- branches/rpy_nextgen/rpy/rinterface/tests/test_SexpVectorNumeric.py 2008-08-25 07:08:15 UTC (rev 641) +++ branches/rpy_nextgen/rpy/rinterface/tests/test_SexpVectorNumeric.py 2008-08-25 09:20:41 UTC (rev 642) @@ -10,7 +10,7 @@ hasNumpy = False -rinterface.initEmbeddedR() +rinterface.initr() def floatEqual(x, y, epsilon = 0.00000001): return abs(x - y) < epsilon Modified: branches/rpy_nextgen/rpy/robjects/__init__.py =================================================================== --- branches/rpy_nextgen/rpy/robjects/__init__.py 2008-08-25 07:08:15 UTC (rev 641) +++ branches/rpy_nextgen/rpy/robjects/__init__.py 2008-08-25 09:20:41 UTC (rev 642) @@ -440,7 +440,7 @@ def __init__(self): if R._instance is None: - rinterface.initEmbeddedR() + rinterface.initr() R._instance = self else: pass Modified: branches/rpy_nextgen/rpy/rpy_classic.py =================================================================== --- branches/rpy_nextgen/rpy/rpy_classic.py 2008-08-25 07:08:15 UTC (rev 641) +++ branches/rpy_nextgen/rpy/rpy_classic.py 2008-08-25 09:20:41 UTC (rev 642) @@ -42,7 +42,7 @@ # --- init R -ri.initEmbeddedR() +ri.initr() class RPyException(Exception): """ Generic exeception for RPy """ 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