silx icon indicating copy to clipboard operation
silx copied to clipboard

HDF5 table view bug for virtual datasets in the same file

Open woutdenolf opened this issue 3 years ago • 3 comments
trafficstars

Closes #3571

image

The first virtual source is

/data/id21/inhouse/eduardo/out/fitted_EP_701_1_859_12158.h5::/2.1/blisspymca.1/results/parameters/Al_K

Alternatively this could also be

.::/2.1/blisspymca.1/results/parameters/Al_K

I prefer the first (absolute path) because it might not be clear that a "dot" refers to the current file and not to the current directory.

woutdenolf avatar Dec 06 '21 15:12 woutdenolf

I would use:

os.path.abspath(filename) + firstExtSource[1:]

and

return os.path.join(os.path.dirname(os.path.abspath(filename)), firstExtSource)

if you want absolute paths everywhere.

vasole avatar Dec 06 '21 15:12 vasole

I would use:

os.path.abspath(filename) + firstExtSource[1:]

and

return os.path.join(os.path.dirname(os.path.abspath(filename)), firstExtSource)

if you want absolute paths everywhere.

this is a good question. Do we want absolute path everywhere. If we go for it I guess we should add somewhere information regarding if the virtual dataset contains some relative / absolute path. Because this is very convenient to have this information (even if for now it is here only partially because only the first virtual source is checked)

payno avatar Dec 06 '21 15:12 payno

@vasole filename is already an absolute path and it is the file that is open (i.e. the one containing the link, not the destination file). Then firstExtSource is the URI of the destination which is either

  • /abs/path/to/file.h5::/dataset/in/file (VDS)
  • rel/path/to/file.h5::/dataset/in/file (VDS)
  • .::/dataset/in/file (VDS) where the "dot" refers to filename.
  • /abs/path/to/file.edf (RAW EXT)
  • rel/path/to/file.edf (RAW EXT)

woutdenolf avatar Dec 06 '21 17:12 woutdenolf

Can this be merged? or it needs some rework?

t20100 avatar Sep 08 '22 14:09 t20100

I missed one case

  • ./path/to/file.h5::/dataset/in/file

woutdenolf avatar Nov 01 '22 09:11 woutdenolf

@woutdenolf does that cause trouble with silx view? Need a bug fix release?

t20100 avatar Nov 07 '22 14:11 t20100

the displayed URL is wrong but it doesn't affect anything else

woutdenolf avatar Nov 07 '22 18:11 woutdenolf

I'll make a bug fix as soon as I have time.

woutdenolf avatar Nov 07 '22 18:11 woutdenolf

OK, great! I opened issue #3716 for it for next release, so we don't forget it.

t20100 avatar Nov 08 '22 08:11 t20100