Hi Jacob,

[Please, try to write to the list from a subscribed address.  Thanks!]

> ----------  Missatge transmès  ----------
>
> Subject: Auto-discard notification
> Date: Wednesday 27 May 2009
> From: pytables-users-boun...@lists.sourceforge.net
> To: pytables-users-ow...@lists.sourceforge.net
>
> The attached message has been automatically discarded.
> -------------------------------------------------------
> Hi,
>
> Has anybody had luck attaching large attributes to pytables nodes?  I'm
> trying to do so but am getting an HDF5 error.  The below example crashes
> when the dictionary contains ~2550 values or more, but works for fewer. 
> The message I get is below the code.  I know this is not a very performant
> way to store large amounts of metadata but it'd be good to know where the
> cutoff is between working and crashing.  I'm using Mac OS X 10.6, python
> 2.5.2, pytables 2.1.1, and HDF5 1.6.7, in case it matters.

Yep.  The HDF5 1.6.x series has a limit of 16 KB for each attribute [1].  
Newer versions of HDF5 may have raised this limit, but I don't know for sure.  
At any rate, it is very desirable that you use a Leaf instead of an attribute 
for large datasets.

[1] http://www.hdfgroup.org/HDF5/doc1.6/UG/13_Attributes.html

Hope that helps,

>
> Thanks,
> Jacob
>
> ----
>
> import numpy as np
> import tables as pt
>
> tbl = pt.openFile('/tmp/test1','w')
> node = tbl.createGroup(tbl.root, 'group1')
> array = tbl.createArray(tbl.root.group1, 'data',
> np.ones((100,100),'float32'))
>
> testAttr = {}
> for i in xrange(10000):
>     testAttr[i]='value %d'%i
>
> array.attrs.testAttr = testAttr
>
> tbl.close()
> --------------------------------
> ja...@fudd:~/temp/pyt_attrs$ python test1.py
> HDF5-DIAG: Error detected in HDF5 library version: 1.6.7 thread 0.  Back
> trace follows.
>   #000: H5A.c line 187 in H5Acreate(): unable to create attribute
>     major(18): Attribute layer
>     minor(29): Unable to initialize object
>   #001: H5A.c line 293 in H5A_create(): unable to update attribute header
> messages
>     major(18): Attribute layer
>     minor(29): Unable to initialize object
>   #002: H5O.c line 1275 in H5O_modify(): unable to write object header
> message
>     major(12): Object header layer
>     minor(25): Write failed
>   #003: H5O.c line 1394 in H5O_modify_real(): unable to create new message
>     major(12): Object header layer
>     minor(29): Unable to initialize object
>   #004: H5O.c line 1658 in H5O_new_mesg(): object header message is too
> large
>     major(12): Object header layer
>     minor(29): Unable to initialize object

-- 
Francesc Alted

------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT 
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, & 
iPhoneDevCamp as they present alongside digital heavyweights like Barbarian 
Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com 
_______________________________________________
Pytables-users mailing list
Pytables-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pytables-users

Reply via email to