Hi,

I've been tinkering with integrating the ROOT library from CERN into Sage.  So 
far things work fairly well, and I'll be learning the Sage packaging system to 
make the library installable via the normal channels.

ROOT has its own plotting system which I would like to have work seamlessly 
with the Sage notebook.  After some searching, I see now that the interface to 
get 2D plots into the notebook is simply the local filesystem itself.  If I 
change the ROOT code to create a PNG on disk whenever its internal canvas 
object updates, then I see ROOT plots in the notebook.  (Kudos to whoever came 
up with this simple, yet powerful idea!)

However, I'd like to be able to intelligently detect when Sage is running in 
the notebook vs. interactively on the console and only auto-create PNG files in 
notebook mode.  Is there a standard technique for this?

Also, ROOT can produce 3D plots and has its own viewer in interactive mode.  
How should Sage libraries pass their 3D information to Jmol in the notebook?

One last question: PyROOT, the Python bindings for ROOT classes, is having some 
trouble dealing with integers in Sage because they are not one of the usual 
Python integer types.  It reports a problem in the CPython source file 
longobject.c whenever I pass a Sage integer to a wrapped C++ method expecting 
an integer parameter.  Has anyone else bumped into a weird longobject.c error 
when porting other libraries?  I'm still chasing things down on the PyROOT 
side, but I suspect this might be some compiled code calling a Python C API 
function to convert an object to a C integer which is not as flexible as the 
Python-level int() function.  Is there a standard work-around for this kind of 
problem that people have used in other libraries?

Thanks for any help you can provide!

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to