European-XFEL / h5glance

Explore HDF5 files in terminal & HTML views
BSD 3-Clause "New" or "Revised" License
68 stars 8 forks source link

Should display each object only once by default #4

Closed aparamon closed 6 years ago

aparamon commented 6 years ago

HDF5 objects (groups and datasets) may be linked from multiple locations, similar to file system hard links. When displaying a file with multiple hard links to an object, it is proposed that such object is displayed in detail only the first time.

When a group is encountered for a second and consecutive times, it is proposed that it is not further expanded. To indicate the multiple-link case, ellipsis ... symbol may be used, possibly along with a reference to the first-encountered link (something like: = /first/encountered/link).

It might be wise to implement an option to disable the smart behavior.

takluyver commented 6 years ago

For files on the filesystem, I would check for hardlinks with the device & inode number. What's the equivalent for objects in an HDF5 file? Is it the 'Location' I see with h5ls -v ?

aparamon commented 6 years ago

I believe it's h5o.get_info(obj.id).addr.