Reflex dictionaries, namespaces and class name clashes

From: Brett Viren <bv_at_bnl.gov>
Date: Tue, 19 May 2009 15:50:46 -0400


Hi,

I use the C++ library libmore (more.sf.net) to parse ENSDF data files and am trying to use Reflex[1] created dictionaries to access some of the libmore objects in Python. Two classes in particular have the same name but one is in a sub-namespace of the other. Here are their entries in the selection XML file:

<class name="more::phys::nucleus"/>
<class name="more::phys::ens::nucleus"/>

The former just holds Z & A values while the latter gives access to the relevant, parsed ENSDF data sets. The following ipython session shows me trying to create the latter, but instead I am given former. On the other hand, trying to create "more::phys::nucleus" will correctly return its own Python class. That is, both return the shorter "more::phys::nucleus".



In [1]: import PyCintex

In [2]: PyCintex.loadDict("GenDecayDict")

In [3]: ens_nucleus = PyCintex.makeNamespace("more::phys::ens::nucleus")

In [4]: ens_nucleus
Out[4]: <class 'PyCintex.more::phys::nucleus'>

In [5]: n = ens_nucleus()

In [6]: n
Out[6]: <ROOT.more::phys::nucleus object at 0x9130dc0>


(Here, "GenDecay" is my CMT package that uses libmore.)

Do I need to do something special to make this namespace organization work? Or am I making the wrong Python invocations in the first place?

Thanks,
-Brett.

[1] Debian i386, GCC 4.3, ROOT 5.22a, Python 2.5.4 from an "LHCb-like" development environment. Received on Tue May 19 2009 - 21:50:50 CEST

This archive was generated by hypermail 2.2.0 : Wed May 20 2009 - 05:50:03 CEST