El dv 17 de 03 del 2006 a les 11:35 -0500, en/na
[EMAIL PROTECTED] va escriure:
> It may be that I don't understand exactly what H5Fmount is doing. If the
> mount has to be done dynamically, ie, at runtime, then there may be no
> advantage if the common filename has to be stored as an attribute. The
> advantage would be if an external file could be mounted in advance and made
> to persist, then the advantage would be that the client scripts wouldn't
> have to manage separate files and handles.

Indeed, I can see merits in the automatic mounting thing. So here it
goes my proposal:

What people would think on introducing a special prefix for attributes
of groups (say '_m_') containing a file path name?. With this, each time
that a group is opened, PyTables would be able to look at these '_m_'
attrs (only if they belongs to groups) and proceed to automagically
mount the pointed files. The mount point would be the name of the
attribute without the '_m_' prefix.

This is better viewd through an example. Lets suppose that we have the
an attribute of the '/group' called '_m_my_mount_point', and that its
contents is a string with the name of another HDF5 file:

>>> f.root.group._v_attrs._m_my_mount_point 
"your_file_path_name"

then, when accessing to the '/group', people will see something like:

>>> f.root.group
/group (Group) 'The parent of the mount group'
  children := ['my_mount_point' (Group), ....]

so that the data contained in 'your_file_path_name' can be accessible in
the next way:

>>> f.root.group.my_mount_point.[your_objects_for_mounted_file_here]

Of course, a manual way to mount files would be added as well. Something
like:

>>> f.mountFile('your_file_path_name', '/group/my_mount_point')

I definitely think that this would be a good thing.

>
> Another solution may be to have a simple python configuration file for each
> database that simply points to each external file:
> 
> # database1.conf
> common = "/path/to/shared.h5"
> results1 = "/path/to/run1.h5"
> 
> # database2.conf
> common = "/path/to/shared.h5"
> results2 = "/path/to/run2.h5"
> 
> etc.
> 
> I suppose this is one of the nice things about Python, eh? So many
> possibilities...

Sure!

Cheers,

-- 
>0,0<   Francesc Altet     http://www.carabos.com/
V   V   Cárabos Coop. V.   Enjoy Data
 "-"




-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
_______________________________________________
Pytables-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pytables-users

Reply via email to