diff --git a/glotaran/builtin/io/netCDF/netCDF.py b/glotaran/builtin/io/netCDF/netCDF.py index 69f9b6b54..12fc47693 100644 --- a/glotaran/builtin/io/netCDF/netCDF.py +++ b/glotaran/builtin/io/netCDF/netCDF.py @@ -11,7 +11,8 @@ @register_data_io("nc") class NetCDFDataIo(DataIoInterface): def load_dataset(self, file_name: str) -> xr.Dataset | xr.DataArray: - return xr.open_dataset(file_name) + with xr.open_dataset(file_name) as ds: + return ds.load() def save_dataset( self,