Loading TCTracks with from_ibtracs_netcdf
does not properly close the filestream
#920
Labels
from_ibtracs_netcdf
does not properly close the filestream
#920
Describe the bug
When reading the
IBTrACS.ALL.v04r00.nc
file withfrom_ibtracs_netcdf()
the file is opened withxr.open_dataset(ibtracs_path)
which opens a stream to the file that is not closed afterwards. I had problems with this on euler when trying to access the file at later stages with the following error:OSError: [Errno -101] NetCDF: HDF error: '/cluster/work/climate/sjuhel/climada/data/IBTrACS.ALL.v04r00.nc'
To Reproduce
I haven't been able to reproduce the issue on a local computer. This is possibly related to NetCDF too.
Expected behavior
The file is properly closed once the data is loaded.
See also: pydata/xarray#2887
Climada Version: 4.1.1
System Information (please complete the following information):
Additional context
I don't think this is a critical problem, but the following would probably be a better way to handle the opening of the file:
From:
climada_python/climada/hazard/tc_tracks.py
Line 469 in 8f89ce1
to:
The text was updated successfully, but these errors were encountered: