From: Antonio V. <val...@co...> - 2005-05-11 14:06:32
|
Alle 15:10, mercoled=EC 11 maggio 2005, Francesc Altet ha scritto: > Antonio, > > I've uploaded your patch for dealing multidimensional attributes in > the SVN repository. I've modified it a bit so that: > > - When you save python scalars, they become saved as HDF5 scalars > (before, they were saved as arrays of shape (1,)), which is wrong IMO. I agree! I didn't modify that because of back compatibility reasons but I see that= you=20 solved this point.. > - When you save numarray scalars, they become saved as HDF5 scalars as > well. I'm hesitating here because I wonder myself whether saving them > as a pickle would be better. I really prefer the implemented solution > but, what do you think about? In my opinion saving numarray scalars as HDF5 scalars is the best choice. The problem is that when you get it back from file you always have a=20 Python_int or Python _float. Attributes can't have a "Flavor" That is why I suggested to map HDF5 numeric attributes onto numarray obje= cts=20 and handle all python objects using cpickle strings. This is absolutely unambiguous and allow the user to have the full contro= l=20 over HDF5 attributes. > - For keeping backward compatibility, I added code so that for old > PyTables files so that an HDF5 attribute with shape (1,) will be > mapped to a Python scalar. At the moment you introduce extra code for keeping backward compatibility= you=20 can add still a little more an have and attribute handling system complet= e=20 and clear. Ofcourse whatever solution you decide to adopt I will be happy to help yo= u. Let me know your decisions. > With that I think all the requirements for multidimensional attributes > are fulfilled (except perhaps how to serialize numarray scalars on > disk). > > Wait until a snapshot will be made this midnight in the carabos > repository of pytables in order to have a try at final code. > > I'll look into your second patch when I have more time (I'm a bit busy > lately :-/). Thanks for it anyway! > > Ciao, > > Francesc ciao > A Dimarts 10 Maig 2005 23:55, Antonio Valentino va escriure: > > Il giorno mar, 10-05-2005 alle 14:08 +0200, Francesc Altet ha scritto= : > > > Hola Antonio, > > > > > > Sorry for the late response, but I was very busy lately (PyTables 1= =2E0 > > > was the responsible of that ;) > > > > > > A Dijous 05 Maig 2005 22:37, Antonio Valentino va escriure: > > > > Hi Francesc, > > > > the problem on scalar values seems to be fixed now. > > > > In the new patch is included your test suite with some changes. > > > > Let me know if it is good for you. > > > > > > Thanks. It seems cleaner to me indeed. Unfortunately, the patch doe= s > > > not apply well against PyTables 1.0. Could you make the necessary > > > modifications to this? > > > > Hi Francesc, > > I have just uploaded the mdattr patch against PyTables 1.0. > > > > I also submitted a new patch that should provide a whider support for > > chunked layout datasets. > > Please take a look and let me know what do you think about. > > > > ciao > > > > [...] > > > > > Cheers, --=20 Antonio Valentino INNOVA - Consorzio per l'Informatica e la Telematica via della Scienza - Zona Paip I 75100 Matera (MT) Italy |