This release contains two big new features: the ability to use PROOF with python, and the ability to pickle (python serialize) ROOT objects. Pickling of ROOT objects is straightforward: just hand them to pickle (or cPickle) like any other python object. To use PROOF with python, derive your custom class from TPySelector, override the methods that you want to specialize, and put it in a file that is shipped to the worker nodes, e.g.:
from ROOT import TPySelector class MyPySelector( TPySelector ): def Begin( self ): print 'py: beginning' def SlaveBegin( self, tree ): print 'py: slave beginning' def Process( self, entry ): self.fChain.GetEntry( entry ) print 'py: processing', self.fChain.ipi return 1 def SlaveTerminate( self ): print 'py: slave terminating' def Terminate( self ): print 'py: terminating'
The file containing the class (e.g. mymodule.py) will be treated as a python module and should be loadable through PYTHONPATH (typically '.') at the worker node. Setup PROOF as normal, and call:
dataset.Process( 'TPySelector', 'mymodule' )
PROOF will instantiate a TPySelector instance, which will in turn pick up the python class from module 'mymodule' and forward all calls.
There are several improvements in language mappings, as well as cleanup of the code for python2.2 (Py_ssize_t handling) and MacOS 10.3. Additionally, there are code cleanups (removing use of CINT internals) that should be fully transparent to the end-user.
The language mapping improvements are:
The python presentation of ROOT objects (ObjectProxy) as well as the meta-class hierarchy have undergone an internal change where individual ObjectProxy's no longer carry a TClassRef. Instead, this has moved to the python class level. Although there is now an extra layer of indirection to retrieve the class, the code is actually faster due to lower memory usage and lower memory turnover.