cdo-bindings icon indicating copy to clipboard operation
cdo-bindings copied to clipboard

Bug: returnXDataset=True and force=False are incompatible in the python bindings

Open kobebryant432 opened this issue 1 year ago • 0 comments

When using the force=False option to make use of the cache instead of recalculating it seems that it is no longer possible to return the result as an xarray Dataset. I would expect that the dataset is still returned based on the cached netcdf. This results in ds_regridded_cdo_python being an empty list, while in the /tmp/ directory the netcdf can be found.

import cdo
gridfile = "r360x180"
cdo = cdo.Cdo()

ds_regridded_cdo_python = cdo.remapbil(gridfile, input=ds, returnXDataset=True, force=False)

Without the force=False (default is True) an xr.Dataset is returned. Ideally whether or not the cache is used or the calculation is repeated I would expect to get an xr.Dataset. The cached netcdf could maybe be reloaded into an xr.Dataset if it exists and the force=False option is active?

kobebryant432 avatar Aug 02 '24 09:08 kobebryant432