Hi Francesc,

Some time ago (three weeks actually) I sent you a mail, but got no answer. As I have been working on some other stuff lately, that didn't disturb me. But now I'm beginning to feel concerned, hence this new mail.
I hope you have not yet forgotten Dimension Scales ;-)

On 2/1/06, [EMAIL PROTECTED] < [EMAIL PROTECTED]> wrote:
Hi Francesc,

Lately I've busy with some other stuff so I haven't spent much much working on adding the DImension Scale feature to PyTables since I sent my last mail.
Yesterday I've created a temporary function which return an Array ( tables.Array) from its reference.
This function is called "createArFromRef", and it is a function of hdf5Extension.AttributeSet (thus the Array created by this function is created like the ones in the "REFERENCE_LIST"

Now here is the kind of things I can make hanks to this new function :
[...]
>>> array1 = fileh.createArray(root, 'array1', (1, 2 ,3 ,4), "Array 1")
>>> array2 = fileh.createArray(root, 'array2', [3,3,3], "Array 2")
>>> a = array1.attrs.createArFromRef(array2.get_reference())
>>> a.read()
[3, 3, 3]
>>> b = array1.attrs.createArFromRef(array2.get_reference())
>>> b.read()
[3, 3, 3]
>>> a = array1.attrs.createArFromRef(array2.get_reference())
here I get a segmentation fault

To my mind the function that create Arrays is correct : the Array returned can be correctly read.
It can even be called several times without any problems.
But there's a problem with the garbage collector. Here an other test I made :
[...]
>>> a = array1.attrs.createArFromRef(array2.get_reference())
>>> a = "a"
here I get a segmentation fault : the Array stored under the variable a can't be deleted properly (Although the function tables.Node.__del__ seems to work fine with my Arrays)

Maybe a solution could be to store each Array created through this function in a new argument (something which would looks like tables.File._aliveNodes or tables.File._deadNodes). Thus the Array created would not be collected by the garbage collector.
But I wonder what would happen when the file would be closed : it would be useless to store this argument in the hdf5 file, so it would eventually be discarded. What would happen then ?

I would be glad to have your opinion about this (It could save me time).
Best regards.
--
Remi

Reply via email to