Re: PyDEV + PyROOT

From: OKUMURA, Akira <oxon_at_ceres.phys.s.u-tokyo.ac.jp>
Date: Fri, 6 Feb 2009 10:46:52 +0900


Hello Wim and Brett,

Thank you for your comments.

Since PyDEV plugin does not read $HOME/.pystartup, touching functions/ classes is not a solution. Because it analyze the syntax and structures of python modules to be imported not on-the-fly but when I set the PYTHONPATH from Eclipse's preference panel.

>> import ROOT
>> h = ROOT.TH1D("h", "", 100, 0, 1)
>>
>> it says "Undefined variable from import: TH1D".
>
> That I don't understand?

This is an error from the auto syntax checker in Eclipse + PyDEV.

I agree that auto loading of all classes when importing ROOT, is not sufficient. Therefore it will be good idea if I can load all classes only when importing ROOT from Eclipse + PyDEV.

Regards,

OKUMURA, Akira oxon_at_ceres.phys.s.u-tokyo.ac.jp Department of Physics, The University of Tokyo 7-3-1 Hongo, Bunkyo-ku, Tokyo 113-0033
TEL/FAX +81 3-5841-4173/4059
Skype : okumura.akira

On 2009/02/06, at 3:07, WLavrijsen_at_lbl.gov wrote:

> Akira,
>
>> For example, when I type 'ROOT.' in a Eclipse editor window, PyDEV
>> lists
>> completion candidates, but there are only
>
> this list will grow as parts from the ROOT namespace are used. At
> issue is
> that generating place holders for all available classes would be
> very memory
> intensive, and given that the auto-loader can always get more (e.g.
> user
> defined) classes it would never be a complete picture anyway.
>
> Note that in general external functions do not provide informative
> to the
> python inspection tools. A couple of days ago, I checked in some new
> code
> that actually improves on that situation for PyROOT bound methods
> (this is
> for PyPy, but works great with pydoc as well). One addition that may
> work
> up to an extent (auto-loader again ...), would be the
> reimplementation of
> __dir__, but that is a python2.6 feature only.
>
>>
>
>> How can I make PyDEV recognize all classes/functions/variables of
>> ROOT?
>
> You could "touch" the ones that you like to use (or all the classes
> that
> are in ROOT's class table) in a python startup file. Not sure
> whether that
> is the way you want to go, though ...
>
> Best regards,
> Wim
> --
> WLavrijsen_at_lbl.gov -- +1 (510) 486 6411 -- www.lavrijsen.net
Received on Fri Feb 06 2009 - 02:47:02 CET

This archive was generated by hypermail 2.2.0 : Fri Feb 06 2009 - 17:50:01 CET