El dc 22 de 11 del 2006 a les 15:05 +0100, en/na Berthold Höllmann va escriure: > I tried to do some fancy things utilizing trMap which work with older > pyTable versions, but seems to lead to strange errors in pyTables > 1.3.3.
Mmm, that's strange, becaure there exists some tests for trMap (see test_basics.py) that seems to pass just fine. > > I can't predict the names of the groups and arrays I want to write. To > avoid the usage of reserved names I want to precede each node name > with a '_' for Python usage. I used > > class _myTrMap(dict): > def get(self, one, two): > return self[one] > def __getitem__(self, item): > return item[1:] > > as my dictionary class, but this does not work anymore. I now extend > the files trMap prior to accessing the nodes and it seems to work for > me now. Starting from some versions ago (I don't remember exactly when), PyTables lets you use whatever string as a node name. The only thing is that if these names are Python reserved words, you cannot use them in natural naming; but there is always File.getNode() that always works. HTH, -- Francesc Altet | Be careful about using the following code -- Carabos Coop. V. | I've only proven that it works, www.carabos.com | I haven't tested it. -- Donald Knuth ------------------------------------------------------------------------- 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