scipp / scippnexus

h5py-like utility for NeXus files with seamless scipp integration
https://scipp.github.io/scippnexus/
BSD 3-Clause "New" or "Revised" License
3 stars 4 forks source link

Support windows-style path...? #240

Open YooSunYoung opened 2 months ago

YooSunYoung commented 2 months ago

We're not handling str path and just pass it to h5py.File here

https://github.com/scipp/scippnexus/blob/94779e6d5e10666eaccc7d343079f9762ef9e3ea/src/scippnexus/file.py#L50-L53

But maybe we can wrap it with pathlib.Path to make sure it works...?

Since you copy + paste from windows finder, it gives you path with \ but users might not know of pathlib.Path, especially when you're using high-level interface like workflows.

jl-wynen commented 1 month ago

I tried it in a Windows VM and it seems to work with backslashes. But you have to remember to use a raw string. Otherwise, backslashes are interpreted as escape sequences. (This is not very nice for users but there is nothing we can do about it.)

YooSunYoung commented 1 month ago

Ah ha.

I think it'll help if we have that information in the docstring of the FilePath type in essreduce and File object.