A Thursday 17 April 2008, [EMAIL PROTECTED] escrigué:
> All, I've just attempted an install of pytables and everything seemed
> to be fine until I ran the test script: See below for output. Any
> help would be appreciated.
>
> Also, does pytables let you name a variable with "." in the middle
> without it being interpreted hierarchyical? e.g. sensor.pressure is
> the name, not the hierarchical structure. If so, how do I read in or
> access the variable? **
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
>=-=-=-= PyTables version: 2.0.3
> HDF5 version: 1.6.7
> NumPy version: 1.0.4
> Zlib version: 1.2.3
> BZIP2 version: 1.0.4 (20-Dec-2006)
> Python version: 2.5.1 (r251:54863, Sep 21 2007, 22:46:31)
> [GCC 4.2.1 (SUSE Linux)]
> Platform: linux2-x86_64
> Byte-ordering: little
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
>=-=-=-=
>
>
> Error output from tables.test()
[snip]
Mmm, all the failures comes from the doctest test units. Which Python
interpreter are you using to run the tests? Please can you try plain
Python through:
$ python -c "import tables; tables.test()"
Regarding the second question, you can always access non-Python
identifiers through File.getNode() and File.getNodeAttr() calls. See
this example:
In [1]: import tables
In [2]: f = tables.openFile("/tmp/prova.py", "w")
In [3]: a = f.createArray(f.root, 'node.var', [1,2])
/usr/lib/python2.5/site-packages/tables/path.py:102: NaturalNameWarning:
object name is not a valid Python identifier: 'node.var'; it does not
match the pattern ``^[a-zA-Z_][a-zA-Z0-9_]*$``; you will not be able to
use natural naming to access this object; using ``getattr()`` will
still work, though
NaturalNameWarning )
In [4]: b = f.setNodeAttr(a, 'attr.var', 3)
/usr/lib/python2.5/site-packages/tables/path.py:102: NaturalNameWarning:
object name is not a valid Python identifier: 'attr.var'; it does not
match the pattern ``^[a-zA-Z_][a-zA-Z0-9_]*$``; you will not be able to
use natural naming to access this object; using ``getattr()`` will
still work, though
NaturalNameWarning )
In [5]: a2 = f.getNode('/node.var')
In [6]: f.getNo
f.getNode f.getNodeAttr
In [6]: b2 = f.getNodeAttr(a2, 'attr.var')
In [7]: a2
Out[7]:
/node.var (Array(2,)) ''
atom := Int32Atom(shape=(), dflt=0)
maindim := 0
flavor := 'python'
byteorder := 'little'
chunkshape := None
In [8]: b2
Out[8]: 3
Note that the warnings are a bit confusing (getattr() call doesn't exist
any more). I've filed a ticket about this:
http://www.pytables.org/trac/ticket/168
Cheers,
--
>0,0< Francesc Altet http://www.carabos.com/
V V Cárabos Coop. V. Enjoy Data
"-"
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Pytables-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pytables-users