forked from pydata/xarray
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwhats-new.rst
More file actions
9053 lines (7437 loc) · 426 KB
/
whats-new.rst
File metadata and controls
9053 lines (7437 loc) · 426 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
.. currentmodule:: xarray
.. _whats-new:
What's New
==========
.. _whats-new.2025.07.2:
v2025.07.2 (unreleased)
-----------------------
New Features
~~~~~~~~~~~~
- Added :py:meth:`DataTree.prune` method to remove empty nodes while preserving tree structure.
Useful for cleaning up DataTree after time-based filtering operations (:issue:`10590`, :pull:`10598`).
By `Alfonso Ladino <https://github.com/aladinor>`_.
Breaking changes
~~~~~~~~~~~~~~~~
Deprecations
~~~~~~~~~~~~
- Start a deprecation cycle for changing the default keyword arguments to :py:func:`concat`, :py:func:`merge`,
:py:func:`combine_nested`, :py:func:`combine_by_coords`, and :py:func:`open_mfdataset`.
Emits a :py:class:`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"
(:issue:`8778`, :issue:`1385`, :pull:`10062`). By `Julia Signell <https://github.com/jsignell>`_.
Bug fixes
~~~~~~~~~
- Fix Pydap Datatree backend testing. Testing now compares elements of (unordered) two sets (before, lists) (:pull:`10525`).
By `Miguel Jimenez-Urias <https://github.com/Mikejmnez>`_.
- Fix ``KeyError`` when passing a ``dim`` argument different from the default to ``convert_calendar`` (:pull:`10544`).
By `Eric Jansen <https://github.com/ej81>`_.
- Fix transpose of boolean arrays read from disk. (:issue:`10536`)
By `Deepak Cherian <https://github.com/dcherian>`_.
- Fix detection of the ``h5netcdf`` backend. Xarray now selects ``h5netcdf`` if the default ``netCDF4`` engine is not available (:issue:`10401`, :pull:`10557`).
By `Scott Staniewicz <https://github.com/scottstanie>`_.
Documentation
~~~~~~~~~~~~~
Internal Changes
~~~~~~~~~~~~~~~~
Performance
~~~~~~~~~~~
- Speed up non-numeric scalars when calling :py:meth:`Dataset.interp`. (:issue:`10054`, :pull:`10554`)
By `Jimmy Westling <https://github.com/illviljan>`_.
.. _whats-new.2025.07.1:
v2025.07.1 (July 09, 2025)
--------------------------
This release brings a lot of improvements to flexible indexes functionality, including new classes
to ease building of new indexes with custom coordinate transforms (:py:class:`indexes.CoordinateTransformIndex`)
and tree-like index structures (:py:class:`indexes.NDPointIndex`).
See a `new gallery <https://xarray-indexes.readthedocs.io>`_ 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 Features
~~~~~~~~~~~~
- New :py:class:`xarray.indexes.NDPointIndex`, which by default uses :py:class:`scipy.spatial.KDTree` under the hood for
the selection of irregular, n-dimensional data (:pull:`10478`).
By `Benoit Bovy <https://github.com/benbovy>`_.
- Allow skipping the creation of default indexes when opening datasets (:pull:`8051`).
By `Benoit Bovy <https://github.com/benbovy>`_ and `Justus Magin <https://github.com/keewis>`_.
Bug fixes
~~~~~~~~~
- :py:meth:`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 :py:meth:`xarray.Coordinates.from_xindex` and
:py:meth:`Dataset.assign_coords` for advanced use cases (:issue:`10499`).
By `Dhruva Kumar Kaushal <https://github.com/dhruvak001>`_.
Documentation
~~~~~~~~~~~~~
- A `new gallery <https://xarray-indexes.readthedocs.io>`_ showing off the possibilities enabled by flexible indexes.
Internal Changes
~~~~~~~~~~~~~~~~
- Refactored the ``PandasIndexingAdapter`` and
``CoordinateTransformIndexingAdapter`` internal indexing classes. Coordinate
variables that wrap a :py:class:`pandas.RangeIndex`, a
:py:class:`pandas.MultiIndex` or a
:py:class:`xarray.indexes.CoordinateTransform` are now displayed as lazy variables
in the Xarray data reprs (:pull:`10355`).
By `Benoit Bovy <https://github.com/benbovy>`_.
.. _whats-new.2025.07.0:
v2025.07.0 (Jul 3, 2025)
------------------------
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
New Features
~~~~~~~~~~~~
- Expose :py:class:`~xarray.indexes.RangeIndex`, and :py:class:`~xarray.indexes.CoordinateTransformIndex` as public api
under the ``xarray.indexes`` namespace. By `Deepak Cherian <https://github.com/dcherian>`_.
- Support zarr-python's new ``.supports_consolidated_metadata`` store property (:pull:`10457``).
by `Tom Nicholas <https://github.com/TomNicholas>`_.
- Better error messages when encoding data to be written to disk fails (:pull:`10464`).
By `Stephan Hoyer <https://github.com/shoyer>`_
Breaking changes
~~~~~~~~~~~~~~~~
The minimum versions of some dependencies were changed (:issue:`10417`, :pull:`10438`):
By `Dhruva Kumar Kaushal <https://github.com/dhruvak001>`_.
.. list-table::
:header-rows: 1
:widths: 30 20 20
* - 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
Bug fixes
~~~~~~~~~
- 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. (:pull:`10421`)
By `Kai Mühlbauer <https://github.com/kmuehlbauer>`_.
- Fix the SciPy backend for netCDF3 files . (:issue:`8909`, :pull:`10376`)
By `Deepak Cherian <https://github.com/dcherian>`_.
- Check and fix character array string dimension names, issue warnings as needed (:issue:`6352`, :pull:`10395`).
By `Kai Mühlbauer <https://github.com/kmuehlbauer>`_.
- Fix the error message of :py:func:`testing.assert_equal` when two different :py:class:`DataTree` objects
are passed (:pull:`10440`). By `Mathias Hauser <https://github.com/mathause>`_.
- Fix :py:func:`testing.assert_equal` with ``check_dim_order=False`` for :py:class:`DataTree` objects
(:pull:`10442`). By `Mathias Hauser <https://github.com/mathause>`_.
- 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. (:issue:`10261`, :pull:`10482`)
By `Miguel Jimenez-Urias <https://github.com/Mikejmnez>`_.
- Fix attribute overwriting bug when decoding encoded
:py:class:`numpy.timedelta64` values from disk with a dtype attribute
(:issue:`10468`, :pull:`10469`). By `Spencer Clark
<https://github.com/spencerkclark>`_.
- Fix default ``"_FillValue"`` dtype coercion bug when encoding
:py:class:`numpy.timedelta64` values to an on-disk format that only supports
32-bit integers (:issue:`10466`, :pull:`10469`). By `Spencer Clark
<https://github.com/spencerkclark>`_.
Internal Changes
~~~~~~~~~~~~~~~~
- Forward variable name down to coders for AbstractWritableDataStore.encode_variable and subclasses. (:pull:`10395`).
By `Kai Mühlbauer <https://github.com/kmuehlbauer>`_.
.. _whats-new.2025.06.1:
v2025.06.1 (Jun 11, 2025)
-------------------------
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
Bug fixes
~~~~~~~~~
- Remove dependency on ``typing_extensions`` (:pull:`10413`). By `Simon Perkins <https://github.com/sjperkins>`_.
.. _whats-new.2025.06.0:
v2025.06.0 (Jun 10, 2025)
-------------------------
This release brings HTML reprs to the documentation, fixes to flexible Xarray indexes, performance optimizations, more ergonomic seasonal grouping and resampling
with new :py:class:`~xarray.groupers.SeasonGrouper` and :py:class:`~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
New Features
~~~~~~~~~~~~
- Switch docs to jupyter-execute sphinx extension for HTML reprs. (:issue:`3893`, :pull:`10383`)
By `Scott Henderson <https://github.com/scottyhq>`_.
- 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).
(:issue:`10243`, :pull:`10293`)
By `Benoit Bovy <https://github.com/benbovy>`_.
- New :py:class:`~xarray.groupers.SeasonGrouper` and :py:class:`~xarray.groupers.SeasonResampler` objects for ergonomic seasonal aggregation.
See the docs on :ref:`seasonal_grouping` or `blog post <https://xarray.dev/blog/season-grouping>`_ for more.
By `Deepak Cherian <https://github.com/dcherian>`_.
- Data corruption issues arising from misaligned Dask and Zarr chunks
can now be prevented using the new ``align_chunks`` parameter in
:py:meth:`~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.
(:issue:`9914`, :pull:`10336`)
By `Joseph Nowak <https://github.com/josephnowak>`_.
Documentation
~~~~~~~~~~~~~
- HTML reprs! By `Scott Henderson <https://github.com/scottyhq>`_.
Bug fixes
~~~~~~~~~
- Fix :py:class:`~xarray.groupers.BinGrouper` when ``labels`` is not specified (:issue:`10284`).
By `Deepak Cherian <https://github.com/dcherian>`_.
- Allow accessing arbitrary attributes on Pandas ExtensionArrays.
By `Deepak Cherian <https://github.com/dcherian>`_.
- Fix coding empty (zero-size) timedelta64 arrays, ``units`` taking precedence when encoding,
fallback to default values when decoding (:issue:`10310`, :pull:`10313`).
By `Kai Mühlbauer <https://github.com/kmuehlbauer>`_.
- 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) (:issue:`10340`, :pull:`10341`).
By `Kai Mühlbauer <https://github.com/kmuehlbauer>`_.
- Improve the html ``repr`` of Xarray objects (dark mode, icons and variable attribute / data
dropdown sections).
(:pull:`10353`, :pull:`10354`)
By `Benoit Bovy <https://github.com/benbovy>`_.
- Raise an error when attempting to encode :py:class:`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 :py:class:`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 :py:class:`numpy.datetime64` values
(:pull:`10352`). By `Spencer Clark <https://github.com/spencerkclark>`_.
- Avoid unsafe casts from float to unsigned int in CFMaskCoder (:issue:`9815`, :pull:`9964`).
By ` Elliott Sales de Andrade <https://github.com/QuLogic>`_.
Performance
~~~~~~~~~~~
- Lazily indexed arrays now use less memory to store keys by avoiding copies
in :py:class:`~xarray.indexing.VectorizedIndexer` and :py:class:`~xarray.indexing.OuterIndexer`
(:issue:`10316`).
By `Jesse Rusak <https://github.com/jder>`_.
- Fix performance regression in interp where more data was loaded than was necessary. (:issue:`10287`).
By `Deepak Cherian <https://github.com/dcherian>`_.
- Speed up encoding of :py:class:`cftime.datetime` objects by roughly a factor
of three (:pull:`8324`). By `Antoine Gibek <https://github.com/antscloud>`_.
.. _whats-new.2025.04.0:
v2025.04.0 (Apr 29, 2025)
-------------------------
This release brings bug fixes, better support for extension arrays including returning a
:py:class:`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
New Features
~~~~~~~~~~~~
- By default xarray now encodes :py:class:`numpy.timedelta64` values by
converting to :py:class:`numpy.int64` values and storing ``"dtype"`` and
``"units"`` attributes consistent with the dtype of the in-memory
:py:class:`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 (:issue:`1621`, :issue:`10099`,
:pull:`10101`). By `Spencer Clark <https://github.com/spencerkclark>`_.
- Added `scipy-stubs <https://github.com/scipy/scipy-stubs>`_ to the ``xarray[types]`` dependencies.
By `Joren Hammudoglu <https://github.com/jorenham>`_.
- Added a :mod:`xarray.typing` module to expose selected public types for use in downstream libraries and static type checking.
(:issue:`10179`, :pull:`10215`).
By `Michele Guerreri <https://github.com/micguerr-bopen>`_.
- 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 <https://github.com/Mikejmnez>`_.
- Allow assigning index coordinates with non-array dimension(s) in a :py:class:`DataArray` by overriding
:py:meth:`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 (:pull:`10137`).
By `Benoit Bovy <https://github.com/benbovy>`_.
- Improved support pandas categorical extension as indices (i.e., :py:class:`pandas.IntervalIndex`). (:issue:`9661`, :pull:`9671`)
By `Ilan Gold <https://github.com/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).
(:issue:`7695`, :pull:`10251`)
By `Benoit Bovy <https://github.com/benbovy>`_.
Breaking changes
~~~~~~~~~~~~~~~~
- 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 :py:class:`xarray.groupers.BinGrouper`
now return objects indexed by :py:meth:`pandas.IntervalArray` objects,
instead of numpy object arrays containing tuples. This change enables interval-aware indexing of
such Xarray objects. (:pull:`9671`). By `Ilan Gold <https://github.com/ilan-gold>`_.
- Remove ``PandasExtensionArrayIndex`` from :py:attr:`xarray.Variable.data` when the attribute is a :py:class:`pandas.api.extensions.ExtensionArray` (:pull:`10263`). By `Ilan Gold <https://github.com/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. (:pull:`10139`)
By `Julia Signell <https://github.com/jsignell>`_.
Deprecations
~~~~~~~~~~~~
- The deprecation cycle for the ``eagerly_compute_group`` kwarg to ``groupby`` and ``groupby_bins``
is now complete.
By `Deepak Cherian <https://github.com/dcherian>`_.
Bug fixes
~~~~~~~~~
- :py:meth:`~xarray.Dataset.to_stacked_array` now uses dimensions in order of appearance.
This fixes the issue where using :py:meth:`~xarray.Dataset.transpose` before :py:meth:`~xarray.Dataset.to_stacked_array`
had no effect. (Mentioned in :issue:`9921`)
- Enable ``keep_attrs`` in ``DatasetView.map`` relevant for :py:func:`map_over_datasets` (:pull:`10219`)
By `Mathias Hauser <https://github.com/mathause>`_.
- Variables with no temporal dimension are left untouched by :py:meth:`~xarray.Dataset.convert_calendar`. (:issue:`10266`, :pull:`10268`)
By `Pascal Bourgault <https://github.com/aulemahal>`_.
- Enable ``chunk_key_encoding`` in :py:meth:`~xarray.Dataset.to_zarr` for Zarr v2 Datasets (:pull:`10274`)
By `BrianMichell <https://github.com/BrianMichell>`_.
Documentation
~~~~~~~~~~~~~
- Fix references to core classes in docs (:issue:`10195`, :pull:`10207`).
By `Mattia Almansi <https://github.com/malmans2>`_.
- Fix references to point to updated pydap documentation (:pull:`10182`).
By `Miguel Jimenez-Urias <https://github.com/Mikejmnez>`_.
- Switch to `pydata-sphinx-theme <https://github.com/pydata/pydata-sphinx-theme>`_ from `sphinx-book-theme <https://github.com/executablebooks/sphinx-book-theme>`_ (:pull:`8708`).
By `Scott Henderson <https://github.com/scottyhq>`_.
- Add a dedicated 'Complex Numbers' sections to the User Guide (:issue:`10213`, :pull:`10235`).
By `Andre Wendlinger <https://github.com/andrewendlinger>`_.
Internal Changes
~~~~~~~~~~~~~~~~
- Avoid stacking when grouping by a chunked array. This can be a large performance improvement.
By `Deepak Cherian <https://github.com/dcherian>`_.
- 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 (:issue:`9462`, :pull:`10277`).
By `Mark Harfouche <https://github.com/hmaarrfk>`_.
.. _whats-new.2025.03.1:
v2025.03.1 (Mar 30, 2025)
-------------------------
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.
New Features
~~~~~~~~~~~~
- Allow setting a ``fill_value`` for Zarr format 3 arrays. Specify ``fill_value`` in ``encoding`` as usual.
(:issue:`10064`). By `Deepak Cherian <https://github.com/dcherian>`_.
- Added :py:class:`indexes.RangeIndex` as an alternative, memory saving Xarray index representing
a 1-dimensional bounded interval with evenly spaced floating values (:issue:`8473`, :pull:`10076`).
By `Benoit Bovy <https://github.com/benbovy>`_.
Breaking changes
~~~~~~~~~~~~~~~~
- Explicitly forbid appending a :py:class:`~xarray.DataTree` to zarr using :py:meth:`~xarray.DataTree.to_zarr` with ``append_dim``, because the expected behaviour is currently undefined.
(:issue:`9858`, :pull:`10156`)
By `Tom Nicholas <https://github.com/TomNicholas>`_.
Bug fixes
~~~~~~~~~
- Update the parameters of :py:meth:`~xarray.DataArray.to_zarr` to match :py:meth:`~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. (:issue:`10163`, :pull:`10164`)
By `Karl Krauth <https://github.com/Karl-Krauth>`_.
- :py:meth:`DataTree.sel` and :py:meth:`DataTree.isel` display the path of the first failed node again (:pull:`10154`).
By `Mathias Hauser <https://github.com/mathause>`_.
- Fix grouped and resampled ``first``, ``last`` with datetimes (:issue:`10169`, :pull:`10173`)
By `Deepak Cherian <https://github.com/dcherian>`_.
- FacetGrid plots now include units in their axis labels when available (:issue:`10184`, :pull:`10185`)
By `Andre Wendlinger <https://github.com/andrewendlinger>`_.
.. _whats-new.2025.03.0:
v2025.03.0 (Mar 20, 2025)
-------------------------
This release brings tested support for Python 3.13, support for reading Zarr V3 datasets into a :py:class:`~xarray.DataTree`,
significant improvements to datetime & timedelta encoding/decoding, and improvements to the :py:class:`~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
New Features
~~~~~~~~~~~~
- Added :py:meth:`tutorial.open_datatree` and :py:meth:`tutorial.load_datatree`
By `Eni Awowale <https://github.com/eni-awowale>`_.
- Added :py:meth:`DataTree.filter_like` to conveniently restructure a DataTree like another DataTree (:issue:`10096`, :pull:`10097`).
By `Kobe Vandelanotte <https://github.com/kobebryant432>`_.
- Added :py:meth:`Coordinates.from_xindex` as convenience for creating a new :py:class:`Coordinates` object
directly from an existing Xarray index object if the latter supports it (:pull:`10000`)
By `Benoit Bovy <https://github.com/benbovy>`_.
- Allow kwargs in :py:meth:`DataTree.map_over_datasets` and :py:func:`map_over_datasets` (:issue:`10009`, :pull:`10012`).
By `Kai Mühlbauer <https://github.com/kmuehlbauer>`_.
- support python 3.13 (no free-threading) (:issue:`9664`, :pull:`9681`)
By `Justus Magin <https://github.com/keewis>`_.
- Added experimental support for coordinate transforms (not ready for public use yet!) (:pull:`9543`)
By `Benoit Bovy <https://github.com/benbovy>`_.
- Similar to our :py:class:`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
(:pull:`9498`). By `Spencer Clark <https://github.com/spencerkclark>`_.
- Support reading to `GPU memory with Zarr <https://zarr.readthedocs.io/en/stable/user-guide/gpu.html>`_ (:pull:`10078`).
By `Deepak Cherian <https://github.com/dcherian>`_.
Performance
~~~~~~~~~~~
- :py:meth:`DatasetGroupBy.first` and :py:meth:`DatasetGroupBy.last` can now use ``flox`` if available. (:issue:`9647`)
By `Deepak Cherian <https://github.com/dcherian>`_.
Breaking changes
~~~~~~~~~~~~~~~~
- Rolled back code that would attempt to catch integer overflow when encoding
times with small integer dtypes (:issue:`8542`), since it was inconsistent
with xarray's handling of standard integers, and interfered with encoding
times with small integer dtypes and missing values (:pull:`9498`). By
`Spencer Clark <https://github.com/spencerkclark>`_.
- Warn instead of raise if phony_dims are detected when using h5netcdf-backend and ``phony_dims=None`` (:issue:`10049`, :pull:`10058`)
By `Kai Mühlbauer <https://github.com/kmuehlbauer>`_.
Deprecations
~~~~~~~~~~~~
- Deprecate :py:func:`~xarray.cftime_range` in favor of :py:func:`~xarray.date_range` with ``use_cftime=True``
(:issue:`9886`, :pull:`10024`).
By `Josh Kihm <https://github.com/maddogghoek>`_.
- Move from phony_dims=None to phony_dims="access" for h5netcdf-backend(:issue:`10049`, :pull:`10058`)
By `Kai Mühlbauer <https://github.com/kmuehlbauer>`_.
Bug fixes
~~~~~~~~~
- Fix ``open_datatree`` incompatibilities with Zarr-Python V3 and refactor
``TestZarrDatatreeIO`` accordingly (:issue:`9960`, :pull:`10020`).
By `Alfonso Ladino-Rincon <https://github.com/aladinor>`_.
- Default to resolution-dependent optimal integer encoding units when saving
chunked non-nanosecond :py:class:`numpy.datetime64` or
:py:class:`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 <https://github.com/spencerkclark>`_ (:pull:`10017`).
- Use mean of min/max years as offset in calculation of datetime64 mean
(:issue:`10019`, :pull:`10035`).
By `Kai Mühlbauer <https://github.com/kmuehlbauer>`_.
- Fix ``DataArray().drop_attrs(deep=False)`` and add support for attrs to
``DataArray()._replace()``. (:issue:`10027`, :pull:`10030`). By `Jan
Haacker <https://github.com/j-haacker>`_.
- Fix bug preventing encoding times with missing values with small integer
dtype (:issue:`9134`, :pull:`9498`). By `Spencer Clark
<https://github.com/spencerkclark>`_.
- 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
(:pull:`9498`). By `Spencer Clark <https://github.com/spencerkclark>`_.
- 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
(:issue:`10071`, :pull:`10072`). By `Spencer Clark
<https://github.com/spencerkclark>`_.
- Fix ``isel`` for multi-coordinate Xarray indexes (:issue:`10063`, :pull:`10066`).
By `Benoit Bovy <https://github.com/benbovy>`_.
- Fix dask tokenization when opening each node in :py:func:`xarray.open_datatree`
(:issue:`10098`, :pull:`10100`). By `Sam Levang <https://github.com/slevang>`_.
- Improve handling of dtype and NaT when encoding/decoding masked and packaged
datetimes and timedeltas (:issue:`8957`, :pull:`10050`).
By `Kai Mühlbauer <https://github.com/kmuehlbauer>`_.
Documentation
~~~~~~~~~~~~~
- Better expose the :py:class:`Coordinates` class in API reference (:pull:`10000`)
By `Benoit Bovy <https://github.com/benbovy>`_.
.. _whats-new.2025.01.2:
v2025.01.2 (Jan 31, 2025)
-------------------------
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 :ref:`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 :py:class:`coders.CFDatetimeCoder`
class can be passed through the ``decode_times`` keyword argument (see also
:ref:`internals.default_timeunit`):
.. code-block:: python
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 :py:class:`coders.CFTimedeltaCoder` instance to the
``decode_timedelta`` keyword argument:
.. code-block:: python
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:
.. code:: python
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.
New Features
~~~~~~~~~~~~
- Relax nanosecond resolution restriction in CF time coding and permit
:py:class:`numpy.datetime64` or :py:class:`numpy.timedelta64` dtype arrays
with ``"s"``, ``"ms"``, ``"us"``, or ``"ns"`` resolution throughout xarray
(:issue:`7493`, :pull:`9618`, :pull:`9977`, :pull:`9966`, :pull:`9999`). By
`Kai Mühlbauer <https://github.com/kmuehlbauer>`_ and `Spencer Clark
<https://github.com/spencerkclark>`_.
- Enable the ``compute=False`` option in :py:meth:`DataTree.to_zarr`. (:pull:`9958`).
By `Sam Levang <https://github.com/slevang>`_.
- Improve the error message raised when no key is matching the available variables in a dataset. (:pull:`9943`)
By `Jimmy Westling <https://github.com/illviljan>`_.
- Added a ``time_unit`` argument to :py:meth:`CFTimeIndex.to_datetimeindex`.
Note that in a future version of xarray,
:py:meth:`CFTimeIndex.to_datetimeindex` will return a microsecond-resolution
:py:class:`pandas.DatetimeIndex` instead of a nanosecond-resolution
:py:class:`pandas.DatetimeIndex` (:pull:`9965`). By `Spencer Clark
<https://github.com/spencerkclark>`_ and `Kai Mühlbauer
<https://github.com/kmuehlbauer>`_.
- Adds shards to the list of valid_encodings in the zarr backend, so that
sharded Zarr V3s can be written (:issue:`9947`, :pull:`9948`).
By `Jacob Prince_Bieker <https://github.com/jacobbieker>`_
Deprecations
~~~~~~~~~~~~
- In a future version of xarray decoding of variables into
:py:class:`numpy.timedelta64` values will be disabled by default. To silence
warnings associated with this, set ``decode_timedelta`` to ``True``,
``False``, or a :py:class:`coders.CFTimedeltaCoder` instance when opening
data (:issue:`1621`, :pull:`9966`). By `Spencer Clark
<https://github.com/spencerkclark>`_.
Bug fixes
~~~~~~~~~
- Fix :py:meth:`DataArray.ffill`, :py:meth:`DataArray.bfill`, :py:meth:`Dataset.ffill` and :py:meth:`Dataset.bfill` when the limit is bigger than the chunksize (:issue:`9939`).
By `Joseph Nowak <https://github.com/josephnowak>`_.
- 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 (:pull:`9953`).
By `Kai Mühlbauer <https://github.com/kmuehlbauer>`_.
- Remove dask-expr from CI runs, add "pyarrow" dask dependency to windows CI runs, fix related tests (:issue:`9962`, :pull:`9971`).
By `Kai Mühlbauer <https://github.com/kmuehlbauer>`_.
- Use zarr-fixture to prevent thread leakage errors (:pull:`9967`).
By `Kai Mühlbauer <https://github.com/kmuehlbauer>`_.
- Fix weighted ``polyfit`` for arrays with more than two dimensions (:issue:`9972`, :pull:`9974`).
By `Mattia Almansi <https://github.com/malmans2>`_.
- Preserve order of variables in :py:func:`xarray.combine_by_coords` (:issue:`8828`, :pull:`9070`).
By `Kai Mühlbauer <https://github.com/kmuehlbauer>`_.
- Cast ``numpy`` scalars to arrays in :py:meth:`NamedArray.from_arrays` (:issue:`10005`, :pull:`10008`)
By `Justus Magin <https://github.com/keewis>`_.
Documentation
~~~~~~~~~~~~~
- A chapter on :ref:`internals.timecoding` is added to the internal section (:pull:`9618`).
By `Kai Mühlbauer <https://github.com/kmuehlbauer>`_.
- Clarified xarray's policy on API stability in the FAQ. (:issue:`9854`, :pull:`9855`)
By `Tom Nicholas <https://github.com/TomNicholas>`_.
Internal Changes
~~~~~~~~~~~~~~~~
- 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 (:pull:`9961`). By `Spencer Clark <https://github.com/spencerkclark>`_.
.. _whats-new.2025.01.1:
v2025.01.1 (Jan 9, 2025)
------------------------
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 <https://github.com/pydata/xarray/pull/9618>`_!
New Features
~~~~~~~~~~~~
- Split out :py:class:`coders.CFDatetimeCoder` as public API in ``xr.coders``, make ``decode_times`` keyword argument
consume :py:class:`coders.CFDatetimeCoder` (:pull:`9901`).
By `Kai Mühlbauer <https://github.com/kmuehlbauer>`_.
Deprecations
~~~~~~~~~~~~
- Time decoding related kwarg ``use_cftime`` is deprecated. Use keyword argument
``decode_times=CFDatetimeCoder(use_cftime=True)`` in :py:func:`~xarray.open_dataset`, :py:func:`~xarray.open_dataarray`, :py:func:`~xarray.open_datatree`, :py:func:`~xarray.open_groups`, :py:func:`~xarray.open_zarr` and :py:func:`~xarray.decode_cf` instead (:pull:`9901`).
By `Kai Mühlbauer <https://github.com/kmuehlbauer>`_.
.. _whats-new.2025.01.0:
v.2025.01.0 (Jan 3, 2025)
-------------------------
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
New Features
~~~~~~~~~~~~
- Improve the error message raised when using chunked-array methods if no chunk manager is available or if the requested chunk manager is missing (:pull:`9676`)
By `Justus Magin <https://github.com/keewis>`_. (:pull:`9676`)
- Better support wrapping additional array types (e.g. ``cupy`` or ``jax``) by calling generalized
duck array operations throughout more xarray methods. (:issue:`7848`, :pull:`9798`).
By `Sam Levang <https://github.com/slevang>`_.
- 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. (:issue:`9853`, :pull:`9861`). By `Davis Bennett <https://github.com/d-v-b>`_.
- Add ``unit`` - keyword argument to :py:func:`date_range` and ``microsecond`` parsing to
iso8601-parser (:pull:`9885`).
By `Kai Mühlbauer <https://github.com/kmuehlbauer>`_.
Breaking changes
~~~~~~~~~~~~~~~~
- 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 <https://github.com/max-sixty>`_.
Deprecations
~~~~~~~~~~~~
- Finalize deprecation of ``closed`` parameters of :py:func:`cftime_range` and
:py:func:`date_range` (:pull:`9882`).
By `Kai Mühlbauer <https://github.com/kmuehlbauer>`_.
Performance
~~~~~~~~~~~
- Better preservation of chunksizes in :py:meth:`Dataset.idxmin` and :py:meth:`Dataset.idxmax` (:issue:`9425`, :pull:`9800`).
By `Deepak Cherian <https://github.com/dcherian>`_.
- Much better implementation of vectorized interpolation for dask arrays (:pull:`9881`).
By `Deepak Cherian <https://github.com/dcherian>`_.
Bug fixes
~~~~~~~~~
- Fix type annotations for ``get_axis_num``. (:issue:`9822`, :pull:`9827`).
By `Bruce Merry <https://github.com/bmerry>`_.
- Fix unintended load on datasets when calling :py:meth:`DataArray.plot.scatter` (:pull:`9818`).
By `Jimmy Westling <https://github.com/illviljan>`_.
- Fix interpolation when non-numeric coordinate variables are present (:issue:`8099`, :issue:`9839`).
By `Deepak Cherian <https://github.com/dcherian>`_.
Internal Changes
~~~~~~~~~~~~~~~~
- Move non-CF related ``ensure_dtype_not_object`` from conventions to backends (:pull:`9828`).
By `Kai Mühlbauer <https://github.com/kmuehlbauer>`_.
- 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 (:pull:`9900`).
By `Kai Mühlbauer <https://github.com/kmuehlbauer>`_.
- 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 (:pull:`9899`).
By `Kai Mühlbauer <https://github.com/kmuehlbauer>`_.
- Refactor of time coding to prepare for relaxing nanosecond restriction (:pull:`9906`).
By `Kai Mühlbauer <https://github.com/kmuehlbauer>`_.
.. _whats-new.2024.11.0:
v.2024.11.0 (Nov 22, 2024)
--------------------------
This release brings better support for wrapping JAX arrays and Astropy Quantity objects, :py:meth:`DataTree.persist`, algorithmic improvements
to many methods with dask (:py:meth:`Dataset.polyfit`, :py:meth:`Dataset.ffill`, :py:meth:`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
New Features
~~~~~~~~~~~~
- Added :py:meth:`DataTree.persist` method (:issue:`9675`, :pull:`9682`).
By `Sam Levang <https://github.com/slevang>`_.
- Added ``write_inherited_coords`` option to :py:meth:`DataTree.to_netcdf`
and :py:meth:`DataTree.to_zarr` (:pull:`9677`).
By `Stephan Hoyer <https://github.com/shoyer>`_.
- Support lazy grouping by dask arrays, and allow specifying ordered groups with ``UniqueGrouper(labels=["a", "b", "c"])``
(:issue:`2852`, :issue:`757`).
By `Deepak Cherian <https://github.com/dcherian>`_.
- Add new ``automatic_rechunk`` kwarg to :py:meth:`DataArrayRolling.construct` and
:py:meth:`DatasetRolling.construct`. This is only useful on ``dask>=2024.11.0``
(:issue:`9550`). By `Deepak Cherian <https://github.com/dcherian>`_.
- Optimize ffill, bfill with dask when limit is specified
(:pull:`9771`).
By `Joseph Nowak <https://github.com/josephnowak>`_, and
`Patrick Hoefler <https://github.com/phofl>`_.
- Allow wrapping ``np.ndarray`` subclasses, e.g. ``astropy.units.Quantity`` (:issue:`9704`, :pull:`9760`).
By `Sam Levang <https://github.com/slevang>`_ and `Tien Vo <https://github.com/tien-vo>`_.
- Optimize :py:meth:`DataArray.polyfit` and :py:meth:`Dataset.polyfit` with dask, when used with
arrays with more than two dimensions.
(:issue:`5629`). By `Deepak Cherian <https://github.com/dcherian>`_.
- Support for directly opening remote files as string paths (for example, ``s3://bucket/data.nc``)
with ``fsspec`` when using the ``h5netcdf`` engine (:issue:`9723`, :pull:`9797`).
By `James Bourbeau <https://github.com/jrbourbeau>`_.
- Re-implement the :py:mod:`ufuncs` module, which now dynamically dispatches to the
underlying array's backend. Provides better support for certain wrapped array types
like ``jax.numpy.ndarray``. (:issue:`7848`, :pull:`9776`).
By `Sam Levang <https://github.com/slevang>`_.
- Speed up loading of large zarr stores using dask arrays. (:issue:`8902`)
By `Deepak Cherian <https://github.com/dcherian>`_.
Breaking Changes
~~~~~~~~~~~~~~~~
- 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
===================== ========= =======
Deprecations
~~~~~~~~~~~~
- 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
:py:class:`grouper.UniqueGrouper` or :py:class:`grouper.BinGrouper`.
Bug fixes
~~~~~~~~~
- Fix inadvertent deep-copying of child data in DataTree (:issue:`9683`,
:pull:`9684`).
By `Stephan Hoyer <https://github.com/shoyer>`_.
- Avoid including parent groups when writing DataTree subgroups to Zarr or
netCDF (:pull:`9682`).
By `Stephan Hoyer <https://github.com/shoyer>`_.
- Fix regression in the interoperability of :py:meth:`DataArray.polyfit` and :py:meth:`xr.polyval` for date-time coordinates. (:pull:`9691`).
By `Pascal Bourgault <https://github.com/aulemahal>`_.
- Fix CF decoding of ``grid_mapping`` to allow all possible formats, add tests (:issue:`9761`, :pull:`9765`).
By `Kai Mühlbauer <https://github.com/kmuehlbauer>`_.
- Add ``User-Agent`` to request-headers when retrieving tutorial data (:issue:`9774`, :pull:`9782`)
By `Kai Mühlbauer <https://github.com/kmuehlbauer>`_.
Documentation
~~~~~~~~~~~~~
- Mention attribute peculiarities in docs/docstrings (:issue:`4798`, :pull:`9700`).
By `Kai Mühlbauer <https://github.com/kmuehlbauer>`_.
Internal Changes
~~~~~~~~~~~~~~~~
- ``persist`` methods now route through the :py:class:`xr.namedarray.parallelcompat.ChunkManagerEntrypoint` (:pull:`9682`).
By `Sam Levang <https://github.com/slevang>`_.
.. _whats-new.2024.10.0:
v2024.10.0 (Oct 24th, 2024)
---------------------------
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
New Features
~~~~~~~~~~~~
- ``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 <https://github.com/owenlittlejohns>`_,
`Eni Awowale <https://github.com/eni-awowale>`_,
`Matt Savoie <https://github.com/flamingbear>`_,
`Stephan Hoyer <https://github.com/shoyer>`_,
`Tom Nicholas <https://github.com/TomNicholas>`_,
`Justus Magin <https://github.com/keewis>`_, and
`Alfonso Ladino <https://github.com/aladinor>`_.
- A migration guide for users of the prototype `xarray-contrib/datatree repository <https://github.com/xarray-contrib/datatree>`_ has been added, and can be found in the ``DATATREE_MIGRATION_GUIDE.md`` file in the repository root.
By `Tom Nicholas <https://github.com/TomNicholas>`_.
- Support for Zarr-Python 3 (:issue:`95515`, :pull:`9552`).
By `Tom Augspurger <https://github.com/TomAugspurger>`_,
`Ryan Abernathey <https://github.com/rabernat>`_ and
`Joe Hamman <https://github.com/jhamman>`_.
- Added zarr backends for :py:func:`open_groups` (:issue:`9430`, :pull:`9469`).
By `Eni Awowale <https://github.com/eni-awowale>`_.
- Added support for vectorized interpolation using additional interpolators
from the ``scipy.interpolate`` module (:issue:`9049`, :pull:`9526`).
By `Holly Mandel <https://github.com/hollymandel>`_.
- Implement handling of complex numbers (netcdf4/h5netcdf) and enums (h5netcdf) (:issue:`9246`, :issue:`3297`, :pull:`9509`).
By `Kai Mühlbauer <https://github.com/kmuehlbauer>`_.
- Fix passing missing arguments to when opening hdf5 and netCDF4 datatrees
(:issue:`9427`, :pull:`9428`).
By `Alfonso Ladino <https://github.com/aladinor>`_.
Bug fixes
~~~~~~~~~
- Make illegal path-like variable names when constructing a DataTree from a Dataset
(:issue:`9339`, :pull:`9378`)
By `Etienne Schalk <https://github.com/etienneschalk>`_.
- Work around `upstream pandas issue
<https://github.com/pandas-dev/pandas/issues/56996>`_ 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
(:pull:`9518`). By `Spencer Clark <https://github.com/spencerkclark>`_.
- 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
(:issue:`9488`, :pull:`9497`). By `Spencer Clark
<https://github.com/spencerkclark>`_.
- Fix a few bugs affecting groupby reductions with ``flox``. (:issue:`8090`, :issue:`9398`, :issue:`9648`).
- Fix a few bugs affecting groupby reductions with ``flox``. (:issue:`8090`, :issue:`9398`).
By `Deepak Cherian <https://github.com/dcherian>`_.
- Fix the safe_chunks validation option on the to_zarr method
(:issue:`5511`, :pull:`9559`). By `Joseph Nowak
<https://github.com/josephnowak>`_.
- Fix binning by multiple variables where some bins have no observations. (:issue:`9630`).
By `Deepak Cherian <https://github.com/dcherian>`_.
- Fix issue where polyfit wouldn't handle non-dimension coordinates. (:issue:`4375`, :pull:`9369`)
By `Karl Krauth <https://github.com/Karl-Krauth>`_.
Documentation
~~~~~~~~~~~~~
- Migrate documentation for ``datatree`` into main ``xarray`` documentation (:pull:`9033`).
For information on previous ``datatree`` releases, please see:
`datatree's historical release notes <https://xarray-datatree.readthedocs.io/en/latest/>`_.
By `Owen Littlejohns <https://github.com/owenlittlejohns>`_, `Matt Savoie <https://github.com/flamingbear>`_, and
`Tom Nicholas <https://github.com/TomNicholas>`_.
Internal Changes
~~~~~~~~~~~~~~~~
.. _whats-new.2024.09.0:
v2024.09.0 (Sept 11, 2024)
--------------------------
This release drops support for Python 3.9, and adds support for grouping by :ref:`multiple arrays <groupby.multiple>`, 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
New Features
~~~~~~~~~~~~
- Add :py:attr:`~core.accessor_dt.DatetimeAccessor.days_in_year` and
:py:attr:`~core.accessor_dt.DatetimeAccessor.decimal_year` to the
``DatetimeAccessor`` on ``xr.DataArray``. (:pull:`9105`).
By `Pascal Bourgault <https://github.com/aulemahal>`_.
Performance
~~~~~~~~~~~
- Make chunk manager an option in ``set_options`` (:pull:`9362`).
By `Tom White <https://github.com/tomwhite>`_.
- Support for :ref:`grouping by multiple variables <groupby.multiple>`.
This is quite new, so please check your results and report bugs.
Binary operations after grouping by multiple arrays are not supported yet.
(:issue:`1056`, :issue:`9332`, :issue:`324`, :pull:`9372`).
By `Deepak Cherian <https://github.com/dcherian>`_.
- Allow data variable specific ``constant_values`` in the dataset ``pad`` function (:pull:`9353`).
By `Tiago Sanona <https://github.com/tsanona>`_.
- Speed up grouping by avoiding deep-copy of non-dimension coordinates (:issue:`9426`, :pull:`9393`)
By `Deepak Cherian <https://github.com/dcherian>`_.
Breaking changes
~~~~~~~~~~~~~~~~
- Support for ``python 3.9`` has been dropped (:pull:`8937`)
- The minimum versions of some dependencies were changed