Revision: 617 http://rpy.svn.sourceforge.net/rpy/?rev=617&view=rev Author: lgautier Date: 2008-08-05 10:57:00 +0000 (Tue, 05 Aug 2008)
Log Message: ----------- - docstrings - create several instances of R does not throw exceptions anymore Modified Paths: -------------- branches/rpy_nextgen/NEWS branches/rpy_nextgen/rpy/robjects/__init__.py Modified: branches/rpy_nextgen/NEWS =================================================================== --- branches/rpy_nextgen/NEWS 2008-08-05 10:52:32 UTC (rev 616) +++ branches/rpy_nextgen/NEWS 2008-08-05 10:57:00 UTC (rev 617) @@ -15,7 +15,9 @@ - :func:`initEmbeddedR` is only initializing if R is not started (no effect otherwise, and no exception thrown anymore) +:mod:`rpy2.robjects`: +- :class:`R` remains a singleton, but does not throw an exception when multiple instances are requested Release 2.0.0a2 =============== Modified: branches/rpy_nextgen/rpy/robjects/__init__.py =================================================================== --- branches/rpy_nextgen/rpy/robjects/__init__.py 2008-08-05 10:52:32 UTC (rev 616) +++ branches/rpy_nextgen/rpy/robjects/__init__.py 2008-08-05 10:57:00 UTC (rev 617) @@ -18,6 +18,13 @@ #FIXME: close everything when leaving (check RPy for that). def default_ri2py(o): + """ Convert :class:`rpy2.rinterface.Sexp` to higher-level objects, + without copying the R objects. + + :param o: object + :rtype: :class:`rpy2.robjects.RObject (and subclasses)` + """ + res = None if isinstance(o, RObject): res = o @@ -52,6 +59,14 @@ def default_py2ri(o): + """ Convert arbitrary Python object to :class:`rpy2.rinterface.Sexp` to objects, + creating an R object with the content of the Python object in the process + (wichi means data copying). + + :param o: object + :rtype: :class:`rpy2.rinterface.Sexp` (and subclasses) + + """ if isinstance(o, RObject): res = rinterface.Sexp(o) if isinstance(o, rinterface.Sexp): @@ -81,6 +96,10 @@ def default_py2ro(o): + """ Convert any Python object into an robject. + :param o: object + :rtype: :class:`rpy2.robjects.RObject (and subclasses)` + """ res = default_py2ri(o) return default_ri2py(res) @@ -397,7 +416,8 @@ rinterface.initEmbeddedR() R._instance = self else: - raise(ValueError("Only one instance of R can be created")) + pass + #raise(RuntimeError("Only one instance of R can be created")) def __getattribute__(self, attr): return self[attr] 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