There's yet another xarray 2026.4.0 incompatibility...
Problem
These lines in graphcast/rollout.py line 320:
# Create copies to avoid mutating inputs.
inputs = xarray.Dataset(inputs)
targets_template = xarray.Dataset(targets_template)
forcings = xarray.Dataset(forcings)
produce following error when running the rollout cell of the notebook cell inside graphcast_demo.ipynb:
TypeError: Passing a Dataset as data_vars to the Dataset constructor is not supported. Use ds.copy() to create a copy of a Dataset.
Reason
Again, the reason is breaking changes in Xarray 2026.4.0:
Passing a Dataset as data_vars to the Dataset constructor now raises TypeError. This was never intended behavior and silently dropped attrs. Use Dataset.copy() instead (GH11095). By Kristian Kollsga.
Proposed Solution
# Create copies to avoid mutating inputs.
inputs = inputs.copy()
targets_template = targets_template.copy()
forcings = forcings.copy()
(I did not check the complete repository for further deprecated usages!)
There's yet another xarray 2026.4.0 incompatibility...
Problem
These lines in
graphcast/rollout.pyline 320:produce following error when running the rollout cell of the notebook cell inside
graphcast_demo.ipynb:Reason
Again, the reason is breaking changes in Xarray 2026.4.0:
Proposed Solution
(I did not check the complete repository for further deprecated usages!)