fsspec / kerchunk

Cloud-friendly access to archival data
https://fsspec.github.io/kerchunk/
MIT License
307 stars 78 forks source link

Can't create references for pathlib Paths #520

Open ashiklom opened 4 hours ago

ashiklom commented 4 hours ago

Trying to pass a pathlib.Path object to Kerchunk fails with "type of input h5f not recognised", presumably because in this conditional, isinstance(Path("something"), str) == False.

https://github.com/fsspec/kerchunk/blob/718ab9c3a18ea79973cae987fac2456d6590ab97/kerchunk/hdf.py#L94-L108

Suggest instead: isinstance(h5f, (pathlib.Path, str))

martindurant commented 4 hours ago

OK, that change will work.