Skip to content

Commit cf37939

Browse files
committed
Fix ESMF file loading by forcing netCDF4 engine for .nc files
1 parent 3ca080a commit cf37939

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

uxarray/core/api.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,9 @@ def open_grid(
107107

108108
else:
109109
# Attempt to use Xarray directly for remaining input types
110+
# Force netCDF4 engine for .nc files to avoid scipy reader issues
111+
if isinstance(grid_filename_or_obj, (str, os.PathLike)) and str(grid_filename_or_obj).endswith('.nc'):
112+
kwargs.setdefault('engine', 'netcdf4')
110113
grid_ds = xr.open_dataset(grid_filename_or_obj, chunks=grid_chunks, **kwargs)
111114
grid = Grid.from_dataset(grid_ds, use_dual=use_dual)
112115

0 commit comments

Comments
 (0)