You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Starting with xarray v2025.08.0 simply round tripping a netCDF4 file, that is, doing a load_dataset then immediately calling to_netcdf on the dataset. Is moving all the variables listed in the "coordinates" attribute to be moved to the end of the variables in the resulting netCDF.
Before I gave this the whole bug report treatment, more specifically because I haven't thought of how to actually make a reproducible example yet. I wanted to ask the xarray maintainers what the indented behavior is here, if any. Should I expect xarray maintain the order of variables in the input file as best it can?
When searching for the same or related issues, I found #10706 which feels close, however the behavior I've noticed here is that that actual variables in the file are being reordered, not the variables names as they appear in the coordinates attributes. I've also not done anything to modify the data within xarray.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Starting with xarray v2025.08.0 simply round tripping a netCDF4 file, that is, doing a
load_datasetthen immediately callingto_netcdfon the dataset. Is moving all the variables listed in the "coordinates" attribute to be moved to the end of the variables in the resulting netCDF.Before I gave this the whole bug report treatment, more specifically because I haven't thought of how to actually make a reproducible example yet. I wanted to ask the xarray maintainers what the indented behavior is here, if any. Should I expect xarray maintain the order of variables in the input file as best it can?
When searching for the same or related issues, I found #10706 which feels close, however the behavior I've noticed here is that that actual variables in the file are being reordered, not the variables names as they appear in the coordinates attributes. I've also not done anything to modify the data within xarray.
Obligatory xkcd.
Beta Was this translation helpful? Give feedback.
All reactions