Log of /trunk/bindings/pyroot/src/TPyReturn.cxx
Parent Directory
Revision
22698 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Mar 18 01:02:02 2008 UTC (6 years, 10 months ago) by
wlav
Original Path:
trunk/pyroot/src/TPyReturn.cxx
File length: 4725 byte(s)
Diff to
previous 20882
Initial TPySelector prototype for use with PROOF. The prototype
works, but needs improvement error reporting, resilience, and
optimizations. Basic Idea:
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 ):
print 'py: processing for:', self, self.fChain
return 1
def SlaveTerminate( self ):
print 'py: slave terminating'
def Terminate( self ):
print 'py: terminating'
def GetSelector():
return MyPySelector()
The for now conventional "GetSelector()" will be removed soon, in
favor of the same scheme (a derived class check) like with C++
selectors. The code above can then be run like so (localhost):
import time
from ROOT import TDSet, TProof
dataset = TDSet( 'TTree', 'h42' )
dataset.Add( 'root:// .... ' )
proof = TProof.Open('')
time.sleep(1) # needed for GUI to settle
print dataset.Process( 'TPySelector', 'MyPySelector.py' )
Do make sure to transport the MyPySelector.py in a .par file (or
similar), and do make sure that the environment on the other end
is proper.
Revision
11682 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Apr 28 07:33:55 2005 UTC (9 years, 8 months ago) by
brun
Original Path:
trunk/pyroot/src/TPyReturn.cxx
File length: 3870 byte(s)
Diff to
previous 11450
From Wim Lavrijsen:
o) fix for array overloading when typecode is unknown
o) change name mangling __ -> _ for private data members
o) added prototype code for crossing python classes/objects into CINT,
for example:
$ cat Aap.py
print 'creating class Aap ... '
class Aap:
def __init__( self ):
print 'in Aap.__init__'
def gime( self, what ):
return what
$ root
root [0] TPython::LoadMacro( "Aap.py" );
creating class Aap ...
root [1] Aap a = Aap();
in Aap.__init__
root [2] const char* b = a.gime( "aap" );
root [3] b
(const char* 0x41fe1894)"aap"
root [4]
Revision
11450 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Mar 30 05:16:19 2005 UTC (9 years, 9 months ago) by
brun
Original Path:
trunk/pyroot/src/TPyReturn.cxx
File length: 3929 byte(s)
Diff to
previous 11225
From Wim Lavrijsen
for the benefit of roottest (and probably for more general use as well):
o) pass cli args on to TApplication
o) textual fixes in comments
In particular, this allows '-b' to propagate. Note though, that the proper
syntax is:
$ python mymacro.py -b
rather than "python -b mymacro.py".
Revision
11225 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Mar 4 07:44:11 2005 UTC (9 years, 10 months ago) by
brun
Original Path:
trunk/pyroot/src/TPyReturn.cxx
File length: 3930 byte(s)
Diff to
previous 9538
From Wim Lavrijsen:
The core of PyROOT has been rewritten to:
1) reduce layers for performance,
2) refactor code (not completely done), and
3) follow the ROOT coding conventions
Along the way, a few loose ends have been wrapped up. Most notable of
these are: class static data, global builtin types, method doc strings,
mangled private member functions, and the addition of a C++ exception
to report python errors.
Revision
9538 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sat Jul 17 06:32:15 2004 UTC (10 years, 6 months ago) by
brun
Original Path:
trunk/pyroot/src/TPyReturn.cxx
File length: 3073 byte(s)
Diff to
previous 9179
From Wim Lavrijsen:
still trying to get a handle on better interaction with CINT, but in the
mean time a few housekeeping changes (see attach):
o) TPython, TPyReturn: added comments in line w/ ROOT autodoc conventions
o) MethodHolder: assert -> ReferenceError when accessing NULL object
o) MethodHolder: fix for PyObject parameter passing
Revision
9179 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Added
Sat Jun 12 05:35:10 2004 UTC (10 years, 7 months ago) by
brun
Original Path:
trunk/pyroot/src/TPyReturn.cxx
File length: 1944 byte(s)
From Wim Lavrijsen:
Files for new class TPyReturn:
inc/TPyReturn.h
src/TPyReturn.cxx
this is a carrier object that results from TPython::Eval() and allows
implicit conversion to builtin types:
root> double d = TPython::Eval( "1.5+math.pi")
root> d
(double)4.64159265358979312e+00
as well as the original API (but now an explicit cast is required as
CINT doesn't use the implicit one):
root> TBrowser* b = (TBrowser*) TPython::Eval( "ROOT.TBrowser()" )
root> b
(class TBrowser*)0x8d057b0
Files for new class PropertyHolder:
src/PropertyHolder.h
src/PropertyHolder.cxx
which is similar to MethodHolder, but holds on to public data types as
requested by Juan in the form of a python property. Not all conversions
are implemented, though, so not all types of data members can be accessed,
as I'm factoring the commonality out of PropertyHolder and MethodHolder.
Files for intercepting requests for Python classes:
src/TPyClassGenerator.h
src/TPyClassGenerator.cxx
which is only very rudimentary right now.
Changes to existing files:
o reduced number of loaded libs in ROOT.py
o set interval check in ROOT.py to follow python2.3
o generate dictionary for TPyReturn
o use TPyReturn for TPython::Eval
o use new style classes in RootWrapper
o collect public data members and enter in pyclass dict
o moved type scanning to Utility
This form allows you to request diffs between any two revisions of this file.
For each of the two "sides" of the diff,
enter a numeric revision.