Open DFEvans opened 1 week ago
Thanks for opening your first issue here at xarray! Be sure to follow the issue template! If you have an idea for a solution, we would really welcome a Pull Request with proposed changes. See the Contributing Guide for more. It may take us a while to respond here, but we really value your contribution. Contributors like you help make xarray better. Thank you!
@DFEvans The traceback indicates it used h5netcdf
, did you also use h5netcdf
when calling locally or used open_dataset? Could you explicitly request engines h5netcdf
and netcdf4
to see if this is a single h5netcdf issue or if both engines are affected?
I remember there have been issues wrt fsspec not working over the network but locally, but can't find them atm.
So, a few more bits:
netcdf4
requires a filepath, not an opened file handle (whether fsspec
or just open
). I've forced the engine to h5netcdf
locally just in case, but it still opens successfullyimport netCDF4
occurs in the file - it's not used in the code I'm working on, but was a leftover from a pre-DataTree implementation. This suggests that there's some nasty interaction between the various libraries!import netCDF4
, the file opens successfully, but a segfault occurs when the script ends. I'll open a separate issue for that if it seems an actual problem (I think it's to do with the order in which close
s are called).Thanks for the details, @DFEvans.
- Without
import netCDF4
, the file opens successfully, but a segfault occurs when the script ends. I'll open a separate issue for that if it seems an actual problem (I think it's to do with the order in whichclose
s are called).
Not sure, but you also might use the with-contextmanager with xr.open_datatree
, this should normally take care of close
.
Might be also caused by lazy importing in xarray?
What happened?
Attempting to open a (specific?) HDF5 file over the network via
fsspec
andxarray.open_datatree()
fails with an error inside h5py, ifimport netCDF4
occurs in the scriptWhat did you expect to happen?
The dataset opens successfully
Minimal Complete Verifiable Example
MVCE confirmation
Relevant log output
Anything else we need to know?
I see the same issue attempting to read the dataset over HTTPS and directly from S3, both on NASA's own server and in my own S3 bucket. The file opens successfully locally, and via
xarray.open_dataset
.Give me a shout if you need the file in question put somewhere, with a suggestion of a location - it's ~100MB in size.
Environment