Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if read_grid:
datasets.insert(0, open_mdsdataset(
dirname, iters=None, delta_t=delta_t,
read_grid=True, swap_dims=False,
prefix=prefix, ref_date=ref_date, calendar=calendar,
geometry=geometry,
grid_vars_to_coords=grid_vars_to_coords,
endian=endian, chunks=chunks,
ignore_unknown_vars=ignore_unknown_vars))
# apply chunking
ds = xr.auto_combine(datasets)
if swap_dims:
ds = _swap_dimensions(ds, geometry)
return ds
store = _MDSDataStore(dirname, iternum, delta_t, read_grid,
prefix, ref_date, calendar,
geometry, endian,
ignore_unknown_vars=ignore_unknown_vars)
ds = xr.Dataset.load_store(store)
if swap_dims:
ds = _swap_dimensions(ds, geometry)
if grid_vars_to_coords:
ds = _set_coords(ds)
# turn all the auxilliary grid variables into coordinates
# if grid_vars_to_coords:
# for k in _grid_variables:
# ds.set_coords(k, inplace=True)
# ds.set_coords('iter', inplace=True)