Changes in the S-Python Package

Version 7

Minor 1

  • Keep existing value of PYTHONPATH in RPython.bsh when adding the package-specific paths. Thanks to Peter Kleiweg.

    Version 7

    Minor 0

    Moved the Python references to external pointers in R
    This simplifies things including garbage collection which should happen automatically.
    Added function addFromPythonConverter() for registering C routines for performing conversion of Python objects to R.
    More to come on this when I have time to handle R functions, Python functions, etc. and the other way around. It is not very difficult and is done in other inter-system interface packages.
    Example of converting a pygtk object to an RGtk GtkObject instance, e.g. for use in creating a GtkDrawingArea in pygtk and passing it to gtkDevice's asGtkDevice() function. Thanks to Ian MacDonald for the idea of doing this.

    Version 6

    Minor 1

  • Added support for PyLong type in the converters.
  • Fix to the printing of PythonReference objects in R.
  • __getattribute__ to dynamically create a wrapper function to facilitate calls to R functions of the form RS.funcName(...) without the need to have an explicit funcName object in the RS.
    This is simple syntactic sugar which can be used via
    from R import R
    R.sum([1, 2, 3, 4])
    R.rnorm(10, 1000)
    R.rnorm(10, sd = 8)
    
  • Version 6

    Minor 0

  • Added the function removePythonConverter() to connect to existing C routine.
  • Version 5

    Minor 4

    Fix for startup for running Python in R for version 2.3.* of Python.
    PyMapping_Check() was modified in Python 2.3.* to return TRUE for primitive types such as strings. This caused the converter for mappings to be called when library("RSPython") was called in the initialization.

    Minor: 3

    Bug fix in C code to recognize a list last in a sequence of if statements when converting from R to Python. Bug identified by Augustin Lobo.
    Switched eval calls to R_tryEval().
    Raise Python run-time exceptions when R generates an error.

    Version 5

    Minor: 2

    Configuration for BSD using threads via the -pthread option for the compiler rather than -lpthread.

    Version 5

    Minor: 1

    Fixed cause of error messages about Python references being no longer valid in [[.PythonReference.
    Negate the test of the return from getPythonReference() in RPy_getAttr().

    Version 5

    Minor: 0

    Ability to specify command line arguments for the R engine from Python using the __RPythonInitArgs variable, as requested by Tim Churches.
    The initialization that takes place when the RS & RSInternal modules are loaded retrieve this variable if it is defined and examine its contents to compute the command line arguments. If this is a string, it is used as the first user-level argument. If it is a Python List, we iterate over its elements and extrat each string element and make that the i-th argument.

    This initializes R as if it had been started from the command line as R --vanilla --silent

      >> __RPythonInitArgs = ["--vanilla", "--silent"]
      >> import RS
      >> RS.call('commandArgs')  # now ask R what it was given.
    
      >> __RPythonInitArgs = "--silent"
      >> import RS      
    
    Minor bug in .PythonEval() fixed.
    Catching exceptions in RS_checkError() handles both exceptions and string exceptions.
    Loading the library in R causes the initialization of the Python interpreter.
    This avoids errors due to the user forgetting to initialize it.
    The value returned by pythonFunction() is no longer a PythonReference objects.
    Dispatch of [[ and other methods now more appropriate.

    Version 4

    Minor: 0

    This was motivated by many suggestions and patches provided by Greg Warnes, and also observations from using the package myself in constructint the RGtk package.
    [[ operator for Python references in R retrieve the value of the named field from the instance.
    e.g.p[["myField"]]
    Basic bug fixes.

    Version 3

    Minor: 0

  • If the Python interpreter has not been initialized during a call to a Python method, function, etc., the default initialization is done at that time.
  • Set PYTHONPATH in .PythonInit if it is not already set.

  • Duncan Temple Lang <duncan@research.bell-labs.com>
    Last modified: Tue Oct 31 07:22:23 PST 2006