Describing the Files class, page 55 of the PyTables 1.3.3 manual says:

trMap -- A dictionary that maps node names between PyTables and HDF5
   domain names. Its initial values are set from the trMap parameter
   passed to the openFile function. You can change its contents after
   a file is opened and the new map will take effect over any new
   object added to the tree.


I have the following test case which does not work for the second try:

import tables
def test(f):
    print f.listNodes('/Xbsxffe_info/X0')
    p = f.getNode('/Xbsxffe_info/X0/Xversion_id')
    print p.read()

map = {'Xbsxffe_info': 'bsxffe_info', 'X0': '0', 'Xversion_id': 'version_id'}
fp1 = 
tables.openFile('/data/tmp/hoel/GLPy_numpy_conversion/test/data/motor.bmh', 
mode='r',
                     trMap=map)
test(fp1)
fp1.close()
fp2 = 
tables.openFile('/data/tmp/hoel/GLPy_numpy_conversion/test/data/motor.bmh', 
mode='r',
                     trMap={})
fp2.trMap = fp2.trMap.update(map)
test(fp2)
fp2.close()

I get:
...
Traceback (most recent call last):
  File "tables_test2.py", line 15, in <module>
    test(fp2)
  File "tables_test2.py", line 3, in test
    print f.listNodes('/Xbsxffe_info/X0')
  File 
"/usr/local/gltools/python/Python-2.5/linux/lib/python2.5/site-packages/tables/File.py",
 line 1208, in listNodes
    group = self.getNode(where)  # Does the parent exist?
  File 
"/usr/local/gltools/python/Python-2.5/linux/lib/python2.5/site-packages/tables/File.py",
 line 952, in getNode
    node = self._getNode(nodePath)
  File 
"/usr/local/gltools/python/Python-2.5/linux/lib/python2.5/site-packages/tables/File.py",
 line 898, in _getNode
    node = parentNode._g_loadChild(childName)
  File 
"/usr/local/gltools/python/Python-2.5/linux/lib/python2.5/site-packages/tables/Group.py",
 line 365, in _g_loadChild
    self._g_checkHasChild(childName)
  File 
"/usr/local/gltools/python/Python-2.5/linux/lib/python2.5/site-packages/tables/Group.py",
 line 353, in _g_checkHasChild
    % (self._v_pathname, childName))
tables.exceptions.NoSuchNodeError: group ``/`` does not have a child named 
``Xbsxffe_info``
Closing remaining opened files...  
/data/tmp/hoel/GLPy_numpy_conversion/test/data/motor.bmh... done.

So, how do I successfully change the content of the trMap?

Kind regards

Berthold Höllmann
-- 
Germanischer Lloyd AG
CAE Development
Vorsetzen 35
20459 Hamburg
Phone: +49(0)40 36149-7374
Fax: +49(0)40 36149-7320
e-mail: [EMAIL PROTECTED]
Internet: http://www.gl-group.com



This e-mail and any attachment thereto may contain confidential information 
and/or information protected by intellectual property rights for the exclusive 
attention of the intended addressees named above. Any access of third parties 
to this e-mail is unauthorised. Any use of this e-mail by unintended recipients 
such as total or partial copying, distribution, disclosure etc. is prohibited 
and may be unlawful. When addressed to our clients the content of this e-mail 
is subject to the General Terms and Conditions of GL's Group of Companies 
applicable at the date of this e-mail. 

If you have received this e-mail in error, please notify the sender either by 
telephone or by e-mail and delete the material from any computer.

GL's Group of Companies does not warrant and/or guarantee that this message at 
the moment of receipt is authentic, correct and its communication free of 
errors, interruption etc.

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Pytables-users mailing list
Pytables-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pytables-users

Reply via email to