github pydata/xarray v2025.09.0

one day ago

This release brings a number of small improvements and fixes, especially related to writing DataTree objects and netCDF files to disk.

Thanks to the 13 contributors to this release: Benoit Bovy, DHRUVA KUMAR KAUSHAL, Deepak Cherian, Dhruva Kumar Kaushal, Giacomo Caria, Ian Hunt-Isaak, Illviljan, Justus Magin, Kai Mühlbauer, Ruth Comer, Spencer Clark, Stephan Hoyer and Tom Nicholas

New Features

Support rechunking by SeasonResampler for seasonal data analysis (GH10425, PR10519). By Dhruva Kumar Kaushal.

Add convenience methods to Coordinates (PR10318) By Justus Magin.

Added load_datatree() for loading DataTree objects into memory from disk. It has the same relationship to open_datatree(), as load_dataset() has to open_dataset(). By Stephan Hoyer.

compute=False is now supported by DataTree.to_netcdf() and DataTree.to_zarr(). By Stephan Hoyer.

open_dataset will now correctly infer a path ending in .zarr/ as zarr By Ian Hunt-Isaak.

Breaking changes

Following pandas 3.0 (pandas-dev/pandas#61985), Day is no longer considered a Tick-like frequency. Therefore non-None values of offset and non-"start_day" values of origin will have no effect when resampling to a daily frequency for objects indexed by a xarray.CFTimeIndex. As in pandas-dev/pandas#62101 warnings will be emitted if non default values are provided in this context (GH10640, PR10650). By Spencer Clark.

The default backend engine used by Dataset.to_netcdf() and DataTree.to_netcdf() is now chosen consistently with open_dataset() and open_datatree(), using whichever netCDF libraries are available and valid, and preferring netCDF4 to h5netcdf to scipy (GH10654). This will change the default backend in some edge cases (e.g., from scipy to netCDF4 when writing to a file-like object or bytes). To override these new defaults, set engine explicitly. By Stephan Hoyer.

The return value of Dataset.to_netcdf() without path is now a memoryview object instead of bytes (PR10656). This removes an unnecessary memory copy and ensures consistency when using either engine="scipy" or engine="h5netcdf". If you need a bytes object, simply wrap the return value of to_netcdf() with bytes(). By Stephan Hoyer.

Bug fixes

Fix contour plots not normalizing the colors correctly when using for example logarithmic norms. (GH10551, PR10565) By Jimmy Westling.

Fix distribution of auto_complex keyword argument for open_datatree (GH10631, PR10632). By Kai Mühlbauer.

Warn instead of raise in case of misconfiguration of unlimited_dims originating from dataset.encoding, to prevent breaking users workflows (GH10647, PR10648). By Kai Mühlbauer.

DataTree.to_netcdf() and DataTree.to_zarr() now avoid redundant computation of Dask arrays with cross-group dependencies (GH10637). By Stephan Hoyer.

DataTree.to_netcdf() had h5netcdf hard-coded as default (GH10654). By Stephan Hoyer.

Internal Changes
Run TestNetCDF4Data as TestNetCDF4DataTree through open_datatree (PR10632). By Kai Mühlbauer.

Don't miss a new xarray release

NewReleases is sending notifications on new releases.