From: Ivan V. i B. <iv...@ca...> - 2005-01-16 15:36:14
|
On Sun, Jan 16, 2005 at 02:30:16PM +0100, Norbert Nemec wrote: [...] > How about generally defining __???item__ in parallel to the corresponding= =20 > __???attr__ ? [...] Hi, Norbert. In fact, since we discussed the possibility of using non-natural identifiers I clearly saw that __{get,del}item__ and __{get,del}attr__ should be interchangeable, to allow accessing members with non-natural names. Please note I that intentionally left out __set{item,attr}__ because this is a greater change. File.create*() calls would be changed to direct constructor invocation for leaves and groups, a thing which I definetly think Right and perfectly plausible (but I might be wrong). > In a further step, it might even be a good idea, to make __???item__ the= =20 > standard way that is used everywhere within the pytables library and=20 > __???attr__ just an additional option falling back to __???item__ [...] Well, that would make code a lot clearer and uniform. It seems to be that it would also be quite cool to support entire node and attribute paths in the __???item__ interface. This would make lots of File methods unnecessary (but they would be kept for compatibility). Imagine issuing: =20 >>> # h5file.root.detector.readout <=3D> >>> tbl =3D h5file.root['detector/readout'] >>> # h5file.root.column['name column'].attrs.temperature <=3D> >>> attr =3D h5file.root['column/name column/attrs/temperature'] I think this should be quite easy to implement and would make building pathnames and traversing them a pleasure, keeping interactive behaviour the same. Maybe even File.__???{item,attr}__ could be tailored to defer to the root group object invocations using an item / attribute starting with '/', so that using h5file['/detector/readout'] would be possible... Regards, Ivan import disclaimer --=20 Ivan Vilata i Balaguer >qo< http://www.carabos.com/ C=E1rabos Coop. V. V V Enjoy Data "" |