Revision: 724 http://rpy.svn.sourceforge.net/rpy/?rev=724&view=rev Author: lgautier Date: 2008-12-19 21:53:06 +0000 (Fri, 19 Dec 2008)
Log Message: ----------- Added docstrings Modified Paths: -------------- rpy2/branches/version_2.0.x/rpy/robjects/__init__.py rpy2/branches/version_2.0.x/rpy/robjects/conversion.py Modified: rpy2/branches/version_2.0.x/rpy/robjects/__init__.py =================================================================== --- rpy2/branches/version_2.0.x/rpy/robjects/__init__.py 2008-12-19 21:39:45 UTC (rev 723) +++ rpy2/branches/version_2.0.x/rpy/robjects/__init__.py 2008-12-19 21:53:06 UTC (rev 724) @@ -114,6 +114,7 @@ class RObjectMixin(object): + """ Class to provide methods common to all RObject instances """ name = None def __str__(self): @@ -149,6 +150,7 @@ class RObject(RObjectMixin, rinterface.Sexp): + """ Base class for all R objects. """ def __setattr__(self, name, value): if name == '_sexp': if not isinstance(value, rinterface.Sexp): @@ -241,6 +243,7 @@ return res def assign(self, index, value): + """ Assign a given value to a given index position in the vector """ if not (isinstance(index, rlc.TaggedList) | \ isinstance(index, rlc.ArgsDict)): args = rlc.TaggedList([conversion.py2ro(index), ]) @@ -269,12 +272,13 @@ res = super(RVector, self).__setitem__(i, value) def getnames(self): + """ Get the element names, calling the R function names(). """ res = r.names(self) return res def setnames(self, value): - """ Return a vector of names - (like the R function 'names' does it).""" + """ Set the element names + (like the R function 'names<-' does it).""" res = r["names<-"](self, value) return res @@ -462,11 +466,13 @@ super(RFormula, self).__init__(robj) def getenvironment(self): + """ Get the environment in which the formula is finding its symbols.""" res = self.do_slot(".Environment") res = conversion.ri2py(res) return res def setenvironment(self, val): + """ Set the environment in which a formula will find its symbols.""" if not isinstance(val, rinterface.SexpEnvironment): raise ValueError("The environment must be an instance of" + " rpy2.rinterface.Sexp.environment") Modified: rpy2/branches/version_2.0.x/rpy/robjects/conversion.py =================================================================== --- rpy2/branches/version_2.0.x/rpy/robjects/conversion.py 2008-12-19 21:39:45 UTC (rev 723) +++ rpy2/branches/version_2.0.x/rpy/robjects/conversion.py 2008-12-19 21:53:06 UTC (rev 724) @@ -1,12 +1,15 @@ def ri2py(obj): + """ Dummy function for ri2py """ raise RuntimeError("Conversion function undefined") def py2ri(obj): + """ Dummy function for py2ri """ raise RuntimeError("Conversion function undefined") def py2ro(obj): + """ Dummy function for py2ro """ raise RuntimeError("Conversion function undefined") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ _______________________________________________ rpy-list mailing list rpy-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rpy-list