Closed veenstrajelmer closed 8 months ago
However, I also noticed it works when calling ds = xr.decode_cf(ds) upon trying to create a testcase for this situation.
You mean, the original connectivity does not get changed when you called xr.decode?
That makes sense to me, the xr.decode
call will just create a copy.
The difference with open_dataset is just the order right?
For the constructor: ds -> decode -> new_ds -> constructor
From open_dataset: file -> decode -> ds
@Huite your suggestion works and I have implemented it in this PR including a testcase that failed before the
.copy()
was added. I guess this is therefore a valid fix. However, I also noticed it works when callingds = xr.decode_cf(ds)
upon trying to create a testcase for this situation. This is unexpected, sinceds = xr.open_dataset(file_nc)
also has adecode_cf=True
as default. Maybe this triggers you to find a solution elsewhere in the code. If not, I think this PR can be merged.