Hi Francesc,

On 1/18/06, Francesc Altet <[EMAIL PROTECTED]> wrote:

The next code can do the trick (details omitted):

array_id = H5Rdereference(self.file_id, H5R_OBJECT, <void *>&ref)
class_id = get_attribute_string_sys(array_id, "CLASS")

and you will receive the CLASS value in python string class_id.

Wow ! You're perfectly right ! Then I was wrong when I repeatedly asserted that the attributes can't be retrieved from a reference, or from an ID returned by "H5Rdereference(...)" : please accept my apologies for this.
Thanks to "get_attribute_string_sys", I have been able to successfully retrieve the 'CLASS' attribute from a reference, and the attributes 'TITLE', 'VERSION', 'FLAVOR' too. Then it will be easy to build the primary Pytable object.
The only attributes I was not able to correctly retrieve are the 'REFERENCE_LIST' and 'DIMENSION_LIST' (as they are not strings). But it should be easy to work arond this problem.

Yes, this is the idea, but instead of keeping 'Reference' instances,
these lists can contain the proper PyTables objects, like
'DimensionScale', 'Array', 'EArray', etc. The later approach is much
more flexible for both the users and developers, IMO.
 
I fully agree with you.
 
Please, do not hesitate to tell me if you have more questions about
this.

I have just a last question. Let's say I build a PyTable object from a reference. This new PyTable object (let's call it 'new_object') will have the same numarray of values as the original object (let's call it 'original_object'), and the same attributes. Now let's say I modify an attribute of 'new_object'. Will the attribute of 'original_object' be modified ?
If I'm correct, the answer is "no". 
As far as "system attributes" ('CLASS', 'TITLE', 'FLAVOR'...) are concerned, that's not a problem, given that these attributes must not be modified.
But as far "user attributes" are concerned, this could raise problems.
So that's why I think 'new_object' shouldn't own only the "system_attributes" of 'original_object'.

Best regards
--
Remi

Reply via email to