NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI · #1158 most downloaded on PyPI
N-D labeled arrays and datasets in Python
Last release 6 days ago
29 Sep 2026
Ships fairly regularly
a new release about every 6 weeks
Nearly every release is documented
notes for 60 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
11 years old
107 releases · first in 2016
This release adds read support for Zarr V3 rectilinear (variable-sized) chunks, Arrow PyCapsule export for class: DataArray , a new meth: DataArray.pl
This release adds read support for Zarr V3 rectilinear (variable-sized) chunks, Arrow PyCapsule export for :py:class:DataArray, a new :py:meth:DataArray.plot.lines plotting method, :py:class:DataTree support in :py:func:apply_ufunc, and flox-accelerated groupby medians. Bottleneck is now disabled by default, the remaining zarr-python 2 compatibility code has been removed, and the minimum h5netcdf version is now 1.8. It also includes many bug fixes.
This is the last xarray release that will support Python 3.11. Future releases will require Python 3.12 or later.
Thanks to the 45 contributors to this release:
ANIRUDDHA ADAK, Ahmet Kamer Çivi, Albert Yau, Andrew Scherer, Anirban Mandal, Aryan Singh K., Asish Kumar, Chandan P, Charles Turner, Deepak Cherian, Devraj Pal, Dipak Chaudhari, Eltsefon Mark, Evan Lyall, Illviljan, Joe Hamman, Johnson K C, Jules Chéron, Justus Magin, Kropiunig, Marcus Campbell, Mark Harfouche, Matt Van Horn, Matthew Rocklin, Matthias Schabel, Michael Niklas, Nick Hodgskin, Patrick N. Raanes, Peter Hron, Puneet Dixit, QinXi, Samuel Le Meur-Diebolt, Spencer Clark, Stanley C, Stephan Hoyer, Thomas Kluyver, Tom Nicholas, dsk0425-sketch, genrichez, hushen, imam, omsatpute61-afk, stepit, whn and ✨Sarah Z✨
generate_aggregations.py by @VeckoTheGecko in #11489generate-aggregations Pixi task and CI workflow by @VeckoTheGecko in #11495issue-from-pytest-log-action to v1.6.2 by @keewis in #11500jupyterlite-sphinx by @keewis in #10299BooleanCoder from zarr writes by @elyall in #11318DatasetGroupBy.xyz and DatasetRolling.xyz by @charles-turner-1 in #11521Day frequency by @spencerkclark in #11547TestNetCDF4ClassicViaH5NetCDFData tests by @spencerkclark in #11550pd.DateOffset in isinstance by @spencerkclark in #11548Dataset._rename() docstring by @charles-turner-1 in #11557spharmgrid to Xarray ecosystem page by @mwyau in #11568Full Changelog: v2026.07.0...v2026.09.0
One column per quarter.
This release adds read support for Zarr V3 rectilinear (variable-sized) chunks, Arrow PyCapsule export for DataArray, a new DataArray.plot.lines plotting method, DataTree support in apply_ufunc, and flox-accelerated groupby medians. Bottleneck is now disabled by default, the remaining zarr-python 2 compatibility code has been removed, and the minimum h5netcdf version is now 1.8. It also includes many bug fixes.
Warning
This is the last xarray release that will support Python 3.11. Future releases will require Python 3.12 or later.
Thanks to the 45 contributors to this release: ANIRUDDHA ADAK, Ahmet Kamer Çivi, Albert Yau, Andrew Scherer, Anirban Mandal, Aryan Singh K., Asish Kumar, Chandan P, Charles Turner, Deepak Cherian, Devraj Pal, Dipak Chaudhari, Eltsefon Mark, Evan Lyall, Illviljan, Joe Hamman, Johnson K C, Jules Chéron, Justus Magin, Kropiunig, Marcus Campbell, Mark Harfouche, Matt Van Horn, Matthew Rocklin, Matthias Schabel, Michael Niklas, Nick Hodgskin, Patrick N. Raanes, Peter Hron, Puneet Dixit, QinXi, Samuel Le Meur-Diebolt, Spencer Clark, Stanley C, Stephan Hoyer, Thomas Kluyver, Tom Nicholas, dsk0425-sketch, genrichez, hushen, imam, omsatpute61-afk, stepit, whn and ✨Sarah Z✨
Support reading Zarr V3 arrays with rectilinear (variable-sized) chunk grids. Using this feature needs zarr-python >= 3.2 with zarr.config.set({"array.rectilinear_chunks": True}); xarray's minimum supported zarr version is unchanged. Writing rectilinear chunks from xarray is not yet supported (11592, extracted from 11279). By Max Jones and Tom Nicholas.
Added PyArrowCapsule interface to DataArray (__arrow_c_schema__ and __arrow_c_stream__), enabling near zero-copy export to pyarrow, polars or duckdb (11338). By Jules Chéron.
Added new plot method DataArray.plot.lines which allows creating line plots efficiently in a similar manner to DataArray.plot.scatter, also available for datasets. (7173) By Jimmy Westling.
apply_ufunc now accepts DataTree inputs, applying func to the datasets at each node and returning trees with the same structure (11552). By QinXi.
The h5netcdf backend now reports compression and filter settings in the variable encoding consistently with the netCDF4 backend (using h5netcdf's Variable.filters()). This means data compressed with codecs such as zstd or blosc keeps its compression when re-saved, instead of silently being written uncompressed (10657, 11067). By Mark Harfouche.
Disable using bottleneck by default, as certain operations are less numerically stable than the equivalent numpy functions. Use xr.set_options(use_bottleneck=True) to opt back in (11461). By Thomas Kluyver.
All remaining zarr-python 2.x compatibility code has been removed from the zarr backend, following the bump of the minimum zarr version to 3.0. The following parameters have been removed from to_zarr and open_zarr:
zarr_version: Use zarr_format instead (was deprecated since 2024.9.1).
synchronizer: Not supported in zarr-python 3.x.
chunk_store: Not supported in zarr-python 3.x.
By Joe Hamman (11232).
The minimum supported version of h5netcdf is now 1.8.0, which introduced the compatibility features with netCDF4 that the harmonized encoding relies on (10657, 11067). By Mark Harfouche.
Passing keepdims to groupby, resample or rolling reductions (e.g. ds.rolling(time=12).mean(keepdims=True)) now emits a FutureWarning. The argument was previously silently ignored or produced unexpected shapes (11518, 11521). By Charles Turner.
Treat a full MultiIndex key with tuple-valued levels as scalar selection, so .sel no longer preserves a length-1 dimension for nested tuple keys that identify a single row (11341, 11348).
Warn when tuple-style DataArray coordinates are renamed by explicitly provided dimension names (11234, 11292). By Asish Kumar.
Preserve non-grouped coordinates in fallback groupby reductions when grouping by a non-leading dimension reorders the underlying variable dimensions (11188, 11290). By Sarthak.
Fix Dataset.chunk and DataArray.chunk raising ZeroDivisionError when using "auto" chunks on an object that has a zero-length dimension (11486). By Charles Turner.
Fix the shape of a ~xarray.indexes.CoordinateTransformIndex-backed coordinate after .transpose() for non-square arrays (11513). By Samuel Le Meur-Diebolt.
Fix a bug in the scipy backend where mixing non-adjacent scalar and array indexers in Dataset.sel could silently transpose dimension sizes when reading from a closed file object (10338, 11638). By Anirban Mandal.
Fixed DataArray.str.replace replacing every occurrence instead of none when n=0. re.sub treats count=0 as "replace all", so the regex code path collapsed n=0 onto n=-1, while the regex=False path already handled n=0 correctly (11545). By Alexander Kropiunig.
min and max of object arrays with skipna=False now return NaN for slices containing missing values, instead of a result that depended on the position of the missing value (11501, 11627). By Michael Niklas.
Avoid pandas' deprecated Series.values when creating a ~xarray.Variable from a timezone-aware pandas.Series (11501, 11627). By Michael Niklas.
Fix deadlocks when reading and writing netCDF files with dask at the same time. Combined locks now always acquire their locks in the same order, which previously depended on memory addresses, and a failed non-blocking acquire, e.g. while garbage collecting an unclosed file, no longer leaves some of its locks held forever (11622). By Michael Niklas.
Fix broadcast failing on objects with an index spanning several dimensions, such as a custom index set on both x and y (11615). By Matthias Schabel.
Fix errors and crashes in open_mfdataset with parallel=True when opening more files than file_cache_maxsize. Files evicted from the file cache by another thread are no longer closed while they are still being read (11622). By Michael Niklas.
DataArray.roll and Dataset.roll now return unchanged empty results when rolling an empty dimension, including with roll_coords=True, instead of raising ZeroDivisionError (11613). By Matthias Schabel.
Fixed ~xarray.indexes.RangeIndex.arange producing a negative-sized index instead of an empty index when the interval direction conflicts with the sign of step (11623). By Ahmet Kamer Çivi.
Preserve NumPy StringDType variables and coordinates in Zarr format 3 round trips (11466, 11474). By stanbot8.
Fixed dask-backed bottleneck rolling reductions declaring a dtype that could differ from the dtype returned by the matching numpy-backed bottleneck path, notably object instead of float64 for boolean inputs (11449). By Matthew Rocklin.
Fix ~xarray.plot.utils.label_from_attrs breaking LaTeX axis labels when textwrap.wrap splits the string between adjacent $...$ blocks, producing invalid $$ sequences that matplotlib cannot render (11452, 11476). By Gen Richez.
Fixed Dataset.stack raising KeyError when a stacked dimension has a falsy but valid name such as "", False or 0 (9969, 11477). By JOhnsonKC201.
polyval now propagates NaN for NaT entries in timedelta64 coordinates instead of returning a large sentinel value (11462, 11478). By Dipak Chaudhari.
The zarr backend now writes boolean arrays with native bool dtype instead of converting them to int8. Zarr supports bool natively, so the BooleanCoder (which was designed for NetCDF compatibility) is now skipped for zarr writes. Existing zarr stores written with the old int8 encoding are still read correctly. (2937, 11318) By Evan Lyall.
No longer emit a SerializationWarning about a missing _FillValue when encoding a CF coordinate variable (a 1D variable named after its dimension) to an integer dtype. CF forbids missing values in coordinate variables, so a _FillValue is not expected there (10305, 11524). By NoiceHax.
Raise an informative TypeError when a ~xarray.Coordinates object is passed as a coordinate value, e.g. ds.assign_coords({"x": coords}), instead of silently creating a broken coordinate. Pass the object directly with ds.assign_coords(coords) (10194, 11523). By NoiceHax.
Fixed two bugs affecting a ~xarray.indexes.CoordinateTransformIndex-backed coordinate after .transpose(): ~xarray.indexes.CoordinateTransformIndex.create_variables (used by, e.g., .copy() and .reindex_like()-based alignment) discarded the transposed dims order and silently reverted to the transform's original order; and xr.align(..., join="exact") raised a spurious AlignmentError for two objects sharing an equal multi-dimensional index whose associated coordinate variables simply had a different dims order (11530, 11532). By Samuel Le Meur-Diebolt.
DataArray.to_series and Dataset.to_dataframe no longer call .todense() on sparse.COO-backed variables, which could raise MemoryError for large, genuinely sparse arrays, or (for Dataset.to_dataframe) crash outright since sparse.COO refuses to densify implicitly. to_series now returns only the array's stored entries; to_dataframe indexes by the union of stored entries across all sparse variables sharing the same dims (4007, 11528). By patnr.
Following pandas-dev/pandas#64793, ensure that resampling an array to a Day frequency along a xarray.CFTimeIndex produces the same results as resampling to an equivalent Hour frequency, including with the use of origin and offset options (11547). This effectively rolls back the resample-related changes introduced in 10650. By Spencer Clark.
Fix regression where accessing an object-dtype index eagerly attempts to import cftime, slowing down operations (11558). By Peter Hron.
Fixed DataArray.coarsen() and Dataset.coarsen() raising a type error when applying reduction methods, due to the reduction methods being dynamically generated (8136, 11556). By Andrew Scherer.
Fixed a bug that caused rechunking a multi-dimensional cftime array along a subset of its dimensions to raise an error (11567, 11576). By Spencer Clark.
Dataset.diff and DataArray.diff now raise a ValueError when dim is not an existing dimension, instead of silently returning the object unchanged. This matches the behavior of other methods such as Dataset.differentiate and reductions like mean (7748, 11628). By imam2004i.
Fixed indexing with an empty indexer array. An empty indexer array is now always turned into an empty slice for the backend, so that the in-memory part of the decomposed indexer stays aligned with the axes of the loaded array. Previously the h5netcdf and scipy engines raised IndexError for multi-dimensional variables, the netCDF4 engine silently returned a wrongly-sized array, and pydap raised ValueError (9075, 11625, 11626). By Aniruddha Adak.
Use jupyterlite-sphinx to provide interactive examples (10299). By Justus Magin.
Migrated from nbsphinx/jupyter-execute to myst-nb (7924, 11456). By Nick Hodgskin.
Added an example to the netCDF section of the IO user guide showing how to check which dimensions are unlimited via Dataset.encoding (7517, 11618). By Anirban Mandal.
Add flox support for DataArray.groupby().median, Dataset.groupby().median, DataArray.resample().median, and Dataset.resample().median. This significantly speeds up median reductions when flox is installed by using flox's blockwise implementation, including rechunking when needed. (11238, 11239). By Samuel Le Meur-Diebolt.
Fix async zarr tests using wraps with autospec=True on async methods, which caused AsyncMock objects to leak through instead of real array data (11232). By Joe Hamman.
Silence datetime accessor deprecation warnings by @spencerkclark in #11270
This release adds support for Dask's query-optimizing expression arrays, along
with new day_of_week and day_of_year datetime accessor attributes. It
also includes a number of bug fixes, notably for a performance regression in
:py:meth:Coordinates.to_index, Zarr fill_value round-tripping, and
excessive memory use in drop_encoding.
Thanks to the 25 contributors to this release:
Davis Bennett, Deepak Cherian, Ian Hunt-Isaak, Illviljan, Jonathan Dung, Julia
Signell, Justus Magin, Kai Mühlbauer, MJSHANG, Mark Harfouche, Mathias Hauser,
Matt Van Horn, Matthew Rocklin, Max Jones, Maximilian Roos, Nick Hodgskin,
S Anand, Spencer Clark, Sreekant Baheti, Timothy Hodson, Tom Nicholas,
Vincent Gao, Wali Reheman, Wei Ji and eeshsaxena
core.types.Lock interface should also be hashable by @jonathandung in #11333test_roundtrip_pandas_dataframe_datetime as an expected failure by @spencerkclark in #11365Dataset.load by @VeckoTheGecko in #11388OSError in _get_mtime for non-file paths by @gaoflow in #11392pd.infer_freq behavior change by @spencerkclark in #11434test_dataset_math_errors for coming NumPy behavior change by @spencerkclark in #11435Full Changelog: v2026.04.0...v2026.07.0
This release adds support for Dask's query-optimizing expression arrays, along with new day_of_week and day_of_year datetime accessor attributes. It also includes a number of bug fixes, notably for a performance regression in Coordinates.to_index, Zarr fill_value round-tripping, and excessive memory use in drop_encoding.
Thanks to the 25 contributors to this release: Davis Bennett, Deepak Cherian, Ian Hunt-Isaak, Illviljan, Jonathan Dung, Julia Signell, Justus Magin, Kai Mühlbauer, MJSHANG, Mark Harfouche, Mathias Hauser, Matt Van Horn, Matthew Rocklin, Max Jones, Maximilian Roos, Nick Hodgskin, S Anand, Spencer Clark, Sreekant Baheti, Timothy Hodson, Tom Nicholas, Vincent Gao, Wali Reheman, Wei Ji and eeshsaxena
Added support for Dask's query-optimizing expression arrays. Xarray now implements the __dask_exprs__ protocol so that Dask can identify and optimize xarray Variable objects without materializing their graphs, together with a chunk manager and ~xarray.Dataset.map_blocks support for these arrays (11382, 11398, 11423). By Matthew Rocklin.
Following pandas, xarray's ~xarray.core.accessor_dt.DatetimeAccessor now supports ~xarray.core.accessor_dt.DatetimeAccessor.day_of_week and ~xarray.core.accessor_dt.DatetimeAccessor.day_of_year attributes, which are alternative names for the existing ~xarray.core.accessor_dt.DatetimeAccessor.dayofweek and ~xarray.core.accessor_dt.DatetimeAccessor.dayofyear attributes. These alternative attributes have similarly been added to ~xarray.CFTimeIndex (11270). By Spencer Clark.
Dataset.drop_encoding and DataArray.drop_encoding no longer copy the underlying data, avoiding excessive memory use on large datasets (11390, 11394). By Wali Reheman.
Fix open_dataset raising OSError when opening data from GDAL virtual filesystems (e.g. /vsicurl/, /vsis3/) or other URI-like paths that do not support stat (11392). By Vincent Gao.
Fix testing.assert_equal with check_dim_order=False for Dataset objects containing variables with different dimension orders (10704, 10718). By Maximilian Roos.
~xarray.indexes.RangeIndex.linspace now handles num=1 like numpy.linspace (11397, 11401). By S Anand.
Fix a major performance regression in Coordinates.to_index (and consequently Dataset.to_dataframe) caused by converting the cached code ndarrays into Python lists (11305).
Preserve the Zarr array fill_value in the variable encoding when reading a zarr_format=3 store with use_zarr_fill_value_as_mask=False, so it is no longer silently lost on round-trip (10269). By Davis Bennett.
~xarray.indexes.RangeIndex.arange now preserves the requested step instead of silently re-deriving it from (stop - start) / size, so its values match numpy.arange when step does not evenly divide the interval. Strided slicing of a ~xarray.indexes.RangeIndex now preserves the step as well (11325). By mokashang.
Fix decode_cf failing on integer-encoded time arrays that contain NaT when running against numpy 2.5+. By Ian Hunt-Isaak.
Fix TypeError: Implicit conversion to a NumPy array is not allowed when trying to use open_mfdataset with a backend engine reading to CuPy arrays. By Wei Ji Leong.
The names of ~xarray.DataArray objects returned by properties of the ~xarray.core.accessor_dt.DatetimeAccessor now always match the property names. Previously properties like ~xarray.core.accessor_dt.DatetimeAccessor.days_in_month, ~xarray.core.accessor_dt.DatetimeAccessor.weekday, and ~xarray.core.accessor_dt.DatetimeAccessor.weekofyear would return ~xarray.DataArray objects named "daysinmonth", "dayofweek", and "week", respectively; now they return objects named "days_in_month", "weekday", and "weekofyear" (11270). By Spencer Clark.
This release bumps the minimum supported zarr version to 3.0, finalizes the deprecation of timedelta decoding via units, adds col_wrap='auto' for plot…
This release bumps the minimum supported zarr version to 3.0, finalizes the
deprecation of timedelta decoding via units, adds col_wrap='auto' for plots,
a new inherit='all_coords' option for :py:meth:DataTree.to_dataset, and a
facetgrid_figsize option for :py:func:~xarray.set_options.
Thanks to the 22 contributors to this release:
Adam Newgas, Alfonso Ladino, Copilot, Deepak Cherian, Emmanuel Ferdman, Ian Hunt-Isaak,
Ilan Gold, Illviljan, Jakob Harteg, Joe Hamman, Julia Signell, Justus Magin,
Kai Mühlbauer, Max Jones, Michael Niklas, Nick Hodgskin, Pieter Eendebak,
Spencer Clark, frostByte, kkollsga, rsignell and yaochengchen
decode_timedelta=None by @spencerkclark in #11173Dataset.interp by @emmanuel-ferdman in #11081PandasIndex promotion of dtypes by @ilan-gold in #11244inherit='all_coords' option to DataTree.to_dataset() by @aladinor in #11230combine_by_coords by @SurfyPenguin in #11265zizmor to lint github action workflows by @keewis in #11269np.timedelta64 dtype by @spencerkclark in #11281to_zarr by @jsignell in #11229_replace_maybe_drop_dims by @rsignell in #11286Full Changelog: v2026.02.0...v2026.04.0
This release bumps the minimum supported zarr version to 3.0, finalizes the deprecation of timedelta decoding via units, adds col_wrap='auto' for plots, a new inherit='all_coords' option for DataTree.to_dataset, and a facetgrid_figsize option for ~xarray.set_options.
Thanks to the 22 contributors to this release: Adam Newgas, Alfonso Ladino, Copilot, Deepak Cherian, Emmanuel Ferdman, Ian Hunt-Isaak, Ilan Gold, Illviljan, Jakob Harteg, Joe Hamman, Julia Signell, Justus Magin, Kai Mühlbauer, Max Jones, Michael Niklas, Nick Hodgskin, Pieter Eendebak, Spencer Clark, frostByte, kkollsga, rsignell and yaochengchen
Added inherit='all_coords' option to DataTree.to_dataset to inherit all parent coordinates, not just indexed ones (10812, 11230). By Alfonso Ladino.
Support col_wrap='auto' in plots that will wrap the grid to be as square as possible (11266). By Michael Niklas.
Added complex dtype support to FillValueCoder for the Zarr backend. (11151) By Max Jones.
Added facetgrid_figsize option to ~xarray.set_options allowing ~xarray.plot.FacetGrid to use matplotlib.rcParams['figure.figsize'] or a fixed (width, height) tuple instead of computing figure size from size and aspect (11103). By Kristian Kollsga.
The minimum versions of some dependencies were changed (see table below). Notably, the minimum zarr version is now 3.0. Zarr v2 format data is still readable via zarr-python 3's built-in compatibility layer; however, zarr-python 2 is no longer a supported dependency. By Joe Hamman.
Dependency |
Old Version |
New Version |
|---|---|---|
boto3 |
1.34 |
1.37 |
cartopy |
0.23 |
0.24 |
dask-core |
2024.6 |
2025.2 |
distributed |
2024.6 |
2025.2 |
flox |
0.9 |
0.10 |
h5netcdf |
1.4 |
1.5 |
h5py |
3.11 |
3.13 |
iris |
3.9 |
3.11 |
lxml |
5.1 |
5.3 |
matplotlib-base |
3.8 |
3.10 |
numba |
0.60 |
0.61 |
numbagg |
0.8 |
0.9 |
packaging |
24.1 |
24.2 |
rasterio |
1.3 |
1.4 |
scipy |
1.13 |
1.15 |
toolz |
0.12 |
1.0 |
zarr |
2.18 |
3.0 |
Xarray will no longer by default decode a variable into a np.timedelta64 dtype based on the presence of a timedelta-like "units" attribute alone. Instead it will rely on the presence of a np.timedelta64 dtype attribute, which is now xarray's default way of encoding np.timedelta64 values. The old decoding behavior can be restored by specifying decode_timedelta=True or decode_timedelta=CFTimedeltaCoder(decode_via_units=True) in open_dataset. This finalizes the deprecation cycle initiated in xarray version 2025.01.2 (11173). By Spencer Clark.
When using h5netcdf engine and passing the path as a string to open_dataset and open_datatree the default behavior of fsspec is now to use block caching with a 4MB block size (11216). By Julia Signell.
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 (11095). By Kristian Kollsga.
Fix multi-coordinate indexes being dropped in DataArray._replace_maybe_drop_dims (e.g. after reducing over an unrelated dimension) and in Dataset._copy_listed (e.g. when subsetting a Dataset by variable names). Both paths now consult Index.should_add_coord_to_array, consistent with Dataset._construct_dataarray. Also simplify Dataset.to_dataarray to keep all coordinates and indexes directly, since variables are broadcast and all coords are retained (11215, 11286). By Rich Signell.
Allow writing StringDType variables to netCDF files (11199). By Kristian Kollsgård.
Fix Source link in api docs (11187) By Ian Hunt-Isaak
Coerce masked dask arrays to filled (9374 11157). By Julia Signell
Fix Dataset.interp silently dropping datetime64 and timedelta64 variables, through enabling their interpolation (10900, 11081). By Emmanuel Ferdman.
combine_by_coords no longer returns an empty dataset when a generator is passed as data_objects (10114, 11265). By Amartya Anand.
Fix h5netcdf backend module detection and ros3 tests (11243, 11274). By Kai Mühlbauer.
Add AI policy (11257). By Nick Hodgskin.
Update documentation and team guide to promote Zulip. Remove mentions of Discord (11246, 11254). By Nick Hodgskin.
Fix typos (11180, 11181, 11182, 11185, 11186). By Yaocheng Chen.
Fix code blocks on "how to create custom index" doc page (11255). By Nick Hodgskin.
Groupby cumsum can now be accelerated with flox. Coordinates are now retained as well. (6528, 10987) By Jimmy Westling.
Add script for linting of public docstrings according to numpydoc (11121). By Nick Hodgskin.
Add stubtest configuration and allowlist for validating type annotations against runtime behavior. This enables CI integration for type stub validation and helps prevent type annotation regressions (11086). By Kristian Kollsgård.
Remove setup.py file (11261). By Nick Hodgskin.
Add typing.overload decorators to DataArray.argmin and DataArray.argmax to narrow return type based on dim parameter (10893 11233). By Amartya Anand.
Replace DeprecationWarning with FutureWarning by @jsignell in #11112
.plot error when using positional args with col and row by @jsignell in #11111DeprecationWarning with FutureWarning by @jsignell in #11112netCDF4 by @keewis in #11146cache-pixi-lock.yml workflow into external action by @VeckoTheGecko in #11096Full Changelog: v2026.01.0...v2026.02.0
This release adds support for 1D coordinates in NDPointIndex for scattered point indexing, switches all deprecation warnings to FutureWarning for better end-user visibility, fixes silent data corruption when writing dask arrays to sharded Zarr stores, and improves chunked array tokenization performance.
Thanks to the 11 contributors to this release: Antonio Valentino, Chris Barker, Christine P. Chai, Deepak Cherian, Ewan Short, Harikrishna KP, Ian Hunt-Isaak, Julia Signell, Justus Magin, Kristian Kollsgård and Nick Hodgskin
~xarray.indexes.NDPointIndex now supports coordinates with fewer dimensions than coordinate variables, enabling indexing of scattered points and trajectories where multiple coordinates (e.g., x, y) share a single dimension (e.g., points) (10940, 11116). By Ian Hunt-Isaak.
When deprecating functionality, xarray has sometimes used FutureWarning and sometimes used DeprecationWarning. DeprecationWarning is not intended to be visible to end-users so this version of xarray switches to using FutureWarning everywhere (11112). By Julia Signell.
Fix slicing with negative step (11000, 11044). By Antonio Valentino.
Fix .plot error when using positional args with col and row (11104, 11111). By Julia Signell.
Slightly amend Xarray's Zarr Encoding Specification doc for clarity, and provide a code comment in xarray.backends.zarr._get_zarr_dims_and_attrs referencing the doc (8749, 11013). By Ewan Short.
Fix silent data corruption when writing dask arrays to sharded Zarr stores. Dask chunk boundaries must now align with shard boundaries, not just internal Zarr chunk boundaries (10831, 11117). By Kristian Kollsgård.
Fix Dataset.sortby and DataArray.sortby placing NaN values at the beginning instead of the end when using ascending=False (7358, 11118). By Kristian Kollsgård.
Raise FileNotFoundError instead of a confusing ValueError when open_dataset is called with a non-existent local file path (10896, 11150). By Kristian Kollsgård.
Improve error message when a chunk manager is not available, suggesting how to install the required package (11056). By Julia Signell.
Raise ValueError on slice-based selection of multi-index levels, which previously returned silently wrong results (10534, 11168). By Harikrishna KP.
Add support for myst markdown (11167). By Nick Hodgskin.
Update docstrings for pandas 3 compatibility (11130). By Julia Signell.
Various Numpydoc fixes (11122). By Nick Hodgskin.
Correct wording mistakes in documentation (11120, 11127). By Christine P. Chai.
Fix broken links in documentation (11115, 11135, 11161). By Nick Hodgskin.
Fix "latest" version displayed on landing page (11119). By Nick Hodgskin.
Add descriptions for pixi tasks (11155). By Nick Hodgskin.
Update open_zarr decode_cf docstring (11165). By Nick Hodgskin.
Add MyST Markdown support for documentation (11167). By Nick Hodgskin.
Add a fast path that skips normalized chunks during tokenization (11017). By Julia Signell.
Temporarily silence shape assignment warnings raised in netCDF4 (11146). By Justus Magin.
Add osx-64 to the pixi configuration (11137). By Chris Barker.
Preserve string dtypes instead of converting to object where possible (11152). By Julia Signell.
new release section by @keewis in #10985
keep_attrs in xr.where when x is a scalar by @jsignell in #10997sphinx-llms-txt => sphinx-llm by @jacobtomlinson in #11003drop_existing kwarg to set_xindex by @ianhi in #11008assert_identical now considers xindexes + improve RangeIndex equals by @ianhi in #11035cupy.array by @hoxbro in #11026SeasonResampler preserves datetime resolution by @spencerkclark in #11049CoordinateTransformIndex by @dcherian in #10980auto to {} in open_zarr by @jsignell in #11010arithmetic_compat option to xr.set_options by @mjwillson in #10943Dataset.eval works with >2 dims by @max-sixty in #11064pd.StringDtype to np.dtypes.StringDType by @jsignell in #11102StringDType when reading from zarr string variables by @jsignell in #11097Full Changelog: v2025.12.0...v2026.01.0
This release includes an improved DataTree HTML representation with collapsible groups and automatic truncation, easier selection on coordinates without explicit indexes, pandas 3 compatibility, and various bug fixes and performance improvements.
Thanks to the 25 contributors to this release: Barron H. Henderson, Christine P. Chai, DHRUVA KUMAR KAUSHAL, David Bold, Davis Bennett, Deepak Cherian, Dhruva Kumar Kaushal, Florian Knappers, Ian Hunt-Isaak, Jacob Tomlinson, Joshua Gould, Julia Signell, Justus Magin, Lucas Colley, Mark Harfouche, Matthew, Maximilian Roos, Nick Hodgskin, Sakshee_D, Sam Levang, Samay Mehar, Simon Høxbro Hansen, Spencer Clark, Stephan Hoyer and knappersfy
Improved DataTree HTML representation: groups are now collapsible with item counts shown in labels, large trees are automatically truncated using display_max_children and display_max_html_elements options, and the Indexes section is now displayed (matching the text repr) (10816). By Stephan Hoyer.
Dataset.set_xindex and DataArray.set_xindex automatically replace any existing index being set instead of erroring or needing needing to call drop_indexes first (11008). By Ian Hunt-Isaak.
Calling Dataset.sel or DataArray.sel on a 1-dimensional coordinate without an index will now automatically create a temporary ~xarray.indexes.PandasIndex to perform the selection (9703, 11029). By Ian Hunt-Isaak.
The minimum supported version of h5netcdf is now 1.4. Version 1.4.0 brings improved alignment between h5netcdf and libnetcdf4 in the storage of complex numbers (11068). By Mark Harfouche.
set_options now supports an arithmetic_compat option which determines how non-index coordinates of the same name are compared for potential conflicts when performing binary operations. The default for it is arithmetic_compat='minimal' which matches the existing behaviour (10943). By Matthew Willson.
Better ordering of coordinates when displaying xarray objects (11091). By Ian Hunt-Isaak, Julia Signell.
Use np.dtypes.StringDType when reading Zarr string variables (11097). By Julia Signell.
Change the default value for chunk in open_zarr to _default and remove special mapping of "auto" to {} or None in open_zarr. If chunks is not set, the default behavior is the same as before. Explicitly setting chunks="auto" will match the behavior of chunks="auto" in open_dataset with engine="zarr" (11002, 11010). By Julia Signell.
Dataset.identical, DataArray.identical, and testing.assert_identical now compare indexes. Two objects with identical data but different indexes will no longer be considered identical (11033, 11035). By Ian Hunt-Isaak.
Ensure that keep_attrs='drop' and keep_attrs=False remove attrs from result, even when there is only one xarray object given to apply_ufunc (10982, 10997). By Julia Signell.
~xarray.indexes.RangeIndex.equals now uses floating point error tolerant np.isclose by default to handle accumulated floating point errors from slicing operations. Use exact=True for exact comparison (11035). By Ian Hunt-Isaak.
Ensure the ~xarray.groupers.SeasonResampler preserves the datetime unit of the underlying time index when resampling (11048, 11049). By Spencer Clark.
Partially support pandas 3 default string indexes by coercing pd.StringDtype to np.dtypes.StringDType in PandasIndexingAdapter (11098, 11102). By Julia Signell.
Dataset.eval now works with more than 2 dimensions (11064). By Maximilian Roos.
Fix where for cupy.array inputs (11026). By Simon Høxbro Hansen.
Fix CombinedLock.locked to correctly call the underlying lock's locked() method (10843, 11022). By Samay Mehar.
Fix DatasetGroupBy.map when grouping by more than one variable (11005). By Joshua Gould.
Fix indexing bugs in ~xarray.indexes.CoordinateTransformIndex (10980). By Deepak Cherian.
Ensure the netCDF4 backend locks files while closing to prevent race conditions (10788). By David Bold.
Improve error message when scipy is missing for ~xarray.indexes.NDPointIndex (11085). By Sakshee_D.
Better description of keep_attrs option on xarray.where docstring (10982, 10997). By Julia Signell.
Document how xarray.dot interacts with coordinates (10958). By Dhruva Kumar Kaushal.
Improve rolling window documentation (11094). By Barron H. Henderson.
Improve combine_nested and combine_by_coords docstrings (11080). By Julia Signell.
Add a fastpath to the backend plugin system for standard engines (10178, 10937). By Sam Levang.
Optimize ~xarray.coding.variables.CFMaskCoder decoder (11105). By Deepak Cherian.
Update contributing instructions with note on pixi version (11108). By Nick Hodgskin.
This release rolls back the default engine for HTTP urls, adds support for DataTree objects in combine_nested and contains numerous bug fixes.
This release rolls back the default engine for HTTP urls, adds support for DataTree objects in combine_nested and contains numerous bug fixes.
Thanks to the 16 contributors to this release:
Benoit Bovy, Christine P. Chai, Deepak Cherian, Dhruva Kumar Kaushal, Ian Hunt-Isaak, Ilan Gold, Illviljan, Julia Signell, Justus Magin, Lars Buntemeyer, Maximilian Roos, Miguel Jimenez, Nick Hodgskin, Richard Berg, Spencer Clark and Stephan Hoyer
netcdf backend behavior with URLs by @ianhi in #10931pandas.Timestamp constructor by @spencerkclark in #10944Dataset.drop_attrs by @keewis in #10961IndexVariable to Variable when assigning to data variables or coordinates by @jsignell in #10909nas for extension arrays properly by @ilan-gold in #10423matrix.pytest-addopts by @VeckoTheGecko in #10970._data in Variable._replace by @dcherian in #10969llms.txt generation to build process by @VeckoTheGecko in #10978Full Changelog: v2025.11.0...v2025.12.0
This release rolls back the default engine for HTTP urls, adds support for DataTree objects in combine_nested and contains numerous bug fixes.
Thanks to the 16 contributors to this release: Benoit Bovy, Christine P. Chai, Deepak Cherian, Dhruva Kumar Kaushal, Ian Hunt-Isaak, Ilan Gold, Illviljan, Julia Signell, Justus Magin, Lars Buntemeyer, Maximilian Roos, Miguel Jimenez, Nick Hodgskin, Richard Berg, Spencer Clark and Stephan Hoyer
Improved pydap backend behavior and performance when using open_dataset, open_datatree when downloading dap4 (opendap) dimensions data (10628, 10629). In addition checksums=True|False is added as optional argument to be passed to pydap backend. By Miguel Jimenez-Urias.
combine_nested now supports DataTree objects (10849). By Stephan Hoyer.
When assigning an indexed coordinate to a data variable or coordinate, coerce it from IndexVariable to Variable (9859, 10829, 10909). By Julia Signell.
The NetCDF4 backend will now claim to be able to read any URL except for one that contains the substring zarr. This restores backward compatibility after 10804 broke workflows that relied on xr.open_dataset("http://...") (10931). By Ian Hunt-Isaak.
Always normalize slices when indexing LazilyIndexedArray instances (10941, 10948). By Justus Magin.
Avoid casting custom indexes in Dataset.drop_attrs (10961) By Justus Magin.
Support decoding unsigned integers to np.timedelta64. By Deepak Cherian.
Properly handle internal type promotion and NA objects for extension arrays (10423). By Ilan Gold.
Added section on the limitations of cftime arithmetic (10653). By Lars Buntemeyer.
Change the development workflow to use pixi (10732, 10888). By Nick Nodgskin.
This release changes the default for keep_attrs such that attributes are preserved by default, adds support for DataTree in top-level functions, and c
This release changes the default for keep_attrs such that attributes are preserved by default, adds support for DataTree in top-level functions, and contains several memory and performance improvements as well as a number of bug fixes.
Thanks to the 21 contributors to this release:
Aled Owen, Charles Turner, Christine P. Chai, David Huard, Deepak Cherian, Gregorio L. Trevisan, Ian Hunt-Isaak, Ilan Gold, Illviljan, Jan Meischner, Jemma Jeffree, Jonas Lundholm Bertelsen, Justus Magin, Kai Mühlbauer, Kristian Bodolai, Lukas Riedel, Max Jones, Maximilian Roos, Niclas Rieger, Stephan Hoyer and William Andrea
keep_attrs default to True by @max-sixty in #10726pre-commit hook maintenance by @keewis in #10871drop_sel for a MultiIndex by @owena11 in #10863pandas by @ilan-gold in #10894assert_allclose by @keewis in #10887Full Changelog: v2025.10.1...v2025.11.0
This release changes the default for keep_attrs such that attributes are preserved by default, adds support for DataTree in top-level functions, and contains several memory and performance improvements as well as a number of bug fixes.
Thanks to the 21 contributors to this release: Aled Owen, Charles Turner, Christine P. Chai, David Huard, Deepak Cherian, Gregorio L. Trevisan, Ian Hunt-Isaak, Ilan Gold, Illviljan, Jan Meischner, Jemma Jeffree, Jonas Lundholm Bertelsen, Justus Magin, Kai Mühlbauer, Kristian Bodolai, Lukas Riedel, Max Jones, Maximilian Roos, Niclas Rieger, Stephan Hoyer and William Andrea
merge and concat now support DataTree objects (9790, 9778). By Stephan Hoyer.
The h5netcdf engine has support for pseudo NETCDF4_CLASSIC files, meaning variables and attributes are cast to supported types. Note that the saved files won't be recognized as genuine NETCDF4_CLASSIC files until h5netcdf adds support with version 1.7.0 (10676, 10686). By David Huard.
Support comparing DataTree objects with testing.assert_allclose (10887). By Justus Magin.
Add support for chunks="auto" for cftime datasets (9834, 10527). By Charles Turner.
All xarray operations now preserve attributes by default (3891, 2582). Previously, operations would drop attributes unless explicitly told to preserve them via keep_attrs=True. Additionally, when attributes are preserved in binary operations, they now combine attributes from both operands using drop_conflicts (keeping matching attributes, dropping conflicts), instead of keeping only the left operand's attributes.
What changed:
# Before (xarray <2025.11.0):
data = xr.DataArray([1, 2, 3], attrs={"units": "meters", "long_name": "height"})
result = data.mean()
result.attrs # {} - Attributes lost!
# After (xarray ≥2025.09.1):
data = xr.DataArray([1, 2, 3], attrs={"units": "meters", "long_name": "height"})
result = data.mean()
result.attrs # {"units": "meters", "long_name": "height"} - Attributes preserved!
Affected operations include:
Computational operations:
Reductions: mean(), sum(), std(), var(), min(), max(), median(), quantile(), etc.
Rolling windows: rolling().mean(), rolling().sum(), etc.
Groupby: groupby().mean(), groupby().sum(), etc.
Resampling: resample().mean(), etc.
Weighted: weighted().mean(), weighted().sum(), etc.
apply_ufunc() and NumPy universal functions
Binary operations:
Arithmetic: +, -, *, /, **, //, % (combines attributes using drop_conflicts)
Comparisons: <, >, ==, !=, <=, >= (combines attributes using drop_conflicts)
With scalars: data * 2, 10 - data (preserves data's attributes)
Data manipulation:
Missing data: fillna(), dropna(), interpolate_na(), ffill(), bfill()
Indexing/selection: isel(), sel(), where(), clip()
Alignment: interp(), reindex(), align()
Transformations: map(), pipe(), assign(), assign_coords()
Shape operations: expand_dims(), squeeze(), transpose(), stack(), unstack()
Binary operations - combines attributes with drop_conflicts:
a = xr.DataArray([1, 2], attrs={"units": "m", "source": "sensor_a"})
b = xr.DataArray([3, 4], attrs={"units": "m", "source": "sensor_b"})
(a + b).attrs # {"units": "m"} - Matching values kept, conflicts dropped
(b + a).attrs # {"units": "m"} - Order doesn't matter for drop_conflicts
How to restore previous behavior:
Globally for your entire script:
import xarray as xr
xr.set_options(keep_attrs=False) # Affects all subsequent operations
For specific operations:
result = data.mean(dim="time", keep_attrs=False)
For code blocks:
with xr.set_options(keep_attrs=False):
# All operations in this block drop attrs
result = data1 + data2
Remove attributes after operations:
result = data.mean().drop_attrs()
By Maximilian Roos.
Fix h5netcdf backend for format=None, use same rule as netcdf4 backend (10859). By Kai Mühlbauer.
netcdf4 and pydap backends now use stricter URL detection to avoid incorrectly claiming remote URLs. The pydap backend now only claims URLs with explicit DAP protocol indicators (dap2:// or dap4:// schemes, or /dap2/ or /dap4/ in the URL path). This prevents both backends from claiming remote Zarr stores and other non-DAP URLs without an explicit engine= argument (10804). By Ian Hunt-Isaak.
Fix indexing with empty arrays for scipy & h5netcdf backends which now resolves to empty slices (10867, 10870). By Kai Mühlbauer
Fix error handling issue in decode_cf_variables when decoding fails - the exception is now re-raised correctly, with a note added about the variable name that caused the error (10873, 10886). By Jonas L. Bertelsen.
Fix equivalent for numpy scalar nan comparison (10833, 10838). By Maximilian Roos.
Support non-DataArray outputs in Dataset.map (10835, 10839). By Maximilian Roos.
Support drop_sel on MultiIndex objects (10862, 10863). By Aled Owen.
Speedup and reduce memory usage of concat. Magnitude of improvement scales with size of the concatenation dimension (10864, 10866). By Deepak Cherian.
Speedup and reduce memory usage when coarsening along multiple dimensions (10921) By Deepak Cherian.
This release actually reverts a breaking change to Xarray's preferred netCDF backend.
This release actually reverts a breaking change to Xarray's preferred netCDF backend.
This release reverts a breaking change to Xarray's preferred netCDF backend.
Xarray's default engine for reading/writing netCDF files has been reverted to prefer netCDF4 over h5netcdf over scipy, which was the default before v2025.09.1. This change had larger implications for the ecosystem than we anticipated. We are still considering changing the default in the future, but will be a bit more careful about the implications. See 10657 and linked issues for discussion. The behavior can still be customized, e.g., with xr.set_options(netcdf_engine_order=['h5netcdf', 'netcdf4', 'scipy']). By Stephan Hoyer.
Coordinates are ordered to match dims when displaying Xarray objects. (10778). By Julia Signell.
Fix error raised when writing scalar variables to Zarr with region={} (10796). By Stephan Hoyer.
This release reverts a breaking change to Xarray's preferred netCDF backend.
This release reverts a breaking change to Xarray's preferred netCDF backend.
This release contains improvements to netCDF IO and the DataTree.from_dict() constructor, as well as a variety of bug fixes. In particular, the defaul
This release contains improvements to netCDF IO and the DataTree.from_dict() constructor, as well as a variety of bug fixes. In particular, the default netCDF backend has switched from netCDF4 to h5netcdf, which is typically faster.
Thanks to the 17 contributors to this release: Claude, Deepak Cherian, Dimitri Papadopoulos Orfanos, Dylan H. Morris, Emmanuel Mathot, Ian Hunt-Isaak, Joren Hammudoglu, Julia Signell, Justus Magin, Maximilian Roos, Nick Hodgskin, Spencer Clark, Stephan Hoyer, Tom Nicholas, gronniger, joseph nowak and pierre-manchon
This release contains improvements to netCDF IO and the DataTree.from_dict constructor, as well as a variety of bug fixes. In particular, the default netCDF backend has switched from netCDF4 to h5netcdf, which is typically faster.
Thanks to the 17 contributors to this release: Claude, Deepak Cherian, Dimitri Papadopoulos Orfanos, Dylan H. Morris, Emmanuel Mathot, Ian Hunt-Isaak, Joren Hammudoglu, Julia Signell, Justus Magin, Maximilian Roos, Nick Hodgskin, Spencer Clark, Stephan Hoyer, Tom Nicholas, gronniger, joseph nowak and pierre-manchon
DataTree.from_dict now supports passing in DataArray and nested dictionary values, and has a coords argument for specifying coordinates as DataArray objects (10658).
engine='netcdf4' now supports reading and writing in-memory netCDF files. All of Xarray's netCDF backends now support in-memory reads and writes (10624). By Stephan Hoyer.
Dataset.update now returns None, instead of the updated dataset. This completes the deprecation cycle started in version 0.17. The method still updates the dataset in-place. (10167) By Maximilian Roos.
The default engine when reading/writing netCDF files is now h5netcdf or scipy, which are typically faster than the prior default of netCDF4-python. You can control this default behavior explicitly via the new netcdf_engine_order parameter in ~xarray.set_options, e.g., xr.set_options(netcdf_engine_order=['netcdf4', 'scipy', 'h5netcdf']) to restore the prior defaults (10657). By Stephan Hoyer.
The HTML reprs for DataArray, Dataset and DataTree have been tweaked to hide empty sections, consistent with the text reprs. The DataTree HTML repr also now automatically expands sub-groups (10785). By Stephan Hoyer.
Zarr stores written with Xarray now consistently use a default Zarr fill value of NaN for float variables, for both Zarr v2 and v3 (10646`). All other dtypes still use the Zarr default fill_value of zero. To customize, explicitly set encoding in ~Dataset.to_zarr, e.g., encoding=dict.fromkey(ds.data_vars, {'fill_value': 0}). By Stephan Hoyer.
Xarray objects opened from file-like objects with engine='h5netcdf' can now be pickled, as long as the underlying file-like object also supports pickle (10712). By Stephan Hoyer.
Closing Xarray objects opened from file-like objects with `engine='scipy' no longer closes the underlying file, consistent with the h5netcdf backend (10624). By Stephan Hoyer.
Fix the align_chunks parameter on the ~xarray.Dataset.to_zarr method, it was not being passed to the underlying ~xarray.backends.api method (10501, 10516).
Fix error when encoding an empty numpy.datetime64 array (10722, 10723). By Spencer Clark.
Propagate coordinate attrs in xarray.Dataset.map (9317, 10602).
Fix error from to_netcdf(..., compute=False) when using Dask Distributed (10725). By Stephan Hoyer.
Propagation coordinate attrs in xarray.Dataset.map (9317, 10602). By Justus Magin.
Allow combine_attrs="drop_conflicts" to handle objects with __eq__ methods that return non-bool values (e.g., numpy arrays) without raising ValueError (10726). By Maximilian Roos.
Fixed Zarr encoding documentation with consistent examples and added comprehensive coverage of dimension and coordinate encoding differences between Zarr V2 and V3 formats. The documentation shows what users will see when accessing Zarr files with raw zarr-python, and explains the relationship between _ARRAY_DIMENSIONS (Zarr V2), dimension_names metadata (Zarr V3), and CF coordinates attributes. (10720) By Emmanuel Mathot.
Refactor structure of backends module to separate code for reading data from code for writing data (10771). By Tom Nicholas.
All test files now have full mypy type checking enabled (check_untyped_defs = true), improving type safety and making the test suite a better reference for type annotations. (10768) By Maximilian Roos.
This release brings a number of small improvements and fixes, especially related to writing DataTree objects and netCDF files to disk.
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
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.
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.
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.
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
Support rechunking by ~xarray.groupers.SeasonResampler for seasonal data analysis (10425, 10519). By Dhruva Kumar Kaushal.
Add convenience methods to ~xarray.Coordinates (10318) 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.
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 (10640, 10650). 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 (10654). 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 (10656). 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.
Fix contour plots not normalizing the colors correctly when using for example logarithmic norms. (10551, 10565) By Jimmy Westling.
Fix distribution of auto_complex keyword argument for open_datatree (10631, 10632). By Kai Mühlbauer.
Warn instead of raise in case of misconfiguration of unlimited_dims originating from dataset.encoding, to prevent breaking users workflows (10647, 10648). By Kai Mühlbauer.
DataTree.to_netcdf and DataTree.to_zarr now avoid redundant computation of Dask arrays with cross-group dependencies (10637). By Stephan Hoyer.
DataTree.to_netcdf had h5netcdf hard-coded as default (10654). By Stephan Hoyer.
Run TestNetCDF4Data as TestNetCDF4DataTree through open_datatree (10632). By Kai Mühlbauer.
…fixes a number of bugs, and starts an important deprecation cycle for changing the default values of keyword arguments for various xarray combining fu…
This release brings the ability to load xarray objects asynchronously, write netCDF as bytes, fixes a number of bugs, and starts an important deprecation cycle for changing the default values of keyword arguments for various xarray combining functions.
Thanks to the 24 contributors to this release: Alfonso Ladino, Brigitta Sipőcz, Claude, Deepak Cherian, Dimitri Papadopoulos Orfanos, Eric Jansen, Ian Hunt-Isaak, Ilan Gold, Illviljan, Julia Signell, Justus Magin, Kai Mühlbauer, Mathias Hauser, Matthew, Michael Niklas, Miguel Jimenez, Nick Hodgskin, Pratiman, Scott Staniewicz, Spencer Clark, Stephan Hoyer, Tom Nicholas, Yang Yang and jemmajeffree
<!-- Release notes generated using configuration in .github/release.yml at main -->
topic-documentation by @VeckoTheGecko in https://github.com/pydata/xarray/pull/10524super().__init__() in st.SearchStrategy subclasses by @spencerkclark in https://github.com/pydata/xarray/pull/10543DatetimeAccessor.strftime errors due to upstream changes by @spencerkclark in https://github.com/pydata/xarray/pull/10550pyarrow from its official repo by @keewis in https://github.com/pydata/xarray/pull/10577StringDType even when the backing array is not NumpyExtensionArray by @ilan-gold in https://github.com/pydata/xarray/pull/10559_get_default_engine_netcdf to check for h5netcdf by @scottstanie in https://github.com/pydata/xarray/pull/10557pre-commit hook maintenance: typos by @keewis in https://github.com/pydata/xarray/pull/10586concat, merge, combine_* by @jsignell in https://github.com/pydata/xarray/pull/10062ogp_custom_meta_tags to tuple by @keewis in https://github.com/pydata/xarray/pull/10603PandasMultiIndex by @jsignell in https://github.com/pydata/xarray/pull/10610to_netcdf by @kmuehlbauer in https://github.com/pydata/xarray/pull/10608.tolist() when creating pd.Index by @y4n9squared in https://github.com/pydata/xarray/pull/10619RangeIndex Display by @ianhi in https://github.com/pydata/xarray/pull/10594ds.merge to prevent altering original object depending on join value by @jsignell in https://github.com/pydata/xarray/pull/10596Full Changelog: https://github.com/pydata/xarray/compare/v2025.07.1...v2025.08.0
This release brings the ability to load xarray objects asynchronously, write netCDF as bytes, fixes a number of bugs, and starts an important deprecation cycle for changing the default values of keyword arguments for various xarray combining functions.
Thanks to the 24 contributors to this release: Alfonso Ladino, Brigitta Sipőcz, Claude, Deepak Cherian, Dimitri Papadopoulos Orfanos, Eric Jansen, Ian Hunt-Isaak, Ilan Gold, Illviljan, Julia Signell, Justus Magin, Kai Mühlbauer, Mathias Hauser, Matthew, Michael Niklas, Miguel Jimenez, Nick Hodgskin, Pratiman, Scott Staniewicz, Spencer Clark, Stephan Hoyer, Tom Nicholas, Yang Yang and jemmajeffree
Added DataTree.prune method to remove empty nodes while preserving tree structure. Useful for cleaning up DataTree after time-based filtering operations (10590, 10598). By Alfonso Ladino.
Added new asynchronous loading methods Dataset.load_async, DataArray.load_async, Variable.load_async. Note that users are expected to limit concurrency themselves - xarray does not internally limit concurrency in any way. (10326, 10327) By Tom Nicholas.
DataTree.to_netcdf can now write to a file-like object, or return bytes if called without a filepath. (10570) By Matthew Willson.
Added exception handling for invalid files in open_mfdataset. (6736) By Pratiman Patel.
When writing to NetCDF files with groups, Xarray no longer redefines dimensions that have the same size in parent groups (10241). This conforms with CF Conventions for group scrope but may require adjustments for code that consumes NetCDF files produced by Xarray. By Stephan Hoyer.
Start a deprecation cycle for changing the default keyword arguments to concat, merge, combine_nested, combine_by_coords, and open_mfdataset. Emits a FutureWarning when using old defaults and new defaults would result in different behavior. Adds an option: use_new_combine_kwarg_defaults to opt in to new defaults immediately. New values are:
data_vars: None which means all when concatenating along a new dimension, and "minimal" when concatenating along an existing dimension
coords: "minimal"
compat: "override"
join: "exact"
(8778, 1385, 10062). By Julia Signell.
Fix Pydap Datatree backend testing. Testing now compares elements of (unordered) two sets (before, lists) (10525). By Miguel Jimenez-Urias.
Fix KeyError when passing a dim argument different from the default to convert_calendar (10544). By Eric Jansen.
Fix transpose of boolean arrays read from disk. (10536) By Deepak Cherian.
Fix detection of the h5netcdf backend. Xarray now selects h5netcdf if the default netCDF4 engine is not available (10401, 10557). By Scott Staniewicz.
Fix merge to prevent altering original object depending on join value (10596) By Julia Signell.
Ensure unlimited_dims passed to xarray.DataArray.to_netcdf, xarray.Dataset.to_netcdf or xarray.DataTree.to_netcdf only contains dimensions present in the object; raise ValueError otherwise (10549, 10608). By Kai Mühlbauer.
Clarify lazy behaviour and eager loading for chunks=None in ~xarray.open_dataset, ~xarray.open_dataarray, ~xarray.open_datatree, ~xarray.open_groups and ~xarray.open_zarr (10612, 10627). By Kai Mühlbauer.
Speed up non-numeric scalars when calling Dataset.interp. (10054, 10554) By Jimmy Westling.
<!-- Release notes generated using configuration in .github/release.yml at main -->
<!-- Release notes generated using configuration in .github/release.yml at main -->
is when comparing type of two objects by @DimitriPapadopoulos in https://github.com/pydata/xarray/pull/10504Index.create_variables returns more variables than passed in through set_xindex by @dhruvak001 in https://github.com/pydata/xarray/pull/10503Full Changelog: https://github.com/pydata/xarray/compare/v2025.07.0...v2025.07.1
This release brings a lot of improvements to flexible indexes functionality, including new classes to ease building of new indexes with custom coordinate transforms (indexes.CoordinateTransformIndex) and tree-like index structures (indexes.NDPointIndex). See a new gallery showing off the possibilities enabled by flexible indexes.
Thanks to the 7 contributors to this release: Benoit Bovy, Deepak Cherian, Dhruva Kumar Kaushal, Dimitri Papadopoulos Orfanos, Illviljan, Justus Magin and Tom Nicholas
New xarray.indexes.NDPointIndex, which by default uses scipy.spatial.KDTree under the hood for the selection of irregular, n-dimensional data (10478). By Benoit Bovy.
Allow skipping the creation of default indexes when opening datasets (8051). By Benoit Bovy and Justus Magin.
Dataset.set_xindex now raises a helpful error when a custom index creates extra variables that don't match the provided coordinate names, instead of silently ignoring them. The error message suggests using the factory method pattern with xarray.Coordinates.from_xindex and Dataset.assign_coords for advanced use cases (10499, 10503). By Dhruva Kumar Kaushal.
A new gallery showing off the possibilities enabled by flexible indexes.
Refactored the PandasIndexingAdapter and CoordinateTransformIndexingAdapter internal indexing classes. Coordinate variables that wrap a pandas.RangeIndex, a pandas.MultiIndex or a xarray.indexes.CoordinateTransform are now displayed as lazy variables in the Xarray data reprs (10355). By Benoit Bovy.
This release extends xarray's support for custom index classes, restores support for reading netCDF3 files with SciPy, updates minimum dependencies, a
This release extends xarray's support for custom index classes, restores support for reading netCDF3 files with SciPy, updates minimum dependencies, and fixes a number of bugs.
Thanks to the 17 contributors to this release: Bas Nijholt, Benoit Bovy, Deepak Cherian, Dhruva Kumar Kaushal, Dimitri Papadopoulos Orfanos, Ian Hunt-Isaak, Kai Mühlbauer, Mathias Hauser, Maximilian Roos, Miguel Jimenez, Nick Hodgskin, Scott Henderson, Shuhao Cao, Spencer Clark, Stephan Hoyer, Tom Nicholas and Zsolt Cserna
Index._repr_inline_() signature by @benbovy in https://github.com/pydata/xarray/pull/10415.keys() by @DimitriPapadopoulos in https://github.com/pydata/xarray/pull/10451if statement have similar implementation by @DimitriPapadopoulos in https://github.com/pydata/xarray/pull/10475np.timedelta64 encoding bugs by @spencerkclark in https://github.com/pydata/xarray/pull/10469ci/release_contributors.py script by @TomNicholas in https://github.com/pydata/xarray/pull/10494Full Changelog: https://github.com/pydata/xarray/compare/v2025.06.1...v2025.07.0
This release extends xarray's support for custom index classes, restores support for reading netCDF3 files with SciPy, updates minimum dependencies, and fixes a number of bugs.
Thanks to the 17 contributors to this release: Bas Nijholt, Benoit Bovy, Deepak Cherian, Dhruva Kumar Kaushal, Dimitri Papadopoulos Orfanos, Ian Hunt-Isaak, Kai Mühlbauer, Mathias Hauser, Maximilian Roos, Miguel Jimenez, Nick Hodgskin, Scott Henderson, Shuhao Cao, Spencer Clark, Stephan Hoyer, Tom Nicholas and Zsolt Cserna
Expose ~xarray.indexes.RangeIndex, and ~xarray.indexes.CoordinateTransformIndex as public api under the xarray.indexes namespace. By Deepak Cherian.
Support zarr-python's new .supports_consolidated_metadata store property (10457`). by Tom Nicholas.
Better error messages when encoding data to be written to disk fails (10464). By Stephan Hoyer
The minimum versions of some dependencies were changed (10417, 10438): By Dhruva Kumar Kaushal.
Dependency |
Old Version |
New Version |
|---|---|---|
Python |
3.10 |
3.11 |
array-api-strict |
1.0 |
1.1 |
boto3 |
1.29 |
1.34 |
bottleneck |
1.3 |
1.4 |
cartopy |
0.22 |
0.23 |
dask-core |
2023.11 |
2024.6 |
distributed |
2023.11 |
2024.6 |
flox |
0.7 |
0.9 |
h5py |
3.8 |
3.11 |
hdf5 |
1.12 |
1.14 |
iris |
3.7 |
3.9 |
lxml |
4.9 |
5.1 |
matplotlib-base |
3.7 |
3.8 |
numba |
0.57 |
0.60 |
numbagg |
0.6 |
0.8 |
numpy |
1.24 |
1.26 |
packaging |
23.2 |
24.1 |
pandas |
2.1 |
2.2 |
pint |
0.22 |
0.24 |
pydap |
N/A |
3.5 |
scipy |
1.11 |
1.13 |
sparse |
0.14 |
0.15 |
typing_extensions |
4.8 |
Removed |
zarr |
2.16 |
2.18 |
Fix Pydap test_cmp_local_file for numpy 2.3.0 changes, 1. do always return arrays for all versions and 2. skip astype(str) for numpy >= 2.3.0 for expected data. (10421) By Kai Mühlbauer.
Fix the SciPy backend for netCDF3 files . (8909, 10376) By Deepak Cherian.
Check and fix character array string dimension names, issue warnings as needed (6352, 10395). By Kai Mühlbauer.
Fix the error message of testing.assert_equal when two different DataTree objects are passed (10440). By Mathias Hauser.
Fix testing.assert_equal with check_dim_order=False for DataTree objects (10442). By Mathias Hauser.
Fix Pydap backend testing. Now test forces string arrays to dtype "S" (pydap converts them to unicode type by default). Removes conditional to numpy version. (10261, 10482) By Miguel Jimenez-Urias.
Fix attribute overwriting bug when decoding encoded numpy.timedelta64 values from disk with a dtype attribute (10468, 10469). By Spencer Clark.
Fix default "_FillValue" dtype coercion bug when encoding numpy.timedelta64 values to an on-disk format that only supports 32-bit integers (10466, 10469). By Spencer Clark.
Forward variable name down to coders for AbstractWritableDataStore.encode_variable and subclasses. (10395). By Kai Mühlbauer.
<!-- Release notes generated using configuration in .github/release.yml at main -->
<!-- Release notes generated using configuration in .github/release.yml at main -->
This is quick bugfix release to remove an unintended dependency on typing_extensions. Apologies for the trouble.
NumpyExtensionArray by @ilan-gold in https://github.com/pydata/xarray/pull/10334ndim accessible as np.ndim on PandasExtensionArray by @ilan-gold in https://github.com/pydata/xarray/pull/10414Full Changelog: https://github.com/pydata/xarray/compare/v2025.06.0...v2025.06.1
This is quick bugfix release to remove an unintended dependency on typing_extensions.
Thanks to the 4 contributors to this release: Alex Merose, Deepak Cherian, Ilan Gold and Simon Perkins
Remove dependency on typing_extensions (10413). By Simon Perkins.
Fix setuptools deprecation warnings by @gcaria in https://github.com/pydata/xarray/pull/10300
This release brings HTML reprs to the documentation, fixes to flexible Xarray indexes, performance optimizations, more ergonomic seasonal grouping and resampling with new SeasonGrouper and SeasonResampler objects, and bugfixes. Thanks to the 33 contributors to this release: Andrecho, Antoine Gibek, Benoit Bovy, Brian Michell, Christine P. Chai, David Huard, Davis Bennett, Deepak Cherian, Dimitri Papadopoulos Orfanos, Elliott Sales de Andrade, Erik, Erik Månsson, Giacomo Caria, Ilan Gold, Illviljan, Jesse Rusak, Jonathan Neuhauser, Justus Magin, Kai Mühlbauer, Kimoon Han, Konstantin Ntokas, Mark Harfouche, Michael Niklas, Nick Hodgskin, Niko Sirmpilatze, Pascal Bourgault, Scott Henderson, Simon Perkins, Spencer Clark, Tom Vo, Trevor James Smith, joseph nowak and micguerr-bopen
xarray-lmfit extension for curve fitting to ecosystem documentation by @kmnhan in https://github.com/pydata/xarray/pull/10262absolufy-imports from contributing guide by @VeckoTheGecko in https://github.com/pydata/xarray/pull/10290PandasExtensionArray from repr by @ilan-gold in https://github.com/pydata/xarray/pull/10291as_shared_dtype for extension arrays by @ilan-gold in https://github.com/pydata/xarray/pull/10292arrow dtype deep copies by @ilan-gold in https://github.com/pydata/xarray/pull/10315"Y" and "M" from DatetimeUnitOptions by @spencerkclark in https://github.com/pydata/xarray/pull/10306np.timedelta64 coding by @spencerkclark in https://github.com/pydata/xarray/pull/10101.conjugate as alias of .conj, #10302 by @joneuhauser in https://github.com/pydata/xarray/pull/10303np.datetime64 encoding prior to reform by @spencerkclark in https://github.com/pydata/xarray/pull/10352Full Changelog: https://github.com/pydata/xarray/compare/v2025.04.0...v2025.06.0
This release brings HTML reprs to the documentation, fixes to flexible Xarray indexes, performance optimizations, more ergonomic seasonal grouping and resampling with new ~xarray.groupers.SeasonGrouper and ~xarray.groupers.SeasonResampler objects, and bugfixes. Thanks to the 33 contributors to this release: Andrecho, Antoine Gibek, Benoit Bovy, Brian Michell, Christine P. Chai, David Huard, Davis Bennett, Deepak Cherian, Dimitri Papadopoulos Orfanos, Elliott Sales de Andrade, Erik, Erik Månsson, Giacomo Caria, Ilan Gold, Illviljan, Jesse Rusak, Jonathan Neuhauser, Justus Magin, Kai Mühlbauer, Kimoon Han, Konstantin Ntokas, Mark Harfouche, Michael Niklas, Nick Hodgskin, Niko Sirmpilatze, Pascal Bourgault, Scott Henderson, Simon Perkins, Spencer Clark, Tom Vo, Trevor James Smith, joseph nowak and micguerr-bopen
Switch docs to jupyter-execute sphinx extension for HTML reprs. (3893, 10383) By Scott Henderson.
Allow an Xarray index that uses multiple dimensions checking equality with another index for only a subset of those dimensions (i.e., ignoring the dimensions that are excluded from alignment). (10243, 10293) By Benoit Bovy.
New ~xarray.groupers.SeasonGrouper and ~xarray.groupers.SeasonResampler objects for ergonomic seasonal aggregation. See the docs on seasonal-grouping or blog post for more. By Deepak Cherian.
Data corruption issues arising from misaligned Dask and Zarr chunks can now be prevented using the new align_chunks parameter in ~xarray.DataArray.to_zarr. This option automatically rechunk the Dask array to align it with the Zarr storage chunks. For now, it is disabled by default, but this could change on the future. (9914, 10336) By Joseph Nowak.
HTML reprs! By Scott Henderson.
Fix ~xarray.groupers.BinGrouper when labels is not specified (10284). By Deepak Cherian.
Allow accessing arbitrary attributes on Pandas ExtensionArrays. By Deepak Cherian.
Fix coding empty (zero-size) timedelta64 arrays, units taking precedence when encoding, fallback to default values when decoding (10310, 10313). By Kai Mühlbauer.
Use dtype from intermediate sum instead of source dtype or "int" for casting of count when calculating mean in rolling for correct operations (preserve float dtypes, correct mean of bool arrays) (10340, 10341). By Kai Mühlbauer.
Improve the html repr of Xarray objects (dark mode, icons and variable attribute / data dropdown sections). (10353, 10354) By Benoit Bovy.
Raise an error when attempting to encode numpy.datetime64 values prior to the Gregorian calendar reform date of 1582-10-15 with a "standard" or "gregorian" calendar. Previously we would warn and encode these as cftime.DatetimeGregorian objects, but it is not clear that this is the user's intent, since this implicitly converts the calendar of the datetimes from "proleptic_gregorian" to "gregorian" and prevents round-tripping them as numpy.datetime64 values (10352). By Spencer Clark.
Avoid unsafe casts from float to unsigned int in CFMaskCoder (9815, 9964). By ` Elliott Sales de Andrade <https://github.com/QuLogic>`_.
Lazily indexed arrays now use less memory to store keys by avoiding copies in ~xarray.indexing.VectorizedIndexer and ~xarray.indexing.OuterIndexer (10316). By Jesse Rusak.
Fix performance regression in interp where more data was loaded than was necessary. (10287). By Deepak Cherian.
Speed up encoding of cftime.datetime objects by roughly a factor of three (8324). By Antoine Gibek.
GroupBy: Finish eagerly_compute_group deprecation by @dcherian in https://github.com/pydata/xarray/pull/10253
<!-- Release notes generated using configuration in .github/release.yml at main -->
This release brings bug fixes, better support for extension arrays including returning a
pandas.IntervalArray from groupby_bins, and performance improvements.
Thanks to the 24 contributors to this release: Alban Farchi, Andrecho, Benoit Bovy, Deepak Cherian, Dimitri Papadopoulos Orfanos, Florian Jetter, Giacomo Caria, Ilan Gold, Illviljan, Joren Hammudoglu, Julia Signell, Kai Muehlbauer, Kai Mühlbauer, Mathias Hauser, Mattia Almansi, Michael Sumner, Miguel Jimenez, Nick Hodgskin (🦎 Vecko), Pascal Bourgault, Philip Chmielowiec, Scott Henderson, Spencer Clark, Stephan Hoyer and Tom Nicholas
scipy-stubs as extra [types] dependency by @jorenham in https://github.com/pydata/xarray/pull/10202xarray.Dataset.to_stacked_array by @aFarchi in https://github.com/pydata/xarray/pull/10205DatasetView.map fix keep_attrs by @mathause in https://github.com/pydata/xarray/pull/10219test_dask_layers_and_dependencies by @fjetter in https://github.com/pydata/xarray/pull/10242np.fix by @gcaria in https://github.com/pydata/xarray/pull/10248DataTree by @jsignell in https://github.com/pydata/xarray/pull/10139_getattr__ method for PandasExtensionArray by @ilan-gold in https://github.com/pydata/xarray/pull/10250Full Changelog: https://github.com/pydata/xarray/compare/v2025.03.1...v2025.04.0
This release brings bug fixes, better support for extension arrays including returning a pandas.IntervalArray from groupby_bins, and performance improvements. Thanks to the 24 contributors to this release: Alban Farchi, Andrecho, Benoit Bovy, Deepak Cherian, Dimitri Papadopoulos Orfanos, Florian Jetter, Giacomo Caria, Ilan Gold, Illviljan, Joren Hammudoglu, Julia Signell, Kai Muehlbauer, Kai Mühlbauer, Mathias Hauser, Mattia Almansi, Michael Sumner, Miguel Jimenez, Nick Hodgskin (🦎 Vecko), Pascal Bourgault, Philip Chmielowiec, Scott Henderson, Spencer Clark, Stephan Hoyer and Tom Nicholas
By default xarray now encodes numpy.timedelta64 values by converting to numpy.int64 values and storing "dtype" and "units" attributes consistent with the dtype of the in-memory numpy.timedelta64 values, e.g. "timedelta64[s]" and "seconds" for second-resolution timedeltas. These values will always be decoded to timedeltas without a warning moving forward. Timedeltas encoded via the previous approach can still be roundtripped exactly, but in the future will not be decoded by default (1621, 10099, 10101). By Spencer Clark.
Added scipy-stubs to the xarray[types] dependencies. By Joren Hammudoglu.
Added a xarray.typing module to expose selected public types for use in downstream libraries and static type checking. (10179, 10215). By Michele Guerreri.
Improved compatibility with OPeNDAP DAP4 data model for backend engine pydap. This includes datatree support, and removing slashes from dimension names. By Miguel Jimenez-Urias.
Allow assigning index coordinates with non-array dimension(s) in a DataArray by overriding Index.should_add_coord_to_array. For example, this enables support for CF boundaries coordinate (e.g., time(time) and time_bnds(time, nbnd)) in a DataArray (10137). By Benoit Bovy.
Improved support pandas categorical extension as indices (i.e., pandas.IntervalIndex). (9661, 9671) By Ilan Gold.
Improved checks and errors raised when trying to align objects with conflicting indexes. It is now possible to align objects each with multiple indexes sharing common dimension(s). (7695, 10251) By Benoit Bovy.
The minimum versions of some dependencies were changed
Package |
Old |
New |
|---|---|---|
pydap |
3.4 |
3.5.0 |
Reductions with groupby_bins or those that involve xarray.groupers.BinGrouper now return objects indexed by pandas.IntervalArray objects, instead of numpy object arrays containing tuples. This change enables interval-aware indexing of such Xarray objects. (9671). By Ilan Gold.
Remove PandasExtensionArrayIndex from xarray.Variable.data when the attribute is a pandas.api.extensions.ExtensionArray (10263). By Ilan Gold.
The html and text repr for DataTree are now truncated. Up to 6 children are displayed for each node -- the first 3 and the last 3 children -- with a ... between them. The number of children to include in the display is configurable via options. For instance use set_options(display_max_children=8) to display 8 children rather than the default 6. (10139) By Julia Signell.
The deprecation cycle for the eagerly_compute_group kwarg to groupby and groupby_bins is now complete. By Deepak Cherian.
~xarray.Dataset.to_stacked_array now uses dimensions in order of appearance. This fixes the issue where using ~xarray.Dataset.transpose before ~xarray.Dataset.to_stacked_array had no effect. (Mentioned in 9921)
Enable keep_attrs in DatasetView.map relevant for map_over_datasets (10219) By Mathias Hauser.
Variables with no temporal dimension are left untouched by ~xarray.Dataset.convert_calendar. (10266, 10268) By Pascal Bourgault.
Enable chunk_key_encoding in ~xarray.Dataset.to_zarr for Zarr v2 Datasets (10274) By BrianMichell.
Fix references to core classes in docs (10195, 10207). By Mattia Almansi.
Fix references to point to updated pydap documentation (10182). By Miguel Jimenez-Urias.
Switch to pydata-sphinx-theme from sphinx-book-theme (8708). By Scott Henderson.
Add a dedicated 'Complex Numbers' sections to the User Guide (10213, 10235). By Andre Wendlinger.
Avoid stacking when grouping by a chunked array. This can be a large performance improvement. By Deepak Cherian.
The implementation of Variable.set_dims has changed to use array indexing syntax instead of np.broadcast_to to perform dimension expansions where all new dimensions have a size of 1. This should improve compatibility with duck arrays that do not support broadcasting (9462, 10277). By Mark Harfouche.
<!-- Release notes generated using configuration in .github/release.yml at main -->
<!-- Release notes generated using configuration in .github/release.yml at main -->
This release brings the ability to specify fill_value and write_empty_chunks for Zarr V3 stores, and a few bug fixes.
Thanks to the 10 contributors to this release:
Andrecho, Deepak Cherian, Ian Hunt-Isaak, Karl Krauth, Mathias Hauser, Maximilian Roos, Nick Hodgskin (🦎 Vecko), Spencer Clark, Tom Nicholas and wpbonelli.
fill_value on Zarr format 3 arrays by @dcherian in https://github.com/pydata/xarray/pull/10161write_empty_chunks for zarr-python 3 and up by @ianhi in https://github.com/pydata/xarray/pull/10177Full Changelog: https://github.com/pydata/xarray/compare/v2025.03.0...v2025.03.1
This release brings the ability to specify fill_value and write_empty_chunks for Zarr V3 stores, and a few bug fixes. Thanks to the 10 contributors to this release: Andrecho, Deepak Cherian, Ian Hunt-Isaak, Karl Krauth, Mathias Hauser, Maximilian Roos, Nick Hodgskin (🦎 Vecko), Spencer Clark, Tom Nicholas and wpbonelli.
Allow setting a fill_value for Zarr format 3 arrays. Specify fill_value in encoding as usual. (10064). By Deepak Cherian.
Added indexes.RangeIndex as an alternative, memory saving Xarray index representing a 1-dimensional bounded interval with evenly spaced floating values (8473, 10076). By Benoit Bovy.
Explicitly forbid appending a ~xarray.DataTree to zarr using ~xarray.DataTree.to_zarr with append_dim, because the expected behaviour is currently undefined. (9858, 10156) By Tom Nicholas.
Update the parameters of ~xarray.DataArray.to_zarr to match ~xarray.Dataset.to_zarr. This fixes the issue where using the zarr_version parameter would raise a deprecation warning telling the user to use a non-existent zarr_format parameter instead. (10163, 10164) By Karl Krauth.
DataTree.sel and DataTree.isel display the path of the first failed node again (10154). By Mathias Hauser.
Fix grouped and resampled first, last with datetimes (10169, 10173) By Deepak Cherian.
FacetGrid plots now include units in their axis labels when available (10184, 10185) By Andre Wendlinger.
deprecate cftime_range() in favor of date_range(use_cftime=True) by @Maddogghoek in https://github.com/pydata/xarray/pull/10024
<!-- Release notes generated using configuration in .github/release.yml at main --> This release brings tested support for Python 3.13, support for reading Zarr V3 datasets into a ~xarray.DataTree, significant improvements to datetime & timedelta encoding/decoding, and improvements to the ~xarray.DataTree API; in addition to the usual bug fixes and other improvements.
Thanks to the 26 contributors to this release: Alfonso Ladino, Benoit Bovy, Chuck Daniels, Deepak Cherian, Eni, Florian Jetter, Ian Hunt-Isaak, Jan, Joe Hamman, Josh Kihm, Julia Signell, Justus Magin, Kai Mühlbauer, Kobe Vandelanotte, Mathias Hauser, Max Jones, Maximilian Roos, Oliver Watt-Meyer, Sam Levang, Sander van Rijn, Spencer Clark, Stephan Hoyer, Tom Nicholas, Tom White, Vecko and maddogghoek
## What's Changed * add new section in whats-new.rst by @kmuehlbauer in https://github.com/pydata/xarray/pull/10011 * spelling fix: possibilites -> possibilities by @shoyer in https://github.com/pydata/xarray/pull/10023 * Duck array ops for all and any by @tomwhite in https://github.com/pydata/xarray/pull/9883 * map_over_datasets: fix error message for wrong result type by @mathause in https://github.com/pydata/xarray/pull/10016 * Use resolution-dependent default units for lazy time encoding by @spencerkclark in https://github.com/pydata/xarray/pull/10017 * DOC: Fix 404 on Cubed's documentation by @VeckoTheGecko in https://github.com/pydata/xarray/pull/10029 * use mean of min/max years as offset in calculation of datetime64 mean by @kmuehlbauer in https://github.com/pydata/xarray/pull/10035 * Fix dataarray drop attrs by @j-haacker in https://github.com/pydata/xarray/pull/10030 * Start splitting up dataset.py by @max-sixty in https://github.com/pydata/xarray/pull/10039 * Upgrade mypy to 1.15 by @max-sixty in https://github.com/pydata/xarray/pull/10041 * implement map_over_datasets kwargs by @kmuehlbauer in https://github.com/pydata/xarray/pull/10012 * run CI on python=3.13 by @keewis in https://github.com/pydata/xarray/pull/9681 * Add Coordinates.from_xindex method (+ refactor API doc) by @benbovy in https://github.com/pydata/xarray/pull/10000 * Add types stubs to optional dependencies by @max-sixty in https://github.com/pydata/xarray/pull/10048 * Flexible coordinate transform by @benbovy in https://github.com/pydata/xarray/pull/9543 * More precisely type pipe methods by @chuckwondo in https://github.com/pydata/xarray/pull/10038 * Default to phony_dims="access" in h5netcdf-backend by @kmuehlbauer in https://github.com/pydata/xarray/pull/10058 * More permissive Index typing by @benbovy in https://github.com/pydata/xarray/pull/10067 * Restrict fastpath isel indexes to the case of all PandasIndex by @benbovy in https://github.com/pydata/xarray/pull/10066 * deprecate cftime_range() in favor of date_range(use_cftime=True) by @Maddogghoek in https://github.com/pydata/xarray/pull/10024 * Generalize lazy backend indexing a little more by @dcherian in https://github.com/pydata/xarray/pull/10078 * Another reduction in the size of dataset.py by @max-sixty in https://github.com/pydata/xarray/pull/10088 * Prune data tree for Isomorphic operations by @kobebryant432 in https://github.com/pydata/xarray/pull/10097 * Skip failing array api test. by @dcherian in https://github.com/pydata/xarray/pull/10102 * Pass node path to tokenize in open_datatree by @slevang in https://github.com/pydata/xarray/pull/10100 * Fix false timedelta decoding SerializationWarning and improve warning message by @spencerkclark in https://github.com/pydata/xarray/pull/10072 * Add typos check to pre-commit hooks by @max-sixty in https://github.com/pydata/xarray/pull/10040 * Ensure KeyError raised for zarr datasets missing dim names by @oliverwm1 in https://github.com/pydata/xarray/pull/10025 * Improve handling of dtype and NaT when encoding/decoding masked and packaged datetimes and timedeltas by @kmuehlbauer in https://github.com/pydata/xarray/pull/10050 * fix and supress some test warnings by @mathause in https://github.com/pydata/xarray/pull/10104 * Update asv badge url in README.md by @sjvrijn in https://github.com/pydata/xarray/pull/10113 * Fix broken Zarr test by @dcherian in https://github.com/pydata/xarray/pull/10109 * Pin pandas stubs by @jsignell in https://github.com/pydata/xarray/pull/10119 * Use to_numpy in time decoding by @dcherian in https://github.com/pydata/xarray/pull/10081 * explicitly cast the dtype of where's condition parameter to bool by @keewis in https://github.com/pydata/xarray/pull/10087 * Better uv compatibility by @max-sixty in https://github.com/pydata/xarray/pull/10124 * Change python_files in pyproject.toml to a list by @max-sixty in https://github.com/pydata/xarray/pull/10127 * Don't skip tests when on a mypy branch by @max-sixty in https://github.com/pydata/xarray/pull/10129 * Fix type issues from pandas stubs by @max-sixty in https://github.com/pydata/xarray/pull/10128 * Refactor compatibility modules into xarray.compat package by @max-sixty in https://github.com/pydata/xarray/pull/10131 * Refactor modules from core into xarray.computation by @max-sixty in https://github.com/pydata/xarray/pull/10132 * Split apply_ufunc out of computation.py by @max-sixty in https://github.com/pydata/xarray/pull/10133 * Refactor concat / combine / merge into xarray/structure by @max-sixty in https://github.com/pydata/xarray/pull/10134 * Fix test_distributed::test_async by @fjetter in https://github.com/pydata/xarray/pull/10138 * Refactor datetime and timedelta encoding for increased robustness by @spencerkclark in https://github.com/pydata/xarray/pull/9498 * [docs] DataTree cannot be constructed from DataArray by @mathause in https://github.com/pydata/xarray/pull/10142 * Fix open_datatree when decode_cf=False by @ianhi in https://github.com/pydata/xarray/pull/10141 * Fix version in requires_zarr_v3 fixture by @TomNicholas in https://github.com/pydata/xarray/pull/10145 * Adds open_datatree and load_datatree to the tutorial module by @eni-awowale in https://github.com/pydata/xarray/pull/10082 * Update flaky pydap test by @dcherian in https://github.com/pydata/xarray/pull/10149 * Use flox for grouped first, last. by @dcherian in https://github.com/pydata/xarray/pull/10148 * Refactor calendar fixtures by @dcherian in https://github.com/pydata/xarray/pull/10150 * Refactoring/fixing zarr-pyhton v3 incompatibilities in xarray datatrees by @aladinor in https://github.com/pydata/xarray/pull/10020 * Release 2025.03.0 by @dcherian in https://github.com/pydata/xarray/pull/10143
## New Contributors * @j-haacker made their first contribution in https://github.com/pydata/xarray/pull/10030 * @chuckwondo made their first contribution in https://github.com/pydata/xarray/pull/10038 * @Maddogghoek made their first contribution in https://github.com/pydata/xarray/pull/10024 * @kobebryant432 made their first contribution in https://github.com/pydata/xarray/pull/10097 * @oliverwm1 made their first contribution in https://github.com/pydata/xarray/pull/10025 * @ianhi made their first contribution in https://github.com/pydata/xarray/pull/10141
Full Changelog: https://github.com/pydata/xarray/compare/v2025.01.2...v2025.03.0
This release brings tested support for Python 3.13, support for reading Zarr V3 datasets into a ~xarray.DataTree, significant improvements to datetime & timedelta encoding/decoding, and improvements to the ~xarray.DataTree API; in addition to the usual bug fixes and other improvements. Thanks to the 26 contributors to this release: Alfonso Ladino, Benoit Bovy, Chuck Daniels, Deepak Cherian, Eni, Florian Jetter, Ian Hunt-Isaak, Jan, Joe Hamman, Josh Kihm, Julia Signell, Justus Magin, Kai Mühlbauer, Kobe Vandelanotte, Mathias Hauser, Max Jones, Maximilian Roos, Oliver Watt-Meyer, Sam Levang, Sander van Rijn, Spencer Clark, Stephan Hoyer, Tom Nicholas, Tom White, Vecko and maddogghoek
Added tutorial.open_datatree and tutorial.load_datatree By Eni Awowale.
Added DataTree.filter_like to conveniently restructure a DataTree like another DataTree (10096, 10097). By Kobe Vandelanotte.
Added Coordinates.from_xindex as convenience for creating a new Coordinates object directly from an existing Xarray index object if the latter supports it (10000) By Benoit Bovy.
Allow kwargs in DataTree.map_over_datasets and map_over_datasets (10009, 10012). By Kai Mühlbauer.
support python 3.13 (no free-threading) (9664, 9681) By Justus Magin.
Added experimental support for coordinate transforms (not ready for public use yet!) (9543) By Benoit Bovy.
Similar to our numpy.datetime64 encoding path, automatically modify the units when an integer dtype is specified during eager cftime encoding, but the specified units would not allow for an exact round trip (9498). By Spencer Clark.
Support reading to GPU memory with Zarr (10078). By Deepak Cherian.
DatasetGroupBy.first and DatasetGroupBy.last can now use flox if available. (9647) By Deepak Cherian.
Rolled back code that would attempt to catch integer overflow when encoding times with small integer dtypes (8542), since it was inconsistent with xarray's handling of standard integers, and interfered with encoding times with small integer dtypes and missing values (9498). By Spencer Clark.
Warn instead of raise if phony_dims are detected when using h5netcdf-backend and phony_dims=None (10049, 10058) By Kai Mühlbauer.
Deprecate ~xarray.cftime_range in favor of ~xarray.date_range with use_cftime=True (9886, 10024). By Josh Kihm.
Move from phony_dims=None to phony_dims="access" for h5netcdf-backend(10049, 10058) By Kai Mühlbauer.
Fix open_datatree incompatibilities with Zarr-Python V3 and refactor TestZarrDatatreeIO accordingly (9960, 10020). By Alfonso Ladino-Rincon.
Default to resolution-dependent optimal integer encoding units when saving chunked non-nanosecond numpy.datetime64 or numpy.timedelta64 arrays to disk. Previously units of "nanoseconds" were chosen by default, which are optimal for nanosecond-resolution times, but not for times with coarser resolution. By Spencer Clark (10017).
Use mean of min/max years as offset in calculation of datetime64 mean (10019, 10035). By Kai Mühlbauer.
Fix DataArray().drop_attrs(deep=False) and add support for attrs to DataArray()._replace(). (10027, 10030). By Jan Haacker.
Fix bug preventing encoding times with missing values with small integer dtype (9134, 9498). By Spencer Clark.
More robustly raise an error when lazily encoding times and an integer dtype is specified with units that do not allow for an exact round trip (9498). By Spencer Clark.
Prevent false resolution change warnings from being emitted when decoding timedeltas encoded with floating point values, and make it clearer how to silence this warning message in the case that it is rightfully emitted (10071, 10072). By Spencer Clark.
Fix isel for multi-coordinate Xarray indexes (10063, 10066). By Benoit Bovy.
Fix dask tokenization when opening each node in xarray.open_datatree (10098, 10100). By Sam Levang.
Improve handling of dtype and NaT when encoding/decoding masked and packaged datetimes and timedeltas (8957, 10050). By Kai Mühlbauer.
Better expose the Coordinates class in API reference (10000) By Benoit Bovy.
<!-- Release notes generated using configuration in .github/release.yml at main --> This release brings non-nanosecond datetime and timedelta resoluti
<!-- Release notes generated using configuration in .github/release.yml at main --> This release brings non-nanosecond datetime and timedelta resolution to xarray, sharded reading in zarr, suggestion of correct names when trying to access non-existent data variables and bug fixes!
Thanks to the 16 contributors to this release: Deepak Cherian, Elliott Sales de Andrade, Jacob Prince-Bieker, Jimmy Westling, Joe Hamman, Joseph Nowak, Justus Magin, Kai Mühlbauer, Mattia Almansi, Michael Niklas, Roelof Rietbroek, Salaheddine EL FARISSI, Sam Levang, Spencer Clark, Stephan Hoyer and Tom Nicholas
shards to valid_encodings to enable sharded Zarr writing by @jacobbieker in https://github.com/pydata/xarray/pull/9948DataTree.to_zarr(compute=False) by @slevang in https://github.com/pydata/xarray/pull/9958time_unit argument to CFTimeIndex.to_datetimeindex by @spencerkclark in https://github.com/pydata/xarray/pull/9965CFTimedeltaCoder to decode_timedelta by @spencerkclark in https://github.com/pydata/xarray/pull/9966freq="D" instead of freq="d" in pd.timedelta_range by @spencerkclark in https://github.com/pydata/xarray/pull/10004numpy scalars to arrays in NamedArray.from_array by @keewis in https://github.com/pydata/xarray/pull/10008Full Changelog: https://github.com/pydata/xarray/compare/v2025.01.1...v2025.01.2
This release brings non-nanosecond datetime and timedelta resolution to xarray, sharded reading in zarr, suggestion of correct names when trying to access non-existent data variables and bug fixes!
Thanks to the 16 contributors to this release: Deepak Cherian, Elliott Sales de Andrade, Jacob Prince-Bieker, Jimmy Westling, Joe Hamman, Joseph Nowak, Justus Magin, Kai Mühlbauer, Mattia Almansi, Michael Niklas, Roelof Rietbroek, Salaheddine EL FARISSI, Sam Levang, Spencer Clark, Stephan Hoyer and Tom Nicholas
In the last couple of releases xarray has been prepared for allowing non-nanosecond datetime and timedelta resolution. The code had to be changed and adapted in numerous places, affecting especially the test suite. The documentation has been updated accordingly and a new internal chapter on internals.timecoding has been added.
To make the transition as smooth as possible this is designed to be fully backwards compatible, keeping the current default of 'ns' resolution on decoding. To opt-into decoding to other resolutions ('us', 'ms' or 's') an instance of the newly public coders.CFDatetimeCoder class can be passed through the decode_times keyword argument (see also internals.default-timeunit):
coder = xr.coders.CFDatetimeCoder(time_unit="s")
ds = xr.open_dataset(filename, decode_times=coder)
Similar control of the resolution of decoded timedeltas can be achieved through passing a coders.CFTimedeltaCoder instance to the decode_timedelta keyword argument:
coder = xr.coders.CFTimedeltaCoder(time_unit="s")
ds = xr.open_dataset(filename, decode_timedelta=coder)
though by default timedeltas will be decoded to the same time_unit as datetimes.
There might slight changes when encoding/decoding times as some warning and error messages have been removed or rewritten. Xarray will now also allow non-nanosecond datetimes (with 'us', 'ms' or 's' resolution) when creating DataArray's from scratch, picking the lowest possible resolution:
xr.DataArray(data=[np.datetime64("2000-01-01", "D")], dims=("time",))
In a future release the current default of 'ns' resolution on decoding will eventually be deprecated.
Relax nanosecond resolution restriction in CF time coding and permit numpy.datetime64 or numpy.timedelta64 dtype arrays with "s", "ms", "us", or "ns" resolution throughout xarray (7493, 9618, 9977, 9966, 9999). By Kai Mühlbauer and Spencer Clark.
Enable the compute=False option in DataTree.to_zarr. (9958). By Sam Levang.
Improve the error message raised when no key is matching the available variables in a dataset. (9943) By Jimmy Westling.
Added a time_unit argument to CFTimeIndex.to_datetimeindex. Note that in a future version of xarray, CFTimeIndex.to_datetimeindex will return a microsecond-resolution pandas.DatetimeIndex instead of a nanosecond-resolution pandas.DatetimeIndex (9965). By Spencer Clark and Kai Mühlbauer.
Adds shards to the list of valid_encodings in the zarr backend, so that sharded Zarr V3s can be written (9947, 9948). By Jacob Prince_Bieker
In a future version of xarray decoding of variables into numpy.timedelta64 values will be disabled by default. To silence warnings associated with this, set decode_timedelta to True, False, or a coders.CFTimedeltaCoder instance when opening data (1621, 9966). By Spencer Clark.
Fix DataArray.ffill, DataArray.bfill, Dataset.ffill and Dataset.bfill when the limit is bigger than the chunksize (9939). By Joseph Nowak.
Fix issues related to Pandas v3 ("us" vs. "ns" for python datetime, copy on write) and handling of 0d-numpy arrays in datetime/timedelta decoding (9953). By Kai Mühlbauer.
Remove dask-expr from CI runs, add "pyarrow" dask dependency to windows CI runs, fix related tests (9962, 9971). By Kai Mühlbauer.
Use zarr-fixture to prevent thread leakage errors (9967). By Kai Mühlbauer.
Fix weighted polyfit for arrays with more than two dimensions (9972, 9974). By Mattia Almansi.
Preserve order of variables in xarray.combine_by_coords (8828, 9070). By Kai Mühlbauer.
Cast numpy scalars to arrays in NamedArray.from_arrays (10005, 10008) By Justus Magin.
A chapter on internals.timecoding is added to the internal section (9618). By Kai Mühlbauer.
Clarified xarray's policy on API stability in the FAQ. (9854, 9855) By Tom Nicholas.
Updated time coding tests to assert exact equality rather than equality with a tolerance, since xarray's minimum supported version of cftime is greater than 1.2.1 (9961). By Spencer Clark.
split out CFDatetimeCoder, deprecate use_cftime as kwarg by @kmuehlbauer in https://github.com/pydata/xarray/pull/9901
<!-- Release notes generated using configuration in .github/release.yml at main -->
This is a quick release to bring compatibility with the Zarr V3 release. It also includes an update to the time decoding infrastructure as a step toward enabling non-nanosecond datetime support.
Full Changelog: https://github.com/pydata/xarray/compare/v2025.01.0...v2025.01.1
This is a quick release to bring compatibility with the Zarr V3 release. It also includes an update to the time decoding infrastructure as a step toward enabling non-nanosecond datetime support!
Split out coders.CFDatetimeCoder as public API in xr.coders, make decode_times keyword argument consume coders.CFDatetimeCoder (9901). By Kai Mühlbauer.
Time decoding related kwarg use_cftime is deprecated. Use keyword argument decode_times=CFDatetimeCoder(use_cftime=True) in ~xarray.open_dataset, ~xarray.open_dataarray, ~xarray.open_datatree, ~xarray.open_groups, ~xarray.open_zarr and ~xarray.decode_cf instead (9901). By Kai Mühlbauer.
Remove deprecated behavior for non-dim positional args by @max-sixty in https://github.com/pydata/xarray/pull/9864
<!-- Release notes generated using configuration in .github/release.yml at main --> This release brings much improved read performance with Zarr arrays (without consolidated metadata), better support for additional array types, as well as bugfixes and performance improvements. Thanks to the 20 contributors to this release: Bruce Merry, Davis Bennett, Deepak Cherian, Dimitri Papadopoulos Orfanos, Florian Jetter, Illviljan, Janukan Sivajeyan, Justus Magin, Kai Germaschewski, Kai Mühlbauer, Max Jones, Maximilian Roos, Michael Niklas, Patrick Peglar, Sam Levang, Scott Huberty, Spencer Clark, Stephan Hoyer, Tom Nicholas and Vecko
get_axis_num (GH 9822) by @bmerry in https://github.com/pydata/xarray/pull/9827zarr_format for zarr.consolidate_metadata by @dcherian in https://github.com/pydata/xarray/pull/9848possibly_convert_objects by @kmuehlbauer in https://github.com/pydata/xarray/pull/9900apply_ufunc by @dcherian in https://github.com/pydata/xarray/pull/9881Full Changelog: https://github.com/pydata/xarray/compare/v2024.11.0...v2025.01.0
This release brings much improved read performance with Zarr arrays (without consolidated metadata), better support for additional array types, as well as bugfixes and performance improvements. Thanks to the 20 contributors to this release: Bruce Merry, Davis Bennett, Deepak Cherian, Dimitri Papadopoulos Orfanos, Florian Jetter, Illviljan, Janukan Sivajeyan, Justus Magin, Kai Germaschewski, Kai Mühlbauer, Max Jones, Maximilian Roos, Michael Niklas, Patrick Peglar, Sam Levang, Scott Huberty, Spencer Clark, Stephan Hoyer, Tom Nicholas and Vecko
Improve the error message raised when using chunked-array methods if no chunk manager is available or if the requested chunk manager is missing (9676) By Justus Magin. (9676)
Better support wrapping additional array types (e.g. cupy or jax) by calling generalized duck array operations throughout more xarray methods. (7848, 9798). By Sam Levang.
Better performance for reading Zarr arrays in the ZarrStore class by caching the state of Zarr storage and avoiding redundant IO operations. By default, ZarrStore stores a snapshot of names and metadata of the in-scope Zarr arrays; this cache is then used when iterating over those Zarr arrays, which avoids IO operations and thereby reduces latency. (9853, 9861). By Davis Bennett.
Add unit - keyword argument to date_range and microsecond parsing to iso8601-parser (9885). By Kai Mühlbauer.
Methods including dropna, rank, idxmax, idxmin require non-dimension arguments to be passed as keyword arguments. The previous behavior, which allowed .idxmax('foo', 'all') was too easily confused with 'all' being a dimension. The updated equivalent is .idxmax('foo', how='all'). The previous behavior was deprecated in v2023.10.0. By Maximilian Roos.
Finalize deprecation of closed parameters of cftime_range and date_range (9882). By Kai Mühlbauer.
Better preservation of chunksizes in Dataset.idxmin and Dataset.idxmax (9425, 9800). By Deepak Cherian.
Much better implementation of vectorized interpolation for dask arrays (9881). By Deepak Cherian.
Fix type annotations for get_axis_num. (9822, 9827). By Bruce Merry.
Fix unintended load on datasets when calling DataArray.plot.scatter (9818). By Jimmy Westling.
Fix interpolation when non-numeric coordinate variables are present (8099, 9839). By Deepak Cherian.
Move non-CF related ensure_dtype_not_object from conventions to backends (9828). By Kai Mühlbauer.
Move handling of scalar datetimes into _possibly_convert_objects within as_compatible_data. This is consistent with how lists of these objects will be converted (9900). By Kai Mühlbauer.
Move ISO-8601 parser from coding.cftimeindex to coding.times to make it available there (prevents circular import), add capability to parse negative and/or five-digit years (9899). By Kai Mühlbauer.
Refactor of time coding to prepare for relaxing nanosecond restriction (9906). By Kai Mühlbauer.
<!-- Release notes generated using configuration in .github/release.yml at main -->
<!-- Release notes generated using configuration in .github/release.yml at main -->
ValueError for unmatching chunks length in DataArray.chunk() by @lkstrp in https://github.com/pydata/xarray/pull/9689DataTree.persist by @slevang in https://github.com/pydata/xarray/pull/9682!s conversion in f-string by @DimitriPapadopoulos in https://github.com/pydata/xarray/pull/9752min_deps_check script by @keewis in https://github.com/pydata/xarray/pull/9754map_overlap for rolling reductions with Dask by @phofl in https://github.com/pydata/xarray/pull/9770np.ndarray subclasses by @slevang in https://github.com/pydata/xarray/pull/9760ffill, bfill with dask when limit is specified by @josephnowak in https://github.com/pydata/xarray/pull/9771rolling.construct: Add sliding_window_view_kwargs to pipe arguments down to sliding_window_view by @dcherian in https://github.com/pydata/xarray/pull/9720xarray.ufuncs by @slevang in https://github.com/pydata/xarray/pull/9776fsspec by @jrbourbeau in https://github.com/pydata/xarray/pull/9797GroupBy.shuffle_to_chunks() by @dcherian in https://github.com/pydata/xarray/pull/9320Full Changelog: https://github.com/pydata/xarray/compare/v2024.10.0...v2024.11.0
This release brings better support for wrapping JAX arrays and Astropy Quantity objects, DataTree.persist, algorithmic improvements to many methods with dask (Dataset.polyfit, Dataset.ffill, Dataset.bfill, rolling reductions), and bug fixes. Thanks to the 22 contributors to this release: Benoit Bovy, Deepak Cherian, Dimitri Papadopoulos Orfanos, Holly Mandel, James Bourbeau, Joe Hamman, Justus Magin, Kai Mühlbauer, Lukas Trippe, Mathias Hauser, Maximilian Roos, Michael Niklas, Pascal Bourgault, Patrick Hoefler, Sam Levang, Sarah Charlotte Johnson, Scott Huberty, Stephan Hoyer, Tom Nicholas, Virgile Andreani, joseph nowak and tvo
Added DataTree.persist method (9675, 9682). By Sam Levang.
Added write_inherited_coords option to DataTree.to_netcdf and DataTree.to_zarr (9677). By Stephan Hoyer.
Support lazy grouping by dask arrays, and allow specifying ordered groups with UniqueGrouper(labels=["a", "b", "c"]) (2852, 757). By Deepak Cherian.
Add new automatic_rechunk kwarg to DataArrayRolling.construct and DatasetRolling.construct. This is only useful on dask>=2024.11.0 (9550). By Deepak Cherian.
Optimize ffill, bfill with dask when limit is specified (9771). By Joseph Nowak, and Patrick Hoefler.
Allow wrapping np.ndarray subclasses, e.g. astropy.units.Quantity (9704, 9760). By Sam Levang and Tien Vo.
Optimize DataArray.polyfit and Dataset.polyfit with dask, when used with arrays with more than two dimensions. (5629). By Deepak Cherian.
Support for directly opening remote files as string paths (for example, s3://bucket/data.nc) with fsspec when using the h5netcdf engine (9723, 9797). By James Bourbeau.
Re-implement the ufuncs module, which now dynamically dispatches to the underlying array's backend. Provides better support for certain wrapped array types like jax.numpy.ndarray. (7848, 9776). By Sam Levang.
Speed up loading of large zarr stores using dask arrays. (8902) By Deepak Cherian.
The minimum versions of some dependencies were changed
Package |
Old |
New |
|---|---|---|
boto3 |
1.28 |
1.29 |
dask-core |
2023.9 |
2023.11 |
distributed |
2023.9 |
2023.11 |
h5netcdf |
1.2 |
1.3 |
numbagg |
0.2.1 |
0.6 |
typing_extensions |
4.7 |
4.8 |
Grouping by a chunked array (e.g. dask or cubed) currently eagerly loads that variable in to memory. This behaviour is deprecated. If eager loading was intended, please load such arrays manually using .load() or .compute(). Else pass eagerly_compute_group=False, and provide expected group labels using the labels kwarg to a grouper object such as grouper.UniqueGrouper or grouper.BinGrouper.
Fix inadvertent deep-copying of child data in DataTree (9683, 9684). By Stephan Hoyer.
Avoid including parent groups when writing DataTree subgroups to Zarr or netCDF (9682). By Stephan Hoyer.
Fix regression in the interoperability of DataArray.polyfit and xr.polyval for date-time coordinates. (9691). By Pascal Bourgault.
Fix CF decoding of grid_mapping to allow all possible formats, add tests (9761, 9765). By Kai Mühlbauer.
Add User-Agent to request-headers when retrieving tutorial data (9774, 9782) By Kai Mühlbauer.
Mention attribute peculiarities in docs/docstrings (4798, 9700). By Kai Mühlbauer.
persist methods now route through the xr.namedarray.parallelcompat.ChunkManagerEntrypoint (9682). By Sam Levang.
Stateful test: silence DeprecationWarning from drop_dims by @dcherian in https://github.com/pydata/xarray/pull/9508
This release brings official support for xarray.DataTree, and compatibility with zarr-python v3!
Aside from these two huge features, it also improves support for vectorised interpolation and fixes various bugs.
Thanks to the 31 contributors to this release: Alfonso Ladino, DWesl, Deepak Cherian, Eni, Etienne Schalk, Holly Mandel, Ilan Gold, Illviljan, Joe Hamman, Justus Magin, Kai Mühlbauer, Karl Krauth, Mark Harfouche, Martey Dodoo, Matt Savoie, Maximilian Roos, Patrick Hoefler, Peter Hill, Renat Sibgatulin, Ryan Abernathey, Spencer Clark, Stephan Hoyer, Tom Augspurger, Tom Nicholas, Vecko, Virgile Andreani, Yvonne Fröhlich, carschandler, joseph nowak, mgunyho and owenlittlejohns
open_groups for zarr backends by @eni-awowale in https://github.com/pydata/xarray/pull/9469open_groups with zarr backends. by @eni-awowale in https://github.com/pydata/xarray/pull/9493compat error checking to disallow "minimal" in concat() by @VeckoTheGecko in https://github.com/pydata/xarray/pull/9525ExtensionArray + DataArray roundtrip by @ilan-gold in https://github.com/pydata/xarray/pull/9520numpy scalars to arrays in as_compatible_data by @keewis in https://github.com/pydata/xarray/pull/9403.rolling_exp onto .rolling's 'See also' by @max-sixty in https://github.com/pydata/xarray/pull/9534__array_function__ as a fallback for missing Array API functions by @keewis in https://github.com/pydata/xarray/pull/9530scientific-python/upload-nightly-action by @keewis in https://github.com/pydata/xarray/pull/9566.cumulative to cumsum & cumprod docstrings by @max-sixty in https://github.com/pydata/xarray/pull/9533squeeze kwarg by @Sibgatulin in https://github.com/pydata/xarray/pull/9625memo argument to DataTree.deepcopy by @shoyer in https://github.com/pydata/xarray/pull/9631map_blocks by @phofl in https://github.com/pydata/xarray/pull/9658chunks in open_groups and open_datatree by @keewis in https://github.com/pydata/xarray/pull/9660dask methods on DataTree by @keewis in https://github.com/pydata/xarray/pull/9670open_datatree by @aladinor in https://github.com/pydata/xarray/pull/9666numpy's fixed-width string dtypes by @keewis in https://github.com/pydata/xarray/pull/9586Full Changelog: https://github.com/pydata/xarray/compare/v2024.09.0...v2024.10.0
This release brings official support for xarray.DataTree, and compatibility with zarr-python v3!
Aside from these two huge features, it also improves support for vectorised interpolation and fixes various bugs.
Thanks to the 31 contributors to this release: Alfonso Ladino, DWesl, Deepak Cherian, Eni, Etienne Schalk, Holly Mandel, Ilan Gold, Illviljan, Joe Hamman, Justus Magin, Kai Mühlbauer, Karl Krauth, Mark Harfouche, Martey Dodoo, Matt Savoie, Maximilian Roos, Patrick Hoefler, Peter Hill, Renat Sibgatulin, Ryan Abernathey, Spencer Clark, Stephan Hoyer, Tom Augspurger, Tom Nicholas, Vecko, Virgile Andreani, Yvonne Fröhlich, carschandler, joseph nowak, mgunyho and owenlittlejohns
DataTree related functionality is now exposed in the main xarray public API. This includes: xarray.DataTree, xarray.open_datatree, xarray.open_groups, xarray.map_over_datasets, xarray.group_subtrees, xarray.register_datatree_accessor and xarray.testing.assert_isomorphic. By Owen Littlejohns, Eni Awowale, Matt Savoie, Stephan Hoyer, Tom Nicholas, Justus Magin, and Alfonso Ladino.
A migration guide for users of the prototype xarray-contrib/datatree repository has been added, and can be found in the DATATREE_MIGRATION_GUIDE.md file in the repository root. By Tom Nicholas.
Support for Zarr-Python 3 (95515, 9552). By Tom Augspurger, Ryan Abernathey and Joe Hamman.
Added zarr backends for open_groups (9430, 9469). By Eni Awowale.
Added support for vectorized interpolation using additional interpolators from the scipy.interpolate module (9049, 9526). By Holly Mandel.
Implement handling of complex numbers (netcdf4/h5netcdf) and enums (h5netcdf) (9246, 3297, 9509). By Kai Mühlbauer.
Fix passing missing arguments to when opening hdf5 and netCDF4 datatrees (9427, 9428). By Alfonso Ladino.
Make illegal path-like variable names when constructing a DataTree from a Dataset (9339, 9378) By Etienne Schalk.
Work around upstream pandas issue to ensure that we can decode times encoded with small integer dtype values (e.g. np.int32) in environments with NumPy 2.0 or greater without needing to fall back to cftime (9518). By Spencer Clark.
Fix bug when encoding times with missing values as floats in the case when the non-missing times could in theory be encoded with integers (9488, 9497). By Spencer Clark.
Fix a few bugs affecting groupby reductions with flox. (8090, 9398, 9648).
Fix a few bugs affecting groupby reductions with flox. (8090, 9398). By Deepak Cherian.
Fix the safe_chunks validation option on the to_zarr method (5511, 9559). By Joseph Nowak.
Fix binning by multiple variables where some bins have no observations. (9630). By Deepak Cherian.
Fix issue where polyfit wouldn't handle non-dimension coordinates. (4375, 9369) By Karl Krauth.
Migrate documentation for datatree into main xarray documentation (9033). For information on previous datatree releases, please see: datatree's historical release notes. By Owen Littlejohns, Matt Savoie, and Tom Nicholas.
fix: github workflow vulnerable to script injection by @diogoteles08 in https://github.com/pydata/xarray/pull/9331
This release drops support for Python 3.9, and adds support for grouping by multiple arrays, while providing numerous performance improvements and bug fixes.
Thanks to the 33 contributors to this release: Alfonso Ladino, Andrew Scherer, Anurag Nayak, David Hoese, Deepak Cherian, Diogo Teles Sant'Anna, Dom, Elliott Sales de Andrade, Eni, Holly Mandel, Illviljan, Jack Kelly, Julius Busecke, Justus Magin, Kai Mühlbauer, Manish Kumar Gupta, Matt Savoie, Maximilian Roos, Michele Claus, Miguel Jimenez, Niclas Rieger, Pascal Bourgault, Philip Chmielowiec, Spencer Clark, Stephan Hoyer, Tao Xin, Tiago Sanona, TimothyCera-NOAA, Tom Nicholas, Tom White, Virgile Andreani, oliverhiggs and tiago
DataTree.from_dict to be insensitive to insertion order by @TomNicholas in https://github.com/pydata/xarray/pull/92920001-01-01 by @dcherian in https://github.com/pydata/xarray/pull/9116around and round by @tomwhite in https://github.com/pydata/xarray/pull/9326python=3.9 by @keewis in https://github.com/pydata/xarray/pull/8937set_options by @tomwhite in https://github.com/pydata/xarray/pull/9362ds['x', 'y'] by @max-sixty in https://github.com/pydata/xarray/pull/9375UnsignedIntegerCoder and CFMaskCoder by @djhoese in https://github.com/pydata/xarray/pull/9274numpy 2 compatibility in the pydap backend by @Mikejmnez in https://github.com/pydata/xarray/pull/9391python-build instead of build in benchmark workflow by @philipc2 in https://github.com/pydata/xarray/pull/9406pre-commit.ci runs by @keewis in https://github.com/pydata/xarray/pull/9411DatetimeIndex in the Dataset.chunk-by-frequency tests by @keewis in https://github.com/pydata/xarray/pull/9419resample by @oliverhiggs in https://github.com/pydata/xarray/pull/9413DataTree.__delitem__ by @TomNicholas in https://github.com/pydata/xarray/pull/9453DataTree.coords.__setitem__ by adding DataTreeCoordinates class by @TomNicholas in https://github.com/pydata/xarray/pull/9451Full Changelog: https://github.com/pydata/xarray/compare/v2024.07.0...v2024.09.0
This release drops support for Python 3.9, and adds support for grouping by multiple arrays, while providing numerous performance improvements and bug fixes.
Thanks to the 33 contributors to this release: Alfonso Ladino, Andrew Scherer, Anurag Nayak, David Hoese, Deepak Cherian, Diogo Teles Sant'Anna, Dom, Elliott Sales de Andrade, Eni, Holly Mandel, Illviljan, Jack Kelly, Julius Busecke, Justus Magin, Kai Mühlbauer, Manish Kumar Gupta, Matt Savoie, Maximilian Roos, Michele Claus, Miguel Jimenez, Niclas Rieger, Pascal Bourgault, Philip Chmielowiec, Spencer Clark, Stephan Hoyer, Tao Xin, Tiago Sanona, TimothyCera-NOAA, Tom Nicholas, Tom White, Virgile Andreani, oliverhiggs and tiago
Add ~core.accessor_dt.DatetimeAccessor.days_in_year and ~core.accessor_dt.DatetimeAccessor.decimal_year to the DatetimeAccessor on xr.DataArray. (9105). By Pascal Bourgault.
Make chunk manager an option in set_options (9362). By Tom White.
Support for grouping by multiple variables. This is quite new, so please check your results and report bugs. Binary operations after grouping by multiple arrays are not supported yet. (1056, 9332, 324, 9372). By Deepak Cherian.
Allow data variable specific constant_values in the dataset pad function (9353). By Tiago Sanona.
Speed up grouping by avoiding deep-copy of non-dimension coordinates (9426, 9393) By Deepak Cherian.
Support for python 3.9 has been dropped (8937)
The minimum versions of some dependencies were changed
Package |
Old |
New |
|---|---|---|
boto3 |
1.26 |
1.28 |
cartopy |
0.21 |
0.22 |
dask-core |
2023.4 |
2023.9 |
distributed |
2023.4 |
2023.9 |
h5netcdf |
1.1 |
1.2 |
iris |
3.4 |
3.7 |
numba |
0.56 |
0.57 |
numpy |
1.23 |
1.24 |
pandas |
2.0 |
2.1 |
scipy |
1.10 |
1.11 |
typing_extensions |
4.5 |
4.7 |
zarr |
2.14 |
2.16 |
Fix bug with rechunking to a frequency when some periods contain no data (9360). By Deepak Cherian.
Fix bug causing DataTree.from_dict to be sensitive to insertion order (9276, 9292). By Tom Nicholas.
Fix resampling error with monthly, quarterly, or yearly frequencies with cftime when the time bins straddle the date "0001-01-01". For example, this can happen in certain circumstances when the time coordinate contains the date "0001-01-01". (9108, 9116) By Spencer Clark and Deepak Cherian.
Fix issue with passing parameters to ZarrStore.open_store when opening datatree in zarr format (9376, 9377). By Alfonso Ladino
Fix deprecation warning that was raised when calling np.array on an xr.DataArray in NumPy 2.0 (9312, 9393) By Andrew Scherer.
Fix support for using pandas.DateOffset, pandas.Timedelta, and datetime.timedelta objects as resample frequencies (9408, 9413). By Oliver Higgs.
Re-enable testing pydap backend with numpy>=2 (9391). By Miguel Jimenez .
groupby, resample: Deprecate some positional args by @dcherian in https://github.com/pydata/xarray/pull/9236
This release extends the API for groupby operations with various grouper objects, and includes improvements to the documentation and numerous bugfixes.
Thanks to the 22 contributors to this release: Alfonso Ladino, ChrisCleaner, David Hoese, Deepak Cherian, Dieter Werthmüller, Illviljan, Jessica Scheick, Joel Jaeschke, Justus Magin, K. Arthur Endsley, Kai Mühlbauer, Mark Harfouche, Martin Raspaud, Mathijs Verhaegh, Maximilian Roos, Michael Niklas, Michał Górny, Moritz Schreiber, Pontus Lurcock, Spencer Clark, Stephan Hoyer and Tom Nicholas
See also by @max-sixty in https://github.com/pydata/xarray/pull/8466.chunk by @mraspaud in https://github.com/pydata/xarray/pull/9099to_zarr docs by @max-sixty in https://github.com/pydata/xarray/pull/9139"D" by @keewis in https://github.com/pydata/xarray/pull/9170numpy<2 by @keewis in https://github.com/pydata/xarray/pull/9181pydap from CI by @keewis in https://github.com/pydata/xarray/pull/9183numpy in the all-but-dask CI by @keewis in https://github.com/pydata/xarray/pull/9184"source" encoding for datasets opened from fsspec objects by @keewis in https://github.com/pydata/xarray/pull/8923html[data-theme=dark]-tags by @prisae in https://github.com/pydata/xarray/pull/9200composite strategy to generate the dataframe with a tz-aware datetime column by @keewis in https://github.com/pydata/xarray/pull/9174np.complex_ dtypes with numbagg by @max-sixty in https://github.com/pydata/xarray/pull/9210np.complex64 dtype in test by @max-sixty in https://github.com/pydata/xarray/pull/9217convert_calendar by @hmaarrfk in https://github.com/pydata/xarray/pull/9192numpy 2 compatibility in the netcdf4 and h5netcdf backends by @keewis in https://github.com/pydata/xarray/pull/9136numpy 2 compatibility in the iris code paths by @keewis in https://github.com/pydata/xarray/pull/9156numpy>=2 by @keewis in https://github.com/pydata/xarray/pull/9177.drop_attrs method by @max-sixty in https://github.com/pydata/xarray/pull/8258base and loffset parameters to resample by @dcherian in https://github.com/pydata/xarray/pull/9233encode_cf_datetime benchmark by @spencerkclark in https://github.com/pydata/xarray/pull/9262open_datatree backend-specific keyword arguments by @aladinor in https://github.com/pydata/xarray/pull/9199Full Changelog: https://github.com/pydata/xarray/compare/v2024.06.0...v2024.07.0
This release extends the API for groupby operations with various grouper objects, and includes improvements to the documentation and numerous bugfixes.
Thanks to the 22 contributors to this release: Alfonso Ladino, ChrisCleaner, David Hoese, Deepak Cherian, Dieter Werthmüller, Illviljan, Jessica Scheick, Joel Jaeschke, Justus Magin, K. Arthur Endsley, Kai Mühlbauer, Mark Harfouche, Martin Raspaud, Mathijs Verhaegh, Maximilian Roos, Michael Niklas, Michał Górny, Moritz Schreiber, Pontus Lurcock, Spencer Clark, Stephan Hoyer and Tom Nicholas
Use fastpath when grouping both montonically increasing and decreasing variable in GroupBy (6220, 7427). By Joel Jaeschke.
Introduce new groupers.UniqueGrouper, groupers.BinGrouper, and groupers.TimeResampler objects as a step towards supporting grouping by multiple variables. See the docs and the grouper design doc for more. (6610, 8840). By Deepak Cherian.
Allow rechunking to a frequency using Dataset.chunk(time=TimeResampler("YE")) syntax. (7559, 9109) Such rechunking allows many time domain analyses to be executed in an embarrassingly parallel fashion. By Deepak Cherian.
Allow per-variable specification of `mask_and_scale, decode_times, decode_timedelta use_cftime and concat_characters params in ~xarray.open_dataset (9218). By Mathijs Verhaegh.
Allow chunking for arrays with duplicated dimension names (8759, 9099). By Martin Raspaud.
Extract the source url from fsspec objects (9142, 8923). By Justus Magin.
Add DataArray.drop_attrs & Dataset.drop_attrs methods, to return an object without attrs. A deep parameter controls whether variables' attrs are also dropped. By Maximilian Roos. (8288)
Added open_groups for h5netcdf and netCDF4 backends (9137, 9243). By Eni Awowale.
The base and loffset parameters to Dataset.resample and DataArray.resample are now removed. These parameters have been deprecated since v2023.03.0. Using the origin or offset parameters is recommended as a replacement for using the base parameter and using time offset arithmetic is recommended as a replacement for using the loffset parameter. (9233) By Deepak Cherian.
The squeeze kwarg to groupby is now ignored. This has been the source of some quite confusing behaviour and has been deprecated since v2024.01.0. groupby behavior is now always consistent with the existing .groupby(..., squeeze=False) behavior. No errors will be raised if squeeze=False. (9280) By Deepak Cherian.
Fix scatter plot broadcasting unnecessarily. (9129, 9206) By Jimmy Westling.
Don't convert custom indexes to pandas indexes when computing a diff (9157) By Justus Magin.
Make testing.assert_allclose work with numpy 2.0 (9165, 9166). By Pontus Lurcock.
Allow diffing objects with array attributes on variables (9153, 9169). By Justus Magin.
numpy>=2 compatibility in the netcdf4 backend (9136). By Justus Magin and Kai Mühlbauer.
Promote floating-point numeric datetimes before decoding (9179, 9182). By Justus Magin.
Address regression introduced in 9002 that prevented objects returned by DataArray.convert_calendar to be indexed by a time index in certain circumstances (9138, 9192). By Mark Harfouche and Spencer Clark.
Fix static typing of tolerance arguments by allowing str type (8892, 9194). By Michael Niklas.
Dark themes are now properly detected for html[data-theme=dark]-tags (9200). By Dieter Werthmüller.
Reductions no longer fail for np.complex_ dtype arrays when numbagg is installed. (9210) By Maximilian Roos.
Adds intro to backend section of docs, including a flow-chart to navigate types of backends (9175). By Jessica Scheick.
Adds a flow-chart diagram to help users navigate help resources (8990, 9147). By Jessica Scheick.
Improvements to Zarr & chunking docs (9139, 9140, 9132) By Maximilian Roos.
Fix copybutton for multi line examples and double digit ipython cell numbers (9264). By Moritz Schreiber.
Enable typing checks of pandas (9213). By Michael Niklas.
This release brings compatibility with numpy 2 and various performance optimizations.
This release brings compatibility with numpy 2 and various performance optimizations.
Thanks to the 22 contributors to this release: Alfonso Ladino, David Hoese, Deepak Cherian, Eni Awowale, Ilan Gold, Jessica Scheick, Joe Hamman, Justus Magin, Kai Mühlbauer, Mark Harfouche, Mathias Hauser, Matt Savoie, Maximilian Roos, Mike Thramann, Nicolas Karasiak, Owen Littlejohns, Paul Ockenfuß, Philippe THOMY, Scott Henderson, Spencer Clark, Stephan Hoyer and Tom Nicholas
PandasExtensionArray by @ilan-gold in https://github.com/pydata/xarray/pull/9032zarr to v2 by @keewis in https://github.com/pydata/xarray/pull/9050pint tests by @keewis in https://github.com/pydata/xarray/pull/8983from_dataframe by @ilan-gold in https://github.com/pydata/xarray/pull/9042pandas datetime roundtrip test with pandas=3.0 by @keewis in https://github.com/pydata/xarray/pull/9104Full Changelog: https://github.com/pydata/xarray/compare/v2024.05.0...v2024.06.0
This release brings various performance optimizations and compatibility with the upcoming numpy 2.0 release.
Thanks to the 22 contributors to this release: Alfonso Ladino, David Hoese, Deepak Cherian, Eni Awowale, Ilan Gold, Jessica Scheick, Joe Hamman, Justus Magin, Kai Mühlbauer, Mark Harfouche, Mathias Hauser, Matt Savoie, Maximilian Roos, Mike Thramann, Nicolas Karasiak, Owen Littlejohns, Paul Ockenfuß, Philippe THOMY, Scott Henderson, Spencer Clark, Stephan Hoyer and Tom Nicholas
Small optimization to the netCDF4 and h5netcdf backends (9058, 9067). By Deepak Cherian.
Small optimizations to help reduce indexing speed of datasets (9002). By Mark Harfouche.
Performance improvement in open_datatree method for Zarr, netCDF4 and h5netcdf backends (8994, 9014). By Alfonso Ladino.
Preserve conversion of timezone-aware pandas Datetime arrays to numpy object arrays (9026, 9042). By Ilan Gold.
DataArrayResample.interpolate and DatasetResample.interpolate method now support arbitrary kwargs such as order for polynomial interpolation (8762). By Nicolas Karasiak.
Add link to CF Conventions on packed data and sentence on type determination in the I/O user guide (9041, 9045). By Kai Mühlbauer.
Migrates remainder of io.py to xarray/core/datatree_io.py and TreeAttrAccessMixin into xarray/core/common.py (9011). By Owen Littlejohns and Tom Nicholas.
Compatibility with numpy 2 (8844, 8854, 8946). By Justus Magin and Stephan Hoyer.
This release brings support for pandas ExtensionArray objects, optimizations when reading Zarr, the ability to concatenate datasets without pandas ind
This release brings support for pandas ExtensionArray objects, optimizations when reading Zarr, the ability to concatenate datasets without pandas indexes,
more compatibility fixes for the upcoming numpy 2.0, and the migration of most of the xarray-datatree project code into xarray main!
Thanks to the 18 contributors to this release: Aimilios Tsouvelekakis, Andrey Akinshin, Deepak Cherian, Eni Awowale, Ilan Gold, Illviljan, Justus Magin, Mark Harfouche, Matt Savoie, Maximilian Roos, Noah C. Benson, Pascal Bourgault, Ray Bell, Spencer Clark, Tom Nicholas, ignamv, owenlittlejohns, and saschahofmann.
pd.to_timedelta instead of TimedeltaIndex by @keewis in https://github.com/pydata/xarray/pull/8938pandas ExtensionArray by @ilan-gold in https://github.com/pydata/xarray/pull/8723nan instead of NaN by @keewis in https://github.com/pydata/xarray/pull/8961pandas>=2 by @dcherian in https://github.com/pydata/xarray/pull/8968numpy>=2 by @keewis in https://github.com/pydata/xarray/pull/8978dim by @max-sixty in https://github.com/pydata/xarray/pull/8982.drop warning allow by @max-sixty in https://github.com/pydata/xarray/pull/8988test_open_mfdataset_manyfiles test by @max-sixty in https://github.com/pydata/xarray/pull/8989polyfit by @keewis in https://github.com/pydata/xarray/pull/8939test_use_cftime_false_standard_calendar_in_range as an expected failure by @spencerkclark in https://github.com/pydata/xarray/pull/8996np.cross with 3D vectors only by @keewis in https://github.com/pydata/xarray/pull/8993pandas.date_range to cftime_range by @spencerkclark in https://github.com/pydata/xarray/pull/8999region="auto" detection by @dcherian in https://github.com/pydata/xarray/pull/8997Full Changelog: https://github.com/pydata/xarray/compare/v2024.03.0...v2024.05.0
This release brings support for pandas ExtensionArray objects, optimizations when reading Zarr, the ability to concatenate datasets without pandas indexes, more compatibility fixes for the upcoming numpy 2.0, and the migration of most of the xarray-datatree project code into xarray main!
Thanks to the 18 contributors to this release: Aimilios Tsouvelekakis, Andrey Akinshin, Deepak Cherian, Eni Awowale, Ilan Gold, Illviljan, Justus Magin, Mark Harfouche, Matt Savoie, Maximilian Roos, Noah C. Benson, Pascal Bourgault, Ray Bell, Spencer Clark, Tom Nicholas, ignamv, owenlittlejohns, and saschahofmann.
New "random" method for converting to and from 360_day calendars (8603). By Pascal Bourgault.
Xarray now makes a best attempt not to coerce pandas.api.extensions.ExtensionArray to a numpy array by supporting 1D ExtensionArray objects internally where possible. Thus, Dataset objects initialized with a pd.Categorical, for example, will retain the object. However, one cannot do operations that are not possible on the ExtensionArray then, such as broadcasting. (5287, 8463, 8723) By Ilan Gold.
testing.assert_allclose / testing.assert_equal now accept a new argument check_dims="transpose", controlling whether a transposed array is considered equal. (5733, 8991) By Ignacio Martinez Vazquez.
Added the option to avoid automatically creating 1D pandas indexes in Dataset.expand_dims(), by passing the new kwarg create_index_for_new_dim=False. (8960) By Tom Nicholas.
Avoid automatically re-creating 1D pandas indexes in concat(). Also added option to avoid creating 1D indexes for new dimension coordinates by passing the new kwarg create_index_for_new_dim=False. (8871, 8872) By Tom Nicholas.
The PyNIO backend has been deleted (4491, 7301). By Deepak Cherian.
The minimum versions of some dependencies were changed, in particular our minimum supported pandas version is now Pandas 2.
Package |
Old |
New |
|---|---|---|
dask-core |
2022.12 |
2023.4 |
distributed |
2022.12 |
2023.4 |
h5py |
3.7 |
3.8 |
matplotlib-base |
3.6 |
3.7 |
packaging |
22.0 |
23.1 |
pandas |
1.5 |
2.0 |
pydap |
3.3 |
3.4 |
sparse |
0.13 |
0.14 |
typing_extensions |
4.4 |
4.5 |
zarr |
2.13 |
2.14 |
Following an upstream bug fix to pandas.date_range, date ranges produced by xarray.cftime_range with negative frequencies will now fall fully within the bounds of the provided start and end dates (8999). By Spencer Clark.
Enforces failures on CI when tests raise warnings from within xarray (8974) By Maximilian Roos
Migrates formatting_html functionality for DataTree into xarray/core (8930) By Eni Awowale, Julia Signell and Tom Nicholas.
Migrates datatree_mapping functionality into xarray/core (8948) By Matt Savoie Owen Littlejohns and Tom Nicholas.
Migrates extensions, formatting and datatree_render functionality for DataTree into xarray/core. Also migrates testing functionality into xarray/testing/assertions for DataTree. (8967) By Owen Littlejohns and Tom Nicholas.
Migrates ops.py functionality into xarray/core/datatree_ops.py (8976) By Matt Savoie and Tom Nicholas.
Migrates iterator functionality into xarray/core (8879) By Owen Littlejohns, Matt Savoie and Tom Nicholas.
transpose, set_dims, stack & unstack now use a dim kwarg rather than dims or dimensions. This is the final change to make xarray methods consistent with their use of dim. Using the existing kwarg will raise a warning. By Maximilian Roos
new whats-new section by @keewis in https://github.com/pydata/xarray/pull/8767
indexing.py: introduce .oindex for Explicitly Indexed Arrays by @andersy005 in https://github.com/pydata/xarray/pull/8750.vindex property for Explicitly Indexed Arrays by @andersy005 in https://github.com/pydata/xarray/pull/8780expand_dims by @spencerkclark in https://github.com/pydata/xarray/pull/8782upstream-dev CI to complete again by @keewis in https://github.com/pydata/xarray/pull/8823arithmetic_broadcast=False by @etienneschalk in https://github.com/pydata/xarray/pull/8784dask-expr to environment-3.12.yml by @dcherian in https://github.com/pydata/xarray/pull/8827.oindex and .vindex by @andersy005 in https://github.com/pydata/xarray/pull/8790.oindex and .vindex properties by @andersy005 in https://github.com/pydata/xarray/pull/8845xarray/core/indexing.py by @andersy005 in https://github.com/pydata/xarray/pull/8857Full Changelog: https://github.com/pydata/xarray/compare/v2024.02.0...v2024.03.0
This release brings performance improvements for grouped and resampled quantile calculations, CF decoding improvements, minor optimizations to distributed Zarr writes, and compatibility fixes for Numpy 2.0 and Pandas 3.0.
Thanks to the 18 contributors to this release: Anderson Banihirwe, Christoph Hasse, Deepak Cherian, Etienne Schalk, Justus Magin, Kai Mühlbauer, Kevin Schwarzwald, Mark Harfouche, Martin, Matt Savoie, Maximilian Roos, Ray Bell, Roberto Chang, Spencer Clark, Tom Nicholas, crusaderky, owenlittlejohns, saschahofmann
Partial writes to existing chunks with region or append_dim will now raise an error (unless safe_chunks=False); previously an error would only be raised on new variables. (8459, 8371, 8882) By Maximilian Roos.
Grouped and resampling quantile calculations now use the vectorized algorithm in flox>=0.9.4 if present. By Deepak Cherian.
Do not broadcast in arithmetic operations when global option arithmetic_broadcast=False (6806, 8784). By Etienne Schalk and Deepak Cherian.
Add the .oindex property to Explicitly Indexed Arrays for orthogonal indexing functionality. (8238, 8750) By Anderson Banihirwe.
Add the .vindex property to Explicitly Indexed Arrays for vectorized indexing functionality. (8238, 8780) By Anderson Banihirwe.
Expand use of .oindex and .vindex properties. (8790) By Anderson Banihirwe and Deepak Cherian.
Allow creating xr.Coordinates objects with no indexes (8711) By Benoit Bovy and Tom Nicholas.
Enable plotting of datetime.dates. (8866, 8873) By Sascha Hofmann.
Don't allow overwriting index variables with to_zarr region writes. (8589, 8876). By Deepak Cherian.
The default freq parameter in xr.date_range and xr.cftime_range is set to 'D' only if periods, start, or end are None (8770, 8774). By Roberto Chang.
Ensure that non-nanosecond precision numpy.datetime64 and numpy.timedelta64 values are cast to nanosecond precision values when used in DataArray.expand_dims and Dataset.expand_dims (8781). By Spencer Clark.
CF conform handling of _FillValue/missing_value and dtype in CFMaskCoder/CFScaleOffsetCoder (2304, 5597, 7691, 8713, see also discussion in 7654). By Kai Mühlbauer.
Do not cast _FillValue/missing_value in CFMaskCoder if _Unsigned is provided (8844, 8852).
Adapt handling of copy keyword argument for numpy >= 2.0dev (8844, 8851, 8865). By Kai Mühlbauer.
Import trapz/trapezoid depending on numpy version (8844, 8865). By Kai Mühlbauer.
Warn and return bytes undecoded in case of UnicodeDecodeError in h5netcdf-backend (5563, 8874). By Kai Mühlbauer.
Fix bug incorrectly disallowing creation of a dataset with a multidimensional coordinate variable with the same name as one of its dims. (8884, 8886) By Tom Nicholas.
Migrates treenode functionality into xarray/core (8757) By Matt Savoie and Tom Nicholas.
Migrates datatree functionality into xarray/core. (8789) By Owen Littlejohns, Matt Savoie and Tom Nicholas.
This release brings size information to the text repr, changes to the accepted frequency strings, and various bug fixes.
This release brings size information to the text repr, changes to the accepted frequency strings, and various bug fixes.
Thanks to our 12 contributors:
Anderson Banihirwe, Deepak Cherian, Eivind Jahren, Etienne Schalk, Justus Magin, Marco Wolsza, Mathias Hauser, Matt Savoie, Maximilian Roos, Rambaud Pierrick, Tom Nicholas
This release brings size information to the text repr, changes to the accepted frequency strings, and various bug fixes.
Thanks to our 12 contributors:
Anderson Banihirwe, Deepak Cherian, Eivind Jahren, Etienne Schalk, Justus Magin, Marco Wolsza, Mathias Hauser, Matt Savoie, Maximilian Roos, Rambaud Pierrick, Tom Nicholas
Added a simple nbytes representation in DataArrays and Dataset repr. (8690, 8702). By Etienne Schalk.
Allow negative frequency strings (e.g. "-1YE"). These strings are for example used in date_range, and cftime_range (8651). By Mathias Hauser.
Add NamedArray.expand_dims, NamedArray.permute_dims and NamedArray.broadcast_to (8380) By Anderson Banihirwe.
Xarray now defers to flox's heuristics to set the default method for groupby problems. This only applies to flox>=0.9. By Deepak Cherian.
All quantile methods (e.g. DataArray.quantile) now use numbagg for the calculation of nanquantiles (i.e., skipna=True) if it is installed. This is currently limited to the linear interpolation method (method='linear'). (7377, 8684) By Marco Wolsza.
infer_freq always returns the frequency strings as defined in pandas 2.2 (8612, 8627). By Mathias Hauser.
The dt.weekday_name parameter wasn't functional on modern pandas versions and has been removed. (8610, 8664) By Sam Coleman.
Fixed a regression that prevented multi-index level coordinates being serialized after resetting or dropping the multi-index (8628, 8672). By Benoit Bovy.
Fix bug with broadcasting when wrapping array API-compliant classes. (8665, 8669) By Tom Nicholas.
Ensure DataArray.unstack works when wrapping array API-compliant classes. (8666, 8668) By Tom Nicholas.
Fix negative slicing of Zarr arrays without dask installed. (8252) By Deepak Cherian.
Preserve chunks when writing time-like variables to zarr by enabling lazy CF encoding of time-like variables (7132, 8230, 8432, 8575). By Spencer Clark and Mattia Almansi.
Preserve chunks when writing time-like variables to zarr by enabling their lazy encoding (7132, 8230, 8432, 8253, 8575; see also discussion in 8253). By Spencer Clark and Mattia Almansi.
Raise an informative error if dtype encoding of time-like variables would lead to integer overflow or unsafe conversion from floating point to integer values (8542, 8575). By Spencer Clark.
Raise an error when unstacking a MultiIndex that has duplicates as this would lead to silent data loss (7104, 8737). By Mathias Hauser.
Fix variables arg typo in Dataset.sortby() docstring (8663, 8670) By Tom Vo.
Fixed documentation where the use of the depreciated pandas frequency string prevented the documentation from being built. (8638) By Sam Coleman.
DataArray.dt now raises an AttributeError rather than a TypeError when the data isn't datetime-like. (8718, 8724) By Maximilian Roos.
Move parallelcompat and chunk managers modules from xarray/core to xarray/namedarray. (8319) By Tom Nicholas and Anderson Banihirwe.
Imports datatree repository and history into internal location. (8688) By Matt Savoie, Justus Magin and Tom Nicholas.
Adds open_datatree into xarray/backends (8697) By Matt Savoie and Tom Nicholas.
Refactor xarray.core.indexing.DaskIndexingAdapter.__getitem__ to remove an unnecessary rewrite of the indexer key (8377, 8758) By Anderson Banihirwe.
Silence deprecation warning from .dims in tests by @max-sixty in https://github.com/pydata/xarray/pull/8639
This release is to fix a bug with the rendering of the documentation, but it also includes changes to the handling of pandas frequency strings.
normalize_axis_index if possible by @keewis in https://github.com/pydata/xarray/pull/8483user_level_warnings by @max-sixty in https://github.com/pydata/xarray/pull/8625.dims in tests by @max-sixty in https://github.com/pydata/xarray/pull/8639T_DataArray in Weighted by @max-sixty in https://github.com/pydata/xarray/pull/8630numbagg>=0.7.0 for aggregations by @max-sixty in https://github.com/pydata/xarray/pull/8624isnull using full_like instead of zeros_like by @keewis in https://github.com/pydata/xarray/pull/7395Full Changelog: https://github.com/pydata/xarray/compare/v2024.01.0...v2024.01.1
This release is to fix a bug with the rendering of the documentation, but it also includes changes to the handling of pandas frequency strings.
Following pandas, infer_freq will return "YE", instead of "Y" (formerly "A"). This is to be consistent with the deprecation of the latter frequency string in pandas 2.2. This is a follow up to 8415 (8612, 8642). By Mathias Hauser.
Following pandas, the frequency string "Y" (formerly "A") is deprecated in favor of "YE". These strings are used, for example, in date_range, cftime_range, DataArray.resample, and Dataset.resample among others (8612, 8629). By Mathias Hauser.
Pin sphinx-book-theme to 1.0.1 to fix a rendering issue with the sidebar in the docs. (8619, 8632) By Tom Nicholas.
This release brings support for weights in correlation and covariance functions, a new DataArray.cumulative aggregation, improvements to xr.map_blocks
This release brings support for weights in correlation and covariance functions,
a new DataArray.cumulative aggregation, improvements to xr.map_blocks,
an update to our minimum dependencies, and various bugfixes.
Thanks to our 17 contributors to this release:
Abel Aoun, Deepak Cherian, Illviljan, Johan Mathe, Justus Magin, Kai Mühlbauer, Llorenç Lledó, Mark Harfouche, Markel, Mathias Hauser, Maximilian Roos, Michael Niklas, Niclas Rieger, Sébastien Celles, Tom Nicholas, Trinh Quoc Anh, and crusaderky.
This release brings support for weights in correlation and covariance functions, a new DataArray.cumulative aggregation, improvements to xr.map_blocks, an update to our minimum dependencies, and various bugfixes.
Thanks to our 17 contributors to this release:
Abel Aoun, Deepak Cherian, Illviljan, Johan Mathe, Justus Magin, Kai Mühlbauer, Llorenç Lledó, Mark Harfouche, Markel, Mathias Hauser, Maximilian Roos, Michael Niklas, Niclas Rieger, Sébastien Celles, Tom Nicholas, Trinh Quoc Anh, and crusaderky.
xr.cov and xr.corr now support using weights (8527, 7392). By Llorenç Lledó.
Accept the compression arguments new in netCDF 1.6.0 in the netCDF4 backend. See netCDF4 documentation for details. Note that some new compression filters needs plugins to be installed which may not be available in all netCDF distributions. By Markel García-Díez. (6929, 7551)
Add DataArray.cumulative & Dataset.cumulative to compute cumulative aggregations, such as sum, along a dimension — for example da.cumulative('time').sum(). This is similar to pandas' .expanding, and mostly equivalent to .cumsum methods, or to DataArray.rolling with a window length equal to the dimension size. By Maximilian Roos. (8512)
Decode/Encode netCDF4 enums and store the enum definition in dataarrays' dtype metadata. If multiple variables share the same enum in netCDF4, each dataarray will have its own enum definition in their respective dtype metadata. By Abel Aoun. (8144, 8147)
The minimum versions of some dependencies were changed (8586):
Package |
Old |
New |
|---|---|---|
cartopy |
0.20 |
0.21 |
dask-core |
2022.7 |
2022.12 |
distributed |
2022.7 |
2022.12 |
flox |
0.5 |
0.7 |
iris |
3.2 |
3.4 |
matplotlib-base |
3.5 |
3.6 |
numpy |
1.22 |
1.23 |
numba |
0.55 |
0.56 |
packaging |
21.3 |
22.0 |
seaborn |
0.11 |
0.12 |
scipy |
1.8 |
1.10 |
typing_extensions |
4.3 |
4.4 |
zarr |
2.12 |
2.13 |
The squeeze kwarg to GroupBy is now deprecated. (2157, 8507) By Deepak Cherian.
Support non-string hashable dimensions in xarray.DataArray (8546, 8559). By Michael Niklas.
Reverse index output of bottleneck's rolling move_argmax/move_argmin functions (8541, 8552). By Kai Mühlbauer.
Vendor SerializableLock from dask and use as default lock for netcdf4 backends (8442, 8571). By Kai Mühlbauer.
Add tests and fixes for empty CFTimeIndex, including broken html repr (7298, 8600). By Mathias Hauser.
The implementation of map_blocks has changed to minimize graph size and duplication of data. This should be a strict improvement even though the graphs are not always embarrassingly parallel any more. Please open an issue if you spot a regression. (8412, 8409). By Deepak Cherian.
Remove null values before plotting. (8535). By Jimmy Westling.
Redirect cumulative reduction functions internally through the ChunkManagerEntryPoint, potentially allowing ~xarray.DataArray.ffill and ~xarray.DataArray.bfill to use non-dask chunked array types. (8019) By Tom Nicholas.
Fully deprecate .drop by @max-sixty in https://github.com/pydata/xarray/pull/8497
This release brings new hypothesis strategies for testing, significantly faster rolling aggregations as well as ffill and bfill with numbagg, a new Dataset.eval method, and improvements to reading and writing Zarr arrays (including a new "a-" mode).
Thanks to our 16 contributors:
Anderson Banihirwe, Ben Mares, Carl Andersson, Deepak Cherian, Doug Latornell, Gregorio L. Trevisan, Illviljan, Jens Hedegaard Nielsen, Justus Magin, Mathias Hauser, Max Jones, Maximilian Roos, Michael Niklas, Patrick Hoefler, Ryan Abernathey, Tom Nicholas
_get_alpha func by @max-sixty in https://github.com/pydata/xarray/pull/8465map_blocks docs' formatting by @max-sixty in https://github.com/pydata/xarray/pull/8464rank to run on dask arrays by @max-sixty in https://github.com/pydata/xarray/pull/8475ffill by default by @max-sixty in https://github.com/pydata/xarray/pull/8389dims to dim by @max-sixty in https://github.com/pydata/xarray/pull/8487append_dim by @rabernat in https://github.com/pydata/xarray/pull/8428.drop by @max-sixty in https://github.com/pydata/xarray/pull/8497combine_by_coords by @gtrevisan in https://github.com/pydata/xarray/pull/8471.drop_vars by @max-sixty in https://github.com/pydata/xarray/pull/8511.assign_coords by @max-sixty in https://github.com/pydata/xarray/pull/8495rolling methods by @max-sixty in https://github.com/pydata/xarray/pull/8493eval method to Dataset by @max-sixty in https://github.com/pydata/xarray/pull/7163__array_namespace__ for numpy.ndarray by @keewis in https://github.com/pydata/xarray/pull/8526Full Changelog: https://github.com/pydata/xarray/compare/v2023.11.0...v2023.12.0
This release brings new hypothesis strategies for testing, significantly faster rolling aggregations as well as ffill and bfill with numbagg, a new Dataset.eval method, and improvements to reading and writing Zarr arrays (including a new "a-" mode).
Thanks to our 16 contributors:
Anderson Banihirwe, Ben Mares, Carl Andersson, Deepak Cherian, Doug Latornell, Gregorio L. Trevisan, Illviljan, Jens Hedegaard Nielsen, Justus Magin, Mathias Hauser, Max Jones, Maximilian Roos, Michael Niklas, Patrick Hoefler, Ryan Abernathey, Tom Nicholas
Added hypothesis strategies for generating xarray.Variable objects containing arbitrary data, useful for parametrizing downstream tests. Accessible under testing.strategies, and documented in a new page on testing in the User Guide. (6911, 8404) By Tom Nicholas.
rolling uses numbagg for most of its computations by default. Numbagg is up to 5x faster than bottleneck where parallelization is possible. Where parallelization isn't possible — for example a 1D array — it's about the same speed as bottleneck, and 2-5x faster than pandas' default functions. (8493). numbagg is an optional dependency, so requires installing separately.
Use a concise format when plotting datetime arrays. (8449). By Jimmy Westling.
Avoid overwriting unchanged existing coordinate variables when appending with Dataset.to_zarr by setting mode='a-'. By Ryan Abernathey and Deepak Cherian.
~xarray.DataArray.rank now operates on dask-backed arrays, assuming the core dim has exactly one chunk. (8475). By Maximilian Roos.
Add a Dataset.eval method, similar to the pandas' method of the same name. (7163). This is currently marked as experimental and doesn't yet support the numexpr engine.
Dataset.drop_vars & DataArray.drop_vars allow passing a callable, similar to Dataset.where & Dataset.sortby & others. (8511). By Maximilian Roos.
Explicitly warn when creating xarray objects with repeated dimension names. Such objects will also now raise when DataArray.get_axis_num is called, which means many functions will raise. This latter change is technically a breaking change, but whilst allowed, this behaviour was never actually supported! (3731, 8491) By Tom Nicholas.
As part of an effort to standardize the API, we're renaming the dims keyword arg to dim for the minority of functions which current use dims. This started with xarray.dot & DataArray.dot and we'll gradually roll this out across all functions. The warnings are currently PendingDeprecationWarning, which are silenced by default. We'll convert these to DeprecationWarning in a future release. By Maximilian Roos.
Raise a FutureWarning warning that the type of Dataset.dims will be changed from a mapping of dimension names to lengths to a set of dimension names. This is to increase consistency with DataArray.dims. To access a mapping of dimension names to lengths please use Dataset.sizes. The same change also applies to DatasetGroupBy.dims. (8496, 8500) By Tom Nicholas.
Dataset.drop & DataArray.drop are now deprecated, since pending deprecation for several years. DataArray.drop_sel & DataArray.drop_var replace them for labels & variables respectively. (8497) By Maximilian Roos.
Fix dtype inference for pd.CategoricalIndex when categories are backed by a pd.ExtensionDtype (8481)
Fix writing a variable that requires transposing when not writing to a region (8484) By Maximilian Roos.
Static typing of p0 and bounds arguments of xarray.DataArray.curvefit and xarray.Dataset.curvefit was changed to Mapping (8502). By Michael Niklas.
Fix typing of xarray.DataArray.to_netcdf and xarray.Dataset.to_netcdf when compute is evaluated to bool instead of a Literal (8268). By Jens Hedegaard Nielsen.
Added illustration of updating the time coordinate values of a resampled dataset using time offset arithmetic. This is the recommended technique to replace the use of the deprecated loffset parameter in resample (8479). By Doug Latornell.
Improved error message when attempting to get a variable which doesn't exist from a Dataset. (8474) By Maximilian Roos.
Fix default value of combine_attrs in xarray.combine_by_coords (8471) By Gregorio L. Trevisan.
DataArray.bfill & DataArray.ffill now use numbagg <https://github.com/numbagg/numbagg>`_ by default, which is up to 5x faster where parallelization is possible. (8339) By Maximilian Roos.
Update mypy version to 1.7 (8448, 8501). By Michael Niklas.
Deprecate tuples of chunks? by @max-sixty in https://github.com/pydata/xarray/pull/8341
> [!NOTE] > [This is our 10th year anniversary release!](https://github.com/pydata/xarray/discussions/8462) Thank you for your love and support.
This release brings the ability to use opt_einsum for xarray.dot by default, support for auto-detecting region when writing partial datasets to Zarr, and the use of h5py drivers with h5netcdf.
Thanks to the 19 contributors to this release: Aman Bagrecha, Anderson Banihirwe, Ben Mares, Deepak Cherian, Dimitri Papadopoulos Orfanos, Ezequiel Cimadevilla Alvarez, Illviljan, Justus Magin, Katelyn FitzGerald, Kai Muehlbauer, Martin Durant, Maximilian Roos, Metamess, Sam Levang, Spencer Clark, Tom Nicholas, mgunyho, templiert
## What's Changed * [skip-ci] dev whats-new by @dcherian in https://github.com/pydata/xarray/pull/8349 * [skip-ci] Add benchmarks for Dataset binary ops, chunk by @dcherian in https://github.com/pydata/xarray/pull/8351 * Add better ASV test cases for open_dataset by @Illviljan in https://github.com/pydata/xarray/pull/8352 * Reduce dask tokenization time by @martindurant in https://github.com/pydata/xarray/pull/8339 * Deprecate tuples of chunks? by @max-sixty in https://github.com/pydata/xarray/pull/8341 * Remove unnecessary for loop when using get_axis_num by @Illviljan in https://github.com/pydata/xarray/pull/8356 * Use namedarray repr in _array_api docstrings by @Illviljan in https://github.com/pydata/xarray/pull/8355 * NamedArray.ndim can only be int by @Illviljan in https://github.com/pydata/xarray/pull/8362 * docs: add searchable word "asterisk" by @templiert in https://github.com/pydata/xarray/pull/8363 * add .imag and .real properties to NamedArray by @andersy005 in https://github.com/pydata/xarray/pull/8365 * fix NamedArray.imag and NamedArray.real typing info by @andersy005 in https://github.com/pydata/xarray/pull/8369 * Add chunkedduckarray to _typing by @Illviljan in https://github.com/pydata/xarray/pull/8376 * Do not intercept left/right keys in HTML docs by @DimitriPapadopoulos in https://github.com/pydata/xarray/pull/8379 * Docs page on interoperability by @TomNicholas in https://github.com/pydata/xarray/pull/7992 * Fix typos found by codespell by @DimitriPapadopoulos in https://github.com/pydata/xarray/pull/8375 * Use opt_einsum by default if installed. by @dcherian in https://github.com/pydata/xarray/pull/8373 * Allow Variable type as dim argument to concat by @maresb in https://github.com/pydata/xarray/pull/8384 * Remove duplicated navigation_with_keys in docs config by @Illviljan in https://github.com/pydata/xarray/pull/8390 * Add duckarray test for np.array_api by @Illviljan in https://github.com/pydata/xarray/pull/8391 * Fix sparse typing by @Illviljan in https://github.com/pydata/xarray/pull/8387 * Correct typing for _sparsearray by @Illviljan in https://github.com/pydata/xarray/pull/8395 * Port fix from pandas-dev/pandas#55283 to cftime resample by @spencerkclark in https://github.com/pydata/xarray/pull/8393 * Fix for Dataset.to_zarr with both consolidated and write_empty_chunks by @Metamess in https://github.com/pydata/xarray/pull/8326 * Test masked array by @Illviljan in https://github.com/pydata/xarray/pull/8396 * Better attr diff for testing.assert_identical by @dcherian in https://github.com/pydata/xarray/pull/8400 * Add cross-links to API docstring from tutorial and user-guide by @amanbagrecha in https://github.com/pydata/xarray/pull/8311 * [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in https://github.com/pydata/xarray/pull/8418 * Fix for date offset strings with resample loffset by @kafitzgerald in https://github.com/pydata/xarray/pull/8422 * Declare Dataset, DataArray, Variable, GroupBy unhashable by @maresb in https://github.com/pydata/xarray/pull/8392 * Add missing DataArray.dt.total_seconds() method by @maresb in https://github.com/pydata/xarray/pull/8435 * Rename to_array to to_dataarray by @max-sixty in https://github.com/pydata/xarray/pull/8438 * Remove keep_attrs from resample signature by @dcherian in https://github.com/pydata/xarray/pull/8444 * Pin pint to >=0.22 by @dcherian in https://github.com/pydata/xarray/pull/8445 * Remove PseudoNetCDF by @dcherian in https://github.com/pydata/xarray/pull/8446 * remove cdms2 by @keewis in https://github.com/pydata/xarray/pull/8441 * Automatic region detection and transpose for to_zarr() by @slevang in https://github.com/pydata/xarray/pull/8434 * Raise exception in to_dataset if resulting variable is also the name of a coordinate by @mgunyho in https://github.com/pydata/xarray/pull/8433 * Added driver parameter for h5netcdf by @zequihg50 in https://github.com/pydata/xarray/pull/8360 * Deprecate certain cftime frequency strings following pandas by @spencerkclark in https://github.com/pydata/xarray/pull/8415 * [skip-ci] Small updates to IO docs. by @dcherian in https://github.com/pydata/xarray/pull/8452 * Fix typos found by codespell by @DimitriPapadopoulos in https://github.com/pydata/xarray/pull/8457 * Pin mypy < 1.7 by @dcherian in https://github.com/pydata/xarray/pull/8458 * preserve vlen string dtypes, allow vlen string fill_values by @kmuehlbauer in https://github.com/pydata/xarray/pull/7869 * migrate the other CI to python 3.11 by @keewis in https://github.com/pydata/xarray/pull/8416 * 2023.11.0 Whats-new by @dcherian in https://github.com/pydata/xarray/pull/8461
## New Contributors * @maresb made their first contribution in https://github.com/pydata/xarray/pull/8384 * @Metamess made their first contribution in https://github.com/pydata/xarray/pull/8326 * @amanbagrecha made their first contribution in https://github.com/pydata/xarray/pull/8311 * @kafitzgerald made their first contribution in https://github.com/pydata/xarray/pull/8422 * @zequihg50 made their first contribution in https://github.com/pydata/xarray/pull/8360
Full Changelog: https://github.com/pydata/xarray/compare/v2023.10.1...v2023.11.0
Tip
This is our 10th year anniversary release! Thank you for your love and support.
This release brings the ability to use opt_einsum for xarray.dot by default, support for auto-detecting region when writing partial datasets to Zarr, and the use of h5py drivers with h5netcdf.
Thanks to the 19 contributors to this release: Aman Bagrecha, Anderson Banihirwe, Ben Mares, Deepak Cherian, Dimitri Papadopoulos Orfanos, Ezequiel Cimadevilla Alvarez, Illviljan, Justus Magin, Katelyn FitzGerald, Kai Muehlbauer, Martin Durant, Maximilian Roos, Metamess, Sam Levang, Spencer Clark, Tom Nicholas, mgunyho, templiert
Use opt_einsum for xarray.dot by default if installed. By Deepak Cherian. (7764, 8373).
Add DataArray.dt.total_seconds() method to match the Pandas API. (8435). By Ben Mares.
Allow passing region="auto" in Dataset.to_zarr to automatically infer the region to write in the original store. Also implement automatic transpose when dimension order does not match the original store. (7702, 8421, 8434). By Sam Levang.
Allow the usage of h5py drivers (eg: ros3) via h5netcdf (8360). By Ezequiel Cimadevilla.
Enable VLEN string fill_values, preserve VLEN string dtypes (1647, 7652, 7868, 7869). By Kai Mühlbauer.
drop support for cdms2. Please use xcdat instead (8441). By Justus Magin.
Following pandas, infer_freq will return "Y", "YS", "QE", "ME", "h", "min", "s", "ms", "us", or "ns" instead of "A", "AS", "Q", "M", "H", "T", "S", "L", "U", or "N". This is to be consistent with the deprecation of the latter frequency strings (8394, 8415). By Spencer Clark.
Bump minimum tested pint version to >=0.22. By Deepak Cherian.
Minimum supported versions for the following packages have changed: h5py >=3.7, h5netcdf>=1.1. By Kai Mühlbauer.
The PseudoNetCDF backend has been removed. By Deepak Cherian.
Supplying dimension-ordered sequences to DataArray.chunk & Dataset.chunk is deprecated in favor of supplying a dictionary of dimensions, or a single int or "auto" argument covering all dimensions. Xarray favors using dimensions names rather than positions, and this was one place in the API where dimension positions were used. (8341) By Maximilian Roos.
Following pandas, the frequency strings "A", "AS", "Q", "M", "H", "T", "S", "L", "U", and "N" are deprecated in favor of "Y", "YS", "QE", "ME", "h", "min", "s", "ms", "us", and "ns", respectively. These strings are used, for example, in date_range, cftime_range, DataArray.resample, and Dataset.resample among others (8394, 8415). By Spencer Clark.
Rename Dataset.to_array to Dataset.to_dataarray for consistency with DataArray.to_dataset & open_dataarray functions. This is a "soft" deprecation — the existing methods work and don't raise any warnings, given the relatively small benefits of the change. By Maximilian Roos.
Finally remove keep_attrs kwarg from DataArray.resample and Dataset.resample. These were deprecated a long time ago. By Deepak Cherian.
Port bug fix from pandas to eliminate the adjustment of resample bin edges in the case that the resampling frequency has units of days and is greater than one day (e.g. "2D", "3D" etc.) and the closed argument is set to "right" to xarray's implementation of resample for data indexed by a CFTimeIndex (8393). By Spencer Clark.
Fix to once again support date offset strings as input to the loffset parameter of resample and test this functionality (8422, 8399). By Katelyn FitzGerald.
Fix a bug where DataArray.to_dataset silently drops a variable if a coordinate with the same name already exists (8433, 7823). By András Gunyhó.
Fix for DataArray.to_zarr & Dataset.to_zarr to close the created zarr store when passing a path with .zip extension (8425). By Carl Andersson.
Small updates to documentation on distributed writes: See io.zarr.appending to Zarr. By Deepak Cherian.
This release updates our minimum numpy version in pyproject.toml to 1.22, consistent with our documentation.
This release updates our minimum numpy version in pyproject.toml to 1.22, consistent with our documentation.
Please see the v2023.10.0 release notes for our recent changes.
This release updates our minimum numpy version in pyproject.toml to 1.22, consistent with our documentation below.
This release brings performance enhancements to reading Zarr datasets, the ability to use numbagg _ for reductions, an expansion in API for rolling_ex
This release brings performance enhancements to reading Zarr datasets, the ability to use numbagg <https://github.com/numbagg/numbagg>_ for reductions, an expansion in API for rolling_exp, fixes two regressions with datetime decoding, and many other bugfixes and improvements. Groupby reductions will also use numbagg if flox>=0.8.1 and numbagg are both installed.
Thanks to our 13 contributors: Anderson Banihirwe, Bart Schilperoort, Deepak Cherian, Illviljan, Kai Mühlbauer, Mathias Hauser, Maximilian Roos, Michael Niklas, Pieter Eendebak, Simon Høxbro Hansen, Spencer Clark, Tom White, olimcc
chunks=None handling by @max-sixty in https://github.com/pydata/xarray/pull/8249check-untyped by @max-sixty in https://github.com/pydata/xarray/pull/8242lambda for other param by @max-sixty in https://github.com/pydata/xarray/pull/8256dtypes module to the namedarray package. by @andersy005 in https://github.com/pydata/xarray/pull/8250to_zarr by @max-sixty in https://github.com/pydata/xarray/pull/8257.sortby method by @max-sixty in https://github.com/pydata/xarray/pull/8273GroupBy import by @max-sixty in https://github.com/pydata/xarray/pull/8286.rolling_exp to work on dask arrays by @max-sixty in https://github.com/pydata/xarray/pull/8284reset_encoding to drop_encoding by @max-sixty in https://github.com/pydata/xarray/pull/8287ZarrArrayWrapper by @olimcc in https://github.com/pydata/xarray/pull/8297min_weight param to rolling_exp functions by @max-sixty in https://github.com/pydata/xarray/pull/8285reindex_like re broadcasting by @max-sixty in https://github.com/pydata/xarray/pull/8327corr, cov, std & var to .rolling_exp by @max-sixty in https://github.com/pydata/xarray/pull/8307pyproject.toml by @ZedThree in https://github.com/pydata/xarray/pull/8331Full Changelog: https://github.com/pydata/xarray/compare/v2023.09.0...v2023.10.0
This release brings performance enhancements to reading Zarr datasets, the ability to use numbagg for reductions, an expansion in API for rolling_exp, fixes two regressions with datetime decoding, and many other bugfixes and improvements. Groupby reductions will also use numbagg if flox>=0.8.1 and numbagg are both installed.
Thanks to our 13 contributors: Anderson Banihirwe, Bart Schilperoort, Deepak Cherian, Illviljan, Kai Mühlbauer, Mathias Hauser, Maximilian Roos, Michael Niklas, Pieter Eendebak, Simon Høxbro Hansen, Spencer Clark, Tom White, olimcc
Support high-performance reductions with numbagg. This is enabled by default if numbagg is installed. By Deepak Cherian. (8316)
Add corr, cov, std & var to .rolling_exp. By Maximilian Roos. (8307)
DataArray.where & Dataset.where accept a callable for the other parameter, passing the object as the only argument. Previously, this was only valid for the cond parameter. (8255) By Maximilian Roos.
.rolling_exp functions can now take a min_weight parameter, to only output values when there are sufficient recent non-nan values. numbagg>=0.3.1 is required. (8285) By Maximilian Roos.
DataArray.sortby & Dataset.sortby accept a callable for the variables parameter, passing the object as the only argument. By Maximilian Roos.
.rolling_exp functions can now operate on dask-backed arrays, assuming the core dim has exactly one chunk. (8284). By Maximilian Roos.
Made more arguments keyword-only (e.g. keep_attrs, skipna) for many xarray.DataArray and xarray.Dataset methods (6403). By Mathias Hauser.
Dataset.to_zarr & DataArray.to_zarr require keyword arguments after the initial 7 positional arguments. By Maximilian Roos.
Rename Dataset.reset_encoding & DataArray.reset_encoding to Dataset.drop_encoding & DataArray.drop_encoding for consistency with other drop & reset methods — drop generally removes something, while reset generally resets to some default or standard value. (8287, 8259) By Maximilian Roos.
DataArray.rename & Dataset.rename would emit a warning when the operation was a no-op. (8266) By Simon Hansen.
Fixed a regression introduced in the previous release checking time-like units when encoding/decoding masked data (8269, 8277). By Kai Mühlbauer.
Fix datetime encoding precision loss regression introduced in the previous release for datetimes encoded with units requiring floating point values, and a reference date not equal to the first value of the datetime array (8271, 8272). By Spencer Clark.
Fix excess metadata requests when using a Zarr store. Prior to this, metadata was re-read every time data was retrieved from the array, now metadata is retrieved only once when they array is initialized. (8290, 8297). By Oliver McCormack.
Fix to_zarr ending in a ReadOnlyError when consolidated metadata was used and the write_empty_chunks was provided. (8323, 8326) By Matthijs Amesz.
Added page on the interoperability of xarray objects. (7992) By Tom Nicholas.
Added xarray-regrid to the list of xarray related projects (8272). By Bart Schilperoort.
More improvements to support the Python array API standard by using duck array ops in more places in the codebase. (8267) By Tom White.
Fix PeriodIndex deprecation in xarray tests by @max-sixty in https://github.com/pydata/xarray/pull/8182
This release continues work on the new xarray.Coordinates object, allows to provide preferred_chunks when reading from netcdf files, enables xarray.apply_ufunc to handle missing core dimensions and fixes several bugs.
Thanks to the 24 contributors to this release: Alexander Fischer, Amrest Chinkamol, Benoit Bovy, Darsh Ranjan, Deepak Cherian, Gianfranco Costamagna, Gregorio L. Trevisan, Illviljan, Joe Hamman, JR, Justus Magin, Kai Mühlbauer, Kian-Meng Ang, Kyle Sunden, Martin Raspaud, Mathias Hauser, Mattia Almansi, Maximilian Roos, András Gunyhó, Michael Niklas, Richard Kleijn, Riulinchen, Tom Nicholas and Wiktor Kraśnicki.
## What's Changed * [skip-ci] dev whats-new by @dcherian in https://github.com/pydata/xarray/pull/8098 * Refactor update coordinates to better handle multi-coordinate indexes by @benbovy in https://github.com/pydata/xarray/pull/8094 * Better error message when trying to set an index from a scalar coordinate by @benbovy in https://github.com/pydata/xarray/pull/8109 * Fix merge with compat=minimal (coord names) by @benbovy in https://github.com/pydata/xarray/pull/8104 * Fix Codecov by @headtr1ck in https://github.com/pydata/xarray/pull/7142 * Better default behavior of the Coordinates constructor by @benbovy in https://github.com/pydata/xarray/pull/8107 * Document drop_variables in open_mfdataset by @jerabaul29 in https://github.com/pydata/xarray/pull/8083 * adapted the docstring of xarray.DataArray.differentiate by @afisc in https://github.com/pydata/xarray/pull/8127 * Add Coordinates.assign() method by @benbovy in https://github.com/pydata/xarray/pull/8102 * Fix pandas' interpolate(fill_value=) error by @max-sixty in https://github.com/pydata/xarray/pull/8139 * Fix doctests: pandas 2.1 MultiIndex repr with nan by @benbovy in https://github.com/pydata/xarray/pull/8141 * [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in https://github.com/pydata/xarray/pull/8145 * Cut middle version from CI by @max-sixty in https://github.com/pydata/xarray/pull/8156 * Dirty workaround for mypy 1.5 error by @benbovy in https://github.com/pydata/xarray/pull/8142 * tests: Update US/Eastern timezone to America/New_York by @LocutusOfBorg in https://github.com/pydata/xarray/pull/8153 * Docs page on internal design by @TomNicholas in https://github.com/pydata/xarray/pull/7991 * Fix tokenize with empty attrs by @malmans2 in https://github.com/pydata/xarray/pull/8101 * Consistently report all dimensions in error messages if invalid dimensions are given by @mgunyho in https://github.com/pydata/xarray/pull/8079 * Fix typos by @kianmeng in https://github.com/pydata/xarray/pull/8163 * to_stacked_array: better error msg & refactor by @mathause in https://github.com/pydata/xarray/pull/8130 * fix miscellaneous numpy=2.0 errors by @keewis in https://github.com/pydata/xarray/pull/8117 * Bump actions/checkout from 3 to 4 by @dependabot in https://github.com/pydata/xarray/pull/8169 * Don't try to sort hashable, map to string by @Illviljan in https://github.com/pydata/xarray/pull/8172 * Implement preferred_chunks for netcdf 4 backends by @mraspaud in https://github.com/pydata/xarray/pull/7948 * Fix assignment with .loc by @dranjan in https://github.com/pydata/xarray/pull/8067 * improve typing of DataArray and Dataset reductions by @rhkleijn in https://github.com/pydata/xarray/pull/6746 * FIX: handle NaT values in dt-accessor by @kmuehlbauer in https://github.com/pydata/xarray/pull/8084 * Fix PeriodIndex deprecation in xarray tests by @max-sixty in https://github.com/pydata/xarray/pull/8182 * Display data returned in apply_ufunc error message by @max-sixty in https://github.com/pydata/xarray/pull/8179 * Set dev version above released version by @max-sixty in https://github.com/pydata/xarray/pull/8181 * Remove setup.cfg in favor of pyproject.toml by @max-sixty in https://github.com/pydata/xarray/pull/8183 * Fix comment alignment in pyproject.toml by @max-sixty in https://github.com/pydata/xarray/pull/8185 * fix the failing docs by @keewis in https://github.com/pydata/xarray/pull/8188 * Fix pytest markers by @max-sixty in https://github.com/pydata/xarray/pull/8191 * Fix several warnings in the tests by @headtr1ck in https://github.com/pydata/xarray/pull/8184 * FIX: use "krogh" as interpolator method-string instead of "krog" by @kmuehlbauer in https://github.com/pydata/xarray/pull/8187 * Update contourf call check for mpl 3.8 by @ksunden in https://github.com/pydata/xarray/pull/8186 * Fix static typing with Matplotlib 3.8 by @headtr1ck in https://github.com/pydata/xarray/pull/8030 * Exclude dimensions used in faceting from squeeze by @wkrasnicki in https://github.com/pydata/xarray/pull/8174 * Remove requirements.txt by @max-sixty in https://github.com/pydata/xarray/pull/8196 * Preserve nanosecond resolution when encoding/decoding times by @kmuehlbauer in https://github.com/pydata/xarray/pull/7827 * Allow apply_ufunc to ignore missing core dims by @max-sixty in https://github.com/pydata/xarray/pull/8138 * Adjust ufunc error message by @max-sixty in https://github.com/pydata/xarray/pull/8192 * Add some more mypy checks by @max-sixty in https://github.com/pydata/xarray/pull/8193 * Fix sortby link in reshaping.rst by @gtrevisan in https://github.com/pydata/xarray/pull/8202 * remove invalid statement from doc/user-guide/io.rst by @kmuehlbauer in https://github.com/pydata/xarray/pull/8194 * Move .rolling_exp functions from reduce to apply_ufunc by @max-sixty in https://github.com/pydata/xarray/pull/8114 * Add T_DuckArray type hint to Variable.data by @Illviljan in https://github.com/pydata/xarray/pull/8203 * Attempt to reproduce #7079 in CI by @jhamman in https://github.com/pydata/xarray/pull/7488 * Add comments on when to use which TypeVar by @max-sixty in https://github.com/pydata/xarray/pull/8212 * Start a list of modules which require typing by @max-sixty in https://github.com/pydata/xarray/pull/8198 * Make documentation of DataArray.where clearer by @Riulinchen in https://github.com/pydata/xarray/pull/7955 * Removed .isel for DatasetRolling.construct consistent rolling behavior by @p4perf4ce in https://github.com/pydata/xarray/pull/7578 * Skip flaky test by @max-sixty in https://github.com/pydata/xarray/pull/8219 * Convert indexes.py to use Self for typing by @max-sixty in https://github.com/pydata/xarray/pull/8217 * Use Self rather than concrete types, remove cast`s by @max-sixty in https://github.com/pydata/xarray/pull/8216 * Allow creating DataArrays with nD coordinate variables by @dcherian in https://github.com/pydata/xarray/pull/8126 * Remove an import fallback by @max-sixty in https://github.com/pydata/xarray/pull/8228 * Add a `Literal typing by @max-sixty in https://github.com/pydata/xarray/pull/8227 * Add typing to functions related to data_vars by @Illviljan in https://github.com/pydata/xarray/pull/8226 * override units for datetime64/timedelta64 variables to preserve integer dtype by @kmuehlbauer in https://github.com/pydata/xarray/pull/8201 * test_interpolate_pd_compat with range of fill_value's by @kmuehlbauer in https://github.com/pydata/xarray/pull/8189 * Rewrite typed_ops by @headtr1ck in https://github.com/pydata/xarray/pull/8204 * adapt to NEP 51 by @keewis in https://github.com/pydata/xarray/pull/8064 * decode variable with mismatched coordinate attribute by @kmuehlbauer in https://github.com/pydata/xarray/pull/8195 * Release 2023.09.0 by @kmuehlbauer in https://github.com/pydata/xarray/pull/8229
## New Contributors * @jerabaul29 made their first contribution in https://github.com/pydata/xarray/pull/8083 * @afisc made their first contribution in https://github.com/pydata/xarray/pull/8127 * @LocutusOfBorg made their first contribution in https://github.com/pydata/xarray/pull/8153 * @kianmeng made their first contribution in https://github.com/pydata/xarray/pull/8163 * @dranjan made their first contribution in https://github.com/pydata/xarray/pull/8067 * @wkrasnicki made their first contribution in https://github.com/pydata/xarray/pull/8174 * @gtrevisan made their first contribution in https://github.com/pydata/xarray/pull/8202 * @Riulinchen made their first contribution in https://github.com/pydata/xarray/pull/7955 * @p4perf4ce made their first contribution in https://github.com/pydata/xarray/pull/7578
Full Changelog: https://github.com/pydata/xarray/compare/v2023.08.0...v2023.09.0
This release continues work on the new xarray.Coordinates object, allows to provide preferred_chunks when reading from netcdf files, enables xarray.apply_ufunc to handle missing core dimensions and fixes several bugs.
Thanks to the 24 contributors to this release: Alexander Fischer, Amrest Chinkamol, Benoit Bovy, Darsh Ranjan, Deepak Cherian, Gianfranco Costamagna, Gregorio L. Trevisan, Illviljan, Joe Hamman, JR, Justus Magin, Kai Mühlbauer, Kian-Meng Ang, Kyle Sunden, Martin Raspaud, Mathias Hauser, Mattia Almansi, Maximilian Roos, András Gunyhó, Michael Niklas, Richard Kleijn, Riulinchen, Tom Nicholas and Wiktor Kraśnicki.
We welcome the following new contributors to Xarray!: Alexander Fischer, Amrest Chinkamol, Darsh Ranjan, Gianfranco Costamagna, Gregorio L. Trevisan, Kian-Meng Ang, Riulinchen and Wiktor Kraśnicki.
Added the Coordinates.assign method that can be used to combine different collections of coordinates prior to assign them to a Dataset or DataArray (8102) at once. By Benoît Bovy.
Provide preferred_chunks for data read from netcdf files (1440, 7948). By Martin Raspaud.
Added on_missing_core_dims to apply_ufunc to allow for copying or dropping a Dataset's variables with missing core dimensions (8138). By Maximilian Roos.
The Coordinates constructor now creates a (pandas) index by default for each dimension coordinate. To keep the previous behavior (no index created), pass an empty dictionary to indexes. The constructor now also extracts and add the indexes from another Coordinates object passed via coords (8107). By Benoît Bovy.
Static typing of xlim and ylim arguments in plotting functions now must be tuple[float, float] to align with matplotlib requirements. (7802, 8030). By Michael Niklas.
Deprecate passing a pandas.MultiIndex object directly to the Dataset and DataArray constructors as well as to Dataset.assign and Dataset.assign_coords. A new Xarray Coordinates object has to be created first using Coordinates.from_pandas_multiindex (8094). By Benoît Bovy.
Improved static typing of reduction methods (6746). By Richard Kleijn.
Fix bug where empty attrs would generate inconsistent tokens (6970, 8101). By Mattia Almansi.
Improved handling of multi-coordinate indexes when updating coordinates, including bug fixes (and improved warnings for deprecated features) for pandas multi-indexes (8094). By Benoît Bovy.
Fixed a bug in merge with compat='minimal' where the coordinate names were not updated properly internally (7405, 7588, 8104). By Benoît Bovy.
Fix bug where DataArray instances on the right-hand side of DataArray.__setitem__ lose dimension names (7030, 8067). By Darsh Ranjan.
Return float64 in presence of NaT in ~core.accessor_dt.DatetimeAccessor and special case NaT handling in ~core.accessor_dt.DatetimeAccessor.isocalendar (7928, 8084). By Kai Mühlbauer.
Fix ~computation.rolling.DatasetRolling.construct with stride on Datasets without indexes. (7021, 7578). By Amrest Chinkamol and Michael Niklas.
Calling plot with kwargs col, row or hue no longer squeezes dimensions passed via these arguments (7552, 8174). By Wiktor Kraśnicki.
Fixed a bug where casting from float to int64 (undefined for NaN) led to varying issues (7817, 7942, 7790, 6191, 7096, 1064, 7827). By Kai Mühlbauer.
Fixed a bug where inaccurate coordinates silently failed to decode variable (1809, 8195). By Kai Mühlbauer
.rolling_exp functions no longer mistakenly lose non-dimensioned coords (6528, 8114). By Maximilian Roos.
In the event that user-provided datetime64/timedelta64 units and integer dtype encoding parameters conflict with each other, override the units to preserve an integer dtype for most faithful serialization to disk (1064, 8201). By Kai Mühlbauer.
Static typing of dunder ops methods (like DataArray.__eq__) has been fixed. Remaining issues are upstream problems (7780, 8204). By Michael Niklas.
Fix type annotation for center argument of plotting methods (like xarray.plot.dataarray_plot.pcolormesh) (8261). By Pieter Eendebak.
Make documentation of DataArray.where clearer (7767, 7955). By Riulinchen.
Many error messages related to invalid dimensions or coordinates now always show the list of valid dims/coords (8079). By András Gunyhó.
Refactor of encoding and decoding times/timedeltas to preserve nanosecond resolution in arrays that contain missing values (7827). By Kai Mühlbauer.
Transition .rolling_exp functions to use .apply_ufunc internally rather than .reduce, as the start of a broader effort to move non-reducing functions away from `.reduce, (8114). By Maximilian Roos.
Test range of fill_value's in test_interpolate_pd_compat (8146, 8189). By Kai Mühlbauer.
This release brings changes to minimum dependencies, allows reading of datasets where a dimension name is associated with a multidimensional variable
This release brings changes to minimum dependencies, allows reading of datasets where a dimension name is associated with a multidimensional variable (e.g. finite volume ocean model output), and introduces a new xarray.Coordinates object.
Thanks to the 16 contributors to this release: Anderson Banihirwe, Articoking, Benoit Bovy, Deepak Cherian, Harshitha, Ian Carroll, Joe Hamman, Justus Magin, Peter Hill, Rachel Wegener, Riley Kuttruff, Thomas Nicholas, Tom Nicholas, ilgast, quantsnus, vallirep
## Announcements
The xarray.Variable class is being refactored out to a new project title 'namedarray'. See the [design doc](https://github.com/pydata/xarray/blob/main/design_notes/named_array_design_doc.md) for more details. Reach out to us on this [discussion topic](https://github.com/pydata/xarray/discussions/8080) if you have any thoughts.
## What's Changed * Use variable name in all exceptions raised in as_variable by @ZedThree in https://github.com/pydata/xarray/pull/7995 * Add documentation on custom indexes by @benbovy in https://github.com/pydata/xarray/pull/6975 * Allow opening datasets with nD dimenson coordinate variables. by @dcherian in https://github.com/pydata/xarray/pull/7989 * Update copyright year in README by @dcherian in https://github.com/pydata/xarray/pull/8007 * join together duplicate entries in the text repr by @keewis in https://github.com/pydata/xarray/pull/7225 * Core team member guide by @TomNicholas in https://github.com/pydata/xarray/pull/7999 * Expose "Coordinates" as part of Xarray's public API by @benbovy in https://github.com/pydata/xarray/pull/7368 * improved docstring of to_netcdf (issue #7127) by @vallirep in https://github.com/pydata/xarray/pull/7947 * Update interpolate_na in dataset.py by @ilgast in https://github.com/pydata/xarray/pull/7974 * [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in https://github.com/pydata/xarray/pull/8014 * Add HDF5 Section to read/write docs page by @rwegener2 in https://github.com/pydata/xarray/pull/8012 * Add examples to docstrings by @harshitha1201 in https://github.com/pydata/xarray/pull/7937 * (chore) min versions bump by @jhamman in https://github.com/pydata/xarray/pull/8022 * Automatically chunk other in GroupBy binary ops. by @dcherian in https://github.com/pydata/xarray/pull/7684 * change cumproduct to cumprod by @quantsnus in https://github.com/pydata/xarray/pull/8031 * [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in https://github.com/pydata/xarray/pull/8032 * Reduce pre-commit update frequency to monthly from weekly. by @dcherian in https://github.com/pydata/xarray/pull/8033 * sort when encoding coordinates for deterministic outputs by @itcarroll in https://github.com/pydata/xarray/pull/8034 * Zarr : Allow setting write_empty_chunks by @RKuttruff in https://github.com/pydata/xarray/pull/8016 * [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in https://github.com/pydata/xarray/pull/8052 * Count documentation by @Articoking in https://github.com/pydata/xarray/pull/8057 * Bump pypa/gh-action-pypi-publish from 1.8.8 to 1.8.10 by @dependabot in https://github.com/pydata/xarray/pull/8068 * add design document for "named-array" by @andersy005 in https://github.com/pydata/xarray/pull/8073 * unpin numpy by @keewis in https://github.com/pydata/xarray/pull/8061 * Extending the glossary by @harshitha1201 in https://github.com/pydata/xarray/pull/7732 * Add 2023.08.0 whats-new by @dcherian in https://github.com/pydata/xarray/pull/8081
## New Contributors * @ZedThree made their first contribution in https://github.com/pydata/xarray/pull/7995 * @vallirep made their first contribution in https://github.com/pydata/xarray/pull/7947 * @ilgast made their first contribution in https://github.com/pydata/xarray/pull/7974 * @rwegener2 made their first contribution in https://github.com/pydata/xarray/pull/8012 * @quantsnus made their first contribution in https://github.com/pydata/xarray/pull/8031 * @RKuttruff made their first contribution in https://github.com/pydata/xarray/pull/8016 * @Articoking made their first contribution in https://github.com/pydata/xarray/pull/8057
Full Changelog: https://github.com/pydata/xarray/compare/v2023.07.0...v2023.08.0
This release brings changes to minimum dependencies, allows reading of datasets where a dimension name is associated with a multidimensional variable (e.g. finite volume ocean model output), and introduces a new xarray.Coordinates object.
Thanks to the 16 contributors to this release: Anderson Banihirwe, Articoking, Benoit Bovy, Deepak Cherian, Harshitha, Ian Carroll, Joe Hamman, Justus Magin, Peter Hill, Rachel Wegener, Riley Kuttruff, Thomas Nicholas, Tom Nicholas, ilgast, quantsnus, vallirep
The xarray.Variable class is being refactored out to a new project title 'namedarray'. See the design doc for more details. Reach out to us on this [discussion topic](https://github.com/pydata/xarray/discussions/8080) if you have any thoughts.
Coordinates can now be constructed independently of any Dataset or DataArray (it is also returned by the Dataset.coords and DataArray.coords properties). Coordinates objects are useful for passing both coordinate variables and indexes to new Dataset / DataArray objects, e.g., via their constructor or via Dataset.assign_coords. We may also wrap coordinate variables in a Coordinates object in order to skip the automatic creation of (pandas) indexes for dimension coordinates. The Coordinates.from_pandas_multiindex constructor may be used to create coordinates directly from a pandas.MultiIndex object (it is preferred over passing it directly as coordinate data, which may be deprecated soon). Like Dataset and DataArray objects, Coordinates objects may now be used in align and merge. (6392, 7368). By Benoît Bovy.
Visually group together coordinates with the same indexes in the index section of the text repr (7225). By Justus Magin.
Allow creating Xarray objects where a multidimensional variable shares its name with a dimension. Examples include output from finite volume models like FVCOM. (2233, 7989) By Deepak Cherian and Benoit Bovy.
When outputting Dataset objects as Zarr via Dataset.to_zarr, user can now specify that chunks that will contain no valid data will not be written. Originally, this could be done by specifying "write_empty_chunks": True in the encoding parameter; however, this setting would not carry over when appending new data to an existing dataset. (8009) Requires zarr>=2.11.
The minimum versions of some dependencies were changed (8022):
Package |
Old |
New |
|---|---|---|
boto3 |
1.20 |
1.24 |
cftime |
1.5 |
1.6 |
dask-core |
2022.1 |
2022.7 |
distributed |
2022.1 |
2022.7 |
hfnetcdf |
0.13 |
1.0 |
iris |
3.1 |
3.2 |
lxml |
4.7 |
4.9 |
netcdf4 |
1.5.7 |
1.6.0 |
numpy |
1.21 |
1.22 |
pint |
0.18 |
0.19 |
pydap |
3.2 |
3.3 |
rasterio |
1.2 |
1.3 |
scipy |
1.7 |
1.8 |
toolz |
0.11 |
0.12 |
typing_extensions |
4.0 |
4.3 |
zarr |
2.10 |
2.12 |
numbagg |
0.1 |
0.2.1 |
Added page on the internal design of xarray objects. (7991) By Tom Nicholas.
Added examples to docstrings of Dataset.assign_attrs, Dataset.broadcast_equals, Dataset.equals, Dataset.identical, Dataset.expand_dims, Dataset.drop_vars (6793, 7937) By Harshitha.
Add docstrings for the Index base class and add some documentation on how to create custom, Xarray-compatible indexes (6975) By Benoît Bovy.
Added a page clarifying the role of Xarray core team members. (7999) By Tom Nicholas.
Fixed broken links in "See also" section of Dataset.count (8055, 8057) By Articoking.
Extended the glossary by adding terms Aligning, Broadcasting, Merging, Concatenating, Combining, lazy, labeled, serialization, indexing (3355, 7732) By Harshitha.
as_variable now consistently includes the variable name in any exceptions raised. (7995). By Peter Hill
encode_dataset_coordinates now sorts coordinates automatically assigned to coordinates attributes during serialization (8026, 8034). By Ian Carroll.
This release brings improvements to the documentation on wrapping numpy-like arrays, improved docstrings, and bug fixes.
This release brings improvements to the documentation on wrapping numpy-like arrays, improved docstrings, and bug fixes.
Thanks to our 7 contributors:
Harshitha, Illviljan, Johan Mathe, Justus Magin, Kai Mühlbauer, Tom Nicholas, and Yvonne Fröhlich.
Full Changelog: https://github.com/pydata/xarray/compare/v2023.06.0...v2023.07.0
This release brings improvements to the documentation on wrapping numpy-like arrays, improved docstrings, and bug fixes.
hue_style is being deprecated for scatter plots. (7907, 7925). By Jimmy Westling.
Ensure no forward slashes in variable and dimension names for HDF5-based engines. (7943, 7953) By Kai Mühlbauer.
Added page on wrapping chunked numpy-like arrays as alternatives to dask arrays. (7951) By Tom Nicholas.
Expanded the page on wrapping numpy-like "duck" arrays. (7911) By Tom Nicholas.
Added examples to docstrings of Dataset.isel, Dataset.reduce, Dataset.argmin, Dataset.argmax (6793, 7881) By Harshitha .
Allow chunked non-dask arrays (i.e. Cubed arrays) in groupby operations. (7941) By Tom Nicholas.
deprecate the cdms2 conversion methods by @keewis in https://github.com/pydata/xarray/pull/7876
This release adds features to curvefit, improves the performance of concatenation, and fixes various bugs.
Thank to our 13 contributors to this release: Anderson Banihirwe, Deepak Cherian, Illviljan, Juniper Tyree, Justus Magin, Martin Fleischmann, Mattia Almansi, mgunyho, Negin Sobhani, Rutger van Haasteren, Tom Nicholas, Tom White.
pint + dask test to the newest version of pint by @keewis in https://github.com/pydata/xarray/pull/7855numpy for the expected result by @keewis in https://github.com/pydata/xarray/pull/7875numba to the py3.11 environment by @keewis in https://github.com/pydata/xarray/pull/7867cdms2 conversion methods by @keewis in https://github.com/pydata/xarray/pull/7876curvefit by @mgunyho in https://github.com/pydata/xarray/pull/7821setup-micromamba by @keewis in https://github.com/pydata/xarray/pull/7878CacheFileManager.__del__ on interpreter shutdown by @keewis in https://github.com/pydata/xarray/pull/7880Full Changelog: https://github.com/pydata/xarray/compare/v2023.05.0...v2023.06.0
This release adds features to curvefit, improves the performance of concatenation, and fixes various bugs.
Thank to our 13 contributors to this release: Anderson Banihirwe, Deepak Cherian, dependabot[bot], Illviljan, Juniper Tyree, Justus Magin, Martin Fleischmann, Mattia Almansi, mgunyho, Rutger van Haasteren, Thomas Nicholas, Tom Nicholas, Tom White.
Added support for multidimensional initial guess and bounds in DataArray.curvefit (7768, 7821). By András Gunyhó.
Add an errors option to Dataset.curve_fit that allows returning NaN for the parameters and covariances of failed fits, rather than failing the whole series of fits (6317, 7891). By Dominik Stańczak and András Gunyhó.
Deprecate the cdms2 conversion methods (7876) By Justus Magin.
Improve concatenation performance (7833, 7824). By Jimmy Westling.
Fix bug where weighted polyfit were changing the original object (5644, 7900). By Mattia Almansi.
Don't call CachingFileManager.__del__ on interpreter shutdown (7814, 7880). By Justus Magin.
Preserve vlen dtype for empty string arrays (7328, 7862). By Tom White and Kai Mühlbauer.
Ensure dtype of reindex result matches dtype of the original DataArray (7299, 7917) By Anderson Banihirwe.
Fix bug where a zero-length zarr chunk_store was ignored as if it was None (7923) By Juniper Tyree.
Minor improvements to support of the python array api standard, internally using the function xp.astype() instead of the method arr.astype(), as the latter is not in the standard. (7847) By Tom Nicholas.
Xarray now uploads nightly wheels to https://pypi.anaconda.org/scientific-python-nightly-wheels/simple/ (7863, 7865). By Martin Fleischmann.
Stop uploading development wheels to TestPyPI (7889) By Justus Magin.
Added an exception catch for AttributeError along with ImportError when duck typing the dynamic imports in pycompat.py. This catches some name collisions between packages. (7870, 7874)
This release adds some new methods and operators, updates our deprecation policy for python versions, fixes some bugs with groupby, and introduces exp…
This release adds some new methods and operators, updates our deprecation policy for python versions, fixes some bugs with groupby, and introduces experimental support for alternative chunked parallel array computation backends via a new plugin system!
Note: If you are using a locally-installed development version of xarray then pulling the changes from this release may require you to re-install. This avoids an error where xarray cannot detect dask via the new entrypoints system introduced in pull rquest #7019. See issue #7856 for details.
Thanks to our 14 contributors: Alan Brammer, crusaderky, David Stansby, dcherian, Deeksha, Deepak Cherian, Illviljan, James McCreight, Joe Hamman, Justus Magin, Kyle Sunden, Max Hollmann, mgunyho, and Tom Nicholas!
This release adds some new methods and operators, updates our deprecation policy for python versions, fixes some bugs with groupby, and introduces experimental support for alternative chunked parallel array computation backends via a new plugin system!
Note: If you are using a locally-installed development version of xarray then pulling the changes from this release may require you to re-install. This avoids an error where xarray cannot detect dask via the new entrypoints system introduced in 7019. See 7856 for details.
Thanks to our 14 contributors: Alan Brammer, crusaderky, David Stansby, dcherian, Deeksha, Deepak Cherian, Illviljan, James McCreight, Joe Hamman, Justus Magin, Kyle Sunden, Max Hollmann, mgunyho, and Tom Nicholas
Added new method DataArray.to_dask_dataframe, convert a dataarray into a dask dataframe (7409). By Deeksha.
Add support for lshift and rshift binary operators (<<, >>) on xr.DataArray of type int (7727 , 7741). By Alan Brammer.
Keyword argument data='array' to both xarray.Dataset.to_dict and xarray.DataArray.to_dict will now return data as the underlying array type. Python lists are returned for data='list' or data=True. Supplying data=False only returns the schema without data. encoding=True returns the encoding dictionary for the underlying variable also. (1599, 7739) . By James McCreight.
adjust the deprecation policy for python to once again align with NEP-29 (7765, 7793) By Justus Magin.
Optimize .dt `` accessor performance with ``CFTimeIndex. (7796) By Deepak Cherian.
Fix as_compatible_data for masked float arrays, now always creates a copy when mask is present (2377, 7788). By Max Hollmann.
Fix groupby binary ops when grouped array is subset relative to other. (7797). By Deepak Cherian.
Fix groupby sum, prod for all-NaN groups with flox. (7808). By Deepak Cherian.
Experimental support for wrapping chunked array libraries other than dask. A new ABC is defined - xr.namedarray.parallelcompat.ChunkManagerEntrypoint - which can be subclassed and then registered by alternative chunked array implementations. (6807, 7019) By Tom Nicholas.
This is a bugfix release to fix another bug with binning
This is a bugfix release to fix another bug with binning (#7766)
Full Changelog: https://github.com/pydata/xarray/compare/v2023.04.1...v2023.04.2
This is a patch release to fix a bug with binning (7766)
Fix binning when labels is specified. (7766). By Deepak Cherian.
Added examples to docstrings for xarray.core.accessor_str.StringAccessor methods. (7669) . By Mary Gathoni.
This is a patch release to fix a bug with groupby_bins
This is a patch release to fix a bug with groupby_bins
Full Changelog: https://github.com/pydata/xarray/compare/v2023.04.0...v2023.04.1
This is a patch release to fix a bug with binning (7759)
Fix binning by unsorted arrays. (7759)
This release includes support for pandas v2, allows refreshing of backend engines in a session, and removes deprecated backends for rasterio and cfgri…
This release includes support for pandas v2, allows refreshing of backend engines in a session, and removes deprecated backends
for rasterio and cfgrib.
Thanks to our 19 contributors: Chinemere, Tom Coleman, Deepak Cherian, Harshitha, Illviljan, Jessica Scheick, Joe Hamman, Justus Magin, Kai Mühlbauer, Kwonil-Kim, Mary Gathoni, Michael Niklas, Pierre, Scott Henderson, Shreyal Gupta, Spencer Clark, mccloskey, nishtha981, veenstrajelmer
Full Changelog: https://github.com/pydata/xarray/compare/v2023.03.0...v2023.04.0
This release includes support for pandas v2, allows refreshing of backend engines in a session, and removes deprecated backends for rasterio and cfgrib.
Thanks to our 19 contributors: Chinemere, Tom Coleman, Deepak Cherian, Harshitha, Illviljan, Jessica Scheick, Joe Hamman, Justus Magin, Kai Mühlbauer, Kwonil-Kim, Mary Gathoni, Michael Niklas, Pierre, Scott Henderson, Shreyal Gupta, Spencer Clark, mccloskey, nishtha981, veenstrajelmer
We welcome the following new contributors to Xarray!: Mary Gathoni, Harshitha, veenstrajelmer, Chinemere, nishtha981, Shreyal Gupta, Kwonil-Kim, mccloskey.
New methods to reset an objects encoding (Dataset.reset_encoding, DataArray.reset_encoding). (7686, 7689). By Joe Hamman.
Allow refreshing backend engines with xarray.backends.refresh_engines (7478, 7523). By Michael Niklas.
Added ability to save DataArray objects directly to Zarr using ~xarray.DataArray.to_zarr. (7692, 7693) . By Joe Hamman.
Remove deprecated rasterio backend in favor of rioxarray (7392). By Scott Henderson.
Optimize alignment with join="exact", copy=False by avoiding copies. (7736) By Deepak Cherian.
Avoid unnecessary copies of CFTimeIndex. (7735) By Deepak Cherian.
Fix xr.polyval with non-system standard integer coeffs (7619). By Shreyal Gupta and Michael Niklas.
Improve error message when trying to open a file which you do not have permission to read (6523, 7629). By Thomas Coleman.
Proper plotting when passing ~matplotlib.colors.BoundaryNorm type argument in DataArray.plot. (4061, 7014,7553) By Jelmer Veenstra.
Ensure the formatting of time encoding reference dates outside the range of nanosecond-precision datetimes remains the same under pandas version 2.0.0 (7420, 7441). By Justus Magin and Spencer Clark.
Various dtype related fixes needed to support pandas>=2.0 (7724) By Justus Magin.
Preserve boolean dtype within encoding (7652, 7720). By Kai Mühlbauer
Update FAQ page on how do I open format X file as an xarray dataset? (1285, 7638) using ~xarray.open_dataset By Harshitha , Tom Nicholas.
Don't assume that arrays read from disk will be Numpy arrays. This is a step toward enabling reads from a Zarr store using the Kvikio or TensorStore libraries. (6874). By Deepak Cherian.
Remove internal support for reading GRIB files through the cfgrib backend. cfgrib now uses the external backend interface, so no existing code should break. By Deepak Cherian.
Implement CF coding functions in VariableCoders (7719). By Kai Mühlbauer
Added a config.yml file with messages for the welcome bot when a Github user creates their first ever issue or pull request or has their first PR merged. (7685, 7685) By Nishtha P.
Ensure that only nanosecond-precision pd.Timestamp objects continue to be used internally under pandas version 2.0.0. This is mainly to ease the transition to this latest version of pandas. It should be relaxed when addressing 7493. By Spencer Clark (7707, 7731).
This release brings many bug fixes, and some new features. The maximum pandas version is pinned to <2 until we can support the new pandas datetime typ
This release brings many bug fixes, and some new features. The maximum pandas version is pinned to <2 until we can support the new pandas datetime types.
Thanks to our 19 contributors:
Abel Aoun, Alex Goodman, Deepak Cherian, Illviljan, Jody Klymak, Joe Hamman, Justus Magin, Mary Gathoni, Mathias Hauser, Mattia Almansi, Mick, Oriol Abril-Pla, Patrick Hoefler, Paul Ockenfuß, Pierre, Shreyal Gupta, Spencer Clark, Tom Nicholas, Tom Vo
Full Changelog: https://github.com/pydata/xarray/compare/v2023.02.0...v2023.03.0
This release brings many bug fixes, and some new features. The maximum pandas version is pinned to <2 until we can support the new pandas datetime types. Thanks to our 19 contributors: Abel Aoun, Alex Goodman, Deepak Cherian, Illviljan, Jody Klymak, Joe Hamman, Justus Magin, Mary Gathoni, Mathias Hauser, Mattia Almansi, Mick, Oriol Abril-Pla, Patrick Hoefler, Paul Ockenfuß, Pierre, Shreyal Gupta, Spencer Clark, Tom Nicholas, Tom Vo
Fix xr.cov and xr.corr now support complex valued arrays (7340, 7392). By Michael Niklas.
Allow indexing along unindexed dimensions with dask arrays (2511, 4276, 4663, 5873). By Abel Aoun and Deepak Cherian.
Support dask arrays in first and last reductions. By Deepak Cherian.
Improved performance in open_dataset for datasets with large object arrays (7484, 7494). By Alex Goodman and Deepak Cherian.
Following pandas, the base and loffset parameters of xr.DataArray.resample and xr.Dataset.resample have been deprecated and will be removed in a future version of xarray. Using the origin or offset parameters is recommended as a replacement for using the base parameter and using time offset arithmetic is recommended as a replacement for using the loffset parameter (8459). By Spencer Clark.
Improve error message when using in Dataset.drop_vars to state which variables can't be dropped. (7518) By Tom Nicholas.
Require to explicitly defining optional dimensions such as hue and markersize for scatter plots. (7314, 7277). By Jimmy Westling.
Fix matplotlib raising a UserWarning when plotting a scatter plot with an unfilled marker (7313, 7318). By Jimmy Westling.
Fix issue with max_gap in interpolate_na, when applied to multidimensional arrays. (7597, 7598). By Paul Ockenfuß.
Fix DataArray.plot.pcolormesh which now works if one of the coordinates has str dtype (6775, 7612). By Michael Niklas.
Clarify language in contributor's guide (7495, 7595) By Tom Nicholas.
Pin pandas to <2. By Deepak Cherian.
This release brings a major upgrade to xarray.concat, many bug fixes, and a bump in supported dependency versions. Thanks to our 11 contributors: Aron
This release brings a major upgrade to xarray.concat, many bug fixes, and a bump in supported dependency versions. Thanks to our 11 contributors: Aron Gergely, Deepak Cherian, Illviljan, James Bourbeau, Joe Hamman, Justus Magin, Hauke Schulz, Kai Mühlbauer, Ken Mankoff, Spencer Clark, Tom Nicholas.
Support for python 3.8 has been dropped.
This release brings a major upgrade to xarray.concat, many bug fixes, and a bump in supported dependency versions. Thanks to our 11 contributors: Aron Gergely, Deepak Cherian, Illviljan, James Bourbeau, Joe Hamman, Justus Magin, Hauke Schulz, Kai Mühlbauer, Ken Mankoff, Spencer Clark, Tom Nicholas.
Support for python 3.8 has been dropped and the minimum versions of some dependencies were changed (7461):
Package |
Old |
New |
|---|---|---|
python |
3.8 |
3.9 |
numpy |
1.20 |
1.21 |
pandas |
1.3 |
1.4 |
dask |
2021.11 |
2022.1 |
distributed |
2021.11 |
2022.1 |
h5netcdf |
0.11 |
0.13 |
lxml |
4.6 |
4.7 |
numba |
5.4 |
5.5 |
Following pandas, the closed parameters of cftime_range and date_range are deprecated in favor of the inclusive parameters, and will be removed in a future version of xarray (6985:, 7373). By Spencer Clark.
xarray.concat can now concatenate variables present in some datasets but not others (508, 7400). By Kai Mühlbauer and Scott Chamberlin.
Handle keep_attrs option in binary operators of Dataset (7390, 7391). By Aron Gergely.
Improve error message when using dask in apply_ufunc with output_sizes not supplied. (7509) By Tom Nicholas.
xarray.Dataset.to_zarr now drops variable encodings that have been added by xarray during reading a dataset. (7129, 7500). By Hauke Schulz.
Mention the flox package in GroupBy documentation and docstrings. By Deepak Cherian.
See https://docs.xarray.dev/en/stable/whats-new.html
See https://docs.xarray.dev/en/stable/whats-new.html
This release includes a number of bug fixes. Thanks to the 14 contributors to this release: Aron Gergely, Benoit Bovy, Deepak Cherian, Ian Carroll, Illviljan, Joe Hamman, Justus Magin, Mark Harfouche, Matthew Roeschke, Paige Martin, Pierre, Sam Levang, Tom White, stefank0.
CFTimeIndex.get_loc has removed the method and tolerance keyword arguments. Use .get_indexer([key], method=..., tolerance=...) instead (7361). By Matthew Roeschke.
Avoid in-memory broadcasting when converting to a dask dataframe using .to_dask_dataframe. (6811, 7472). By Jimmy Westling.
Accessing the property .nbytes of a DataArray, or Variable no longer accidentally triggers loading the variable into memory.
Allow numpy-only objects in where when keep_attrs=True (7362, 7364). By Sam Levang.
add a keep_attrs parameter to Dataset.pad, DataArray.pad, and Variable.pad (7267). By Justus Magin.
Fixed performance regression in alignment between indexed and non-indexed objects of the same shape (7382). By Benoît Bovy.
Preserve original dtype on accessing MultiIndex levels (7250, 7393). By Ian Carroll.
Add the pre-commit hook absolufy-imports to convert relative xarray imports to absolute imports (7204, 7370). By Jimmy Westling.
The PyNIO backend has been deprecated (4491, 7301). By Joe Hamman _.
This release includes a number of bug fixes and experimental support for Zarr V3. Thanks to the 16 contributors to this release: Deepak Cherian, Francesco Zanetta, Gregory Lee, Illviljan, Joe Hamman, Justus Magin, Luke Conibear, Mark Harfouche, Mathias Hauser, Mick, Mike Taves, Sam Levang, Spencer Clark, Tom Nicholas, Wei Ji, templiert
## New Features - Enable using offset and origin arguments in DataArray.resample
and Dataset.resample (7266, 7284). By Spencer Clark.
Add experimental support for Zarr's in-progress V3 specification. (6475). By Gregory Lee and Joe Hamman.
## Breaking changes
The minimum versions of some dependencies were changed (7300):
Package |
Old |
New |
|---|---|---|
boto |
1.18 |
1.20 |
cartopy |
0.19 |
0.20 |
distributed |
2021.09 |
2021.11 |
dask |
2021.09 |
2021.11 |
h5py |
3.1 |
3.6 |
hdf5 |
1.10 |
1.12 |
matplotlib-base |
3.4 |
3.5 |
nc-time-axis |
1.3 |
1.4 |
netcdf4 |
1.5.3 |
1.5.7 |
packaging |
20.3 |
21.3 |
pint |
0.17 |
0.18 |
pseudonetcdf |
3.1 |
3.2 |
typing_extensions |
3.10 |
4.0 |
## Deprecations - The PyNIO backend has been deprecated (4491, 7301).
By Joe Hamman.
## Bug fixes - Fix handling of coordinate attributes in where. (7220, 7229)
By Sam Levang.
Import nc_time_axis when needed (7275, 7276). By Michael Niklas.
Fix static typing of xr.polyval (7312, 7315). By Michael Niklas.
Fix multiple reads on fsspec S3 files by resetting file pointer to 0 when reading file streams (6813, 7304). By David Hoese and Wei Ji Leong.
Fix Dataset.assign_coords resetting all dimension coordinates to default (pandas) index (7346, 7347). By Benoît Bovy.
## Documentation
Add example of reading and writing individual groups to a single netCDF file to I/O docs page. (7338) By Tom Nicholas.
Your coding agent can read these notes before it upgrades. Set up the MCP server →