NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI · #1099 most downloaded on PyPI
N-D labeled arrays and datasets in Python
Last release 2 months ago
09 Jul 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
106 releases · first in 2016
This release is intended as a small patch release to be compatible with the new 2021.5.0 dask.distributed release. It also includes a new drop_duplica
This release is intended as a small patch release to be compatible with the new 2021.5.0 dask.distributed release. It also includes a new drop_duplicates method, some documentation improvements, the beginnings of our internal Index refactoring, and some bug fixes.
This release is intended as a small patch release to be compatible with the new 2021.5.0 dask.distributed release. It also includes a new drop_duplicates method, some documentation improvements, the beginnings of our internal Index refactoring, and some bug fixes.
Thank you to all 16 contributors!
Anderson Banihirwe, Andrew, Benoit Bovy, Brewster Malevich, Giacomo Caria, Illviljan, James Bourbeau, Keewis, Maximilian Roos, Ravin Kumar, Stephan Hoyer, Thomas Nicholas, Tom Nicholas, Zachary Moon.
Implement DataArray.drop_duplicates to remove duplicate dimension values (5239). By Andrew Huang.
Allow passing combine_attrs strategy names to the keep_attrs parameter of apply_ufunc (5041) By Justus Magin.
Dataset.interp now allows interpolation with non-numerical datatypes, such as booleans, instead of dropping them. (4761 5008). By Jimmy Westling.
Raise more informative error when decoding time variables with invalid reference dates. (5199, 5288). By Giacomo Caria.
Opening netCDF files from a path that doesn't end in .nc without supplying an explicit engine works again (5295), fixing a bug introduced in 0.18.0. By Stephan Hoyer
Clean up and enhance docstrings for the DataArray.plot and Dataset.plot.* families of methods (5285). By Zach Moon.
Explanation of deprecation cycles and how to implement them added to contributors guide. (5289) By Tom Nicholas.
Explicit indexes refactor: add an xarray.Index base class and Dataset.xindexes / DataArray.xindexes properties. Also rename PandasIndexAdapter to PandasIndex, which now inherits from xarray.Index (5102). By Benoit Bovy.
Replace SortedKeysDict with python's dict, given dicts are now ordered. By Maximilian Roos.
Updated the release guide for developers. Now accounts for actions that are automated via github actions. (5274). By Tom Nicholas.
One column per quarter.
This release brings a few important performance improvements, a wide range of usability upgrades, lots of bug fixes, and some new features. These incl
This release brings a few important performance improvements, a wide range of usability upgrades, lots of bug fixes, and some new features. These include a plugin API to add backend engines, a new theme for the documentation, curve fitting methods, and several new plotting functions.
This release brings a few important performance improvements, a wide range of usability upgrades, lots of bug fixes, and some new features. These include a plugin API to add backend engines, a new theme for the documentation, curve fitting methods, and several new plotting functions.
Many thanks to the 38 contributors to this release: Aaron Spring, Alessandro Amici, Alex Marandon, Alistair Miles, Ana Paula Krelling, Anderson Banihirwe, Aureliana Barghini, Baudouin Raoult, Benoit Bovy, Blair Bonnett, David Trémouilles, Deepak Cherian, Gabriel Medeiros Abrahão, Giacomo Caria, Hauke Schulz, Illviljan, Mathias Hauser, Matthias Bussonnier, Mattia Almansi, Maximilian Roos, Ray Bell, Richard Kleijn, Ryan Abernathey, Sam Levang, Spencer Clark, Spencer Jones, Tammas Loughran, Tobias Kölling, Todd, Tom Nicholas, Tom White, Victor Negîrneac, Xianxiang Li, Zeb Nicholls, crusaderky, dschwoerer, johnomotani, keewis
apply combine_attrs on data variables and coordinate variables when concatenating and merging datasets and dataarrays (4902). By Justus Magin.
Add Dataset.to_pandas (5247) By Giacomo Caria.
Add DataArray.plot.surface which wraps matplotlib's plot_surface to make surface plots (2235 5084 5101). By John Omotani.
Allow passing multiple arrays to Dataset.__setitem__ (5216). By Giacomo Caria.
Add 'cumulative' option to Dataset.integrate and DataArray.integrate so that result is a cumulative integral, like scipy.integrate.cumulative_trapezoidal (5153). By John Omotani.
Add safe_chunks option to Dataset.to_zarr which allows overriding checks made to ensure Dask and Zarr chunk compatibility (5056). By Ryan Abernathey
Add Dataset.query and DataArray.query which enable indexing of datasets and data arrays by evaluating query expressions against the values of the data variables (4984). By Alistair Miles.
Allow passing combine_attrs to Dataset.merge (4895). By Justus Magin.
Support for dask.graph_manipulation (requires dask >=2021.3) By Guido Imperiale
Add Dataset.plot.streamplot for streamplot plots with Dataset variables (5003). By John Omotani.
Many of the arguments for the DataArray.str methods now support providing an array-like input. In this case, the array provided to the arguments is broadcast against the original array and applied elementwise.
DataArray.str now supports +, *, and % operators. These behave the same as they do for str, except that they follow array broadcasting rules.
A large number of new DataArray.str methods were implemented, DataArray.str.casefold, DataArray.str.cat, DataArray.str.extract, DataArray.str.extractall, DataArray.str.findall, DataArray.str.format, DataArray.str.get_dummies, DataArray.str.islower, DataArray.str.join, DataArray.str.normalize, DataArray.str.partition, DataArray.str.rpartition, DataArray.str.rsplit, and DataArray.str.split. A number of these methods allow for splitting or joining the strings in an array. (4622) By Todd Jennings
Thanks to the new pluggable backend infrastructure external packages may now use the xarray.backends entry point to register additional engines to be used in open_dataset, see the documentation in add-a-backend (4309, 4803, 4989, 4810 and many others). The backend refactor has been sponsored with the "Essential Open Source Software for Science" grant from the Chan Zuckerberg Initiative and developed by B-Open. By Aureliana Barghini and Alessandro Amici.
~core.accessor_dt.DatetimeAccessor.date added (4983, 4994). By Hauke Schulz.
Implement __getitem__ for both ~core.groupby.DatasetGroupBy and ~core.groupby.DataArrayGroupBy, inspired by pandas' ~pandas.core.groupby.GroupBy.get_group. By Deepak Cherian.
Switch the tutorial functions to use pooch (which is now a optional dependency) and add tutorial.open_rasterio as a way to open example rasterio files (3986, 4102, 5074). By Justus Magin.
Add typing information to unary and binary arithmetic operators operating on Dataset, DataArray, Variable, ~core.groupby.DatasetGroupBy or ~core.groupby.DataArrayGroupBy (4904). By Richard Kleijn.
Add a combine_attrs parameter to open_mfdataset (4971). By Justus Magin.
Enable passing arrays with a subset of dimensions to DataArray.clip & Dataset.clip; these methods now use xarray.apply_ufunc; (5184). By Maximilian Roos.
Disable the cfgrib backend if the eccodes library is not installed (5083). By Baudouin Raoult.
Added DataArray.curvefit and Dataset.curvefit for general curve fitting applications. (4300, 4849) By Sam Levang.
Add options to control expand/collapse of sections in display of Dataset and DataArray. The function set_options now takes keyword arguments display_expand_attrs, display_expand_coords, display_expand_data, display_expand_data_vars, all of which can be one of True to always expand, False to always collapse, or default to expand unless over a pre-defined limit (5126). By Tom White.
Significant speedups in Dataset.interp and DataArray.interp. (4739, 4740). By Deepak Cherian.
Prevent passing concat_dim to xarray.open_mfdataset when combine='by_coords' is specified, which should never have been possible (as xarray.combine_by_coords has no concat_dim argument to pass to). Also removes unneeded internal reordering of datasets in xarray.open_mfdataset when combine='by_coords' is specified. Fixes (5230). By Tom Nicholas.
Implement __setitem__ for xarray.core.indexing.DaskIndexingAdapter if dask version supports item assignment. (5171, 5174) By Tammas Loughran.
The minimum versions of some dependencies were changed:
Package |
Old |
New |
|---|---|---|
boto3 |
1.12 |
1.13 |
cftime |
1.0 |
1.1 |
dask |
2.11 |
2.15 |
distributed |
2.11 |
2.15 |
matplotlib |
3.1 |
3.2 |
numba |
0.48 |
0.49 |
open_dataset and open_dataarray now accept only the first argument as positional, all others need to be passed are keyword arguments. This is part of the refactor to support external backends (4309, 4989). By Alessandro Amici.
Functions that are identities for 0d data return the unchanged data if axis is empty. This ensures that Datasets where some variables do not have the averaged dimensions are not accidentally changed (4885, 5207). By David Schwörer.
DataArray.coarsen and Dataset.coarsen no longer support passing keep_attrs via its constructor. Pass keep_attrs via the applied function, i.e. use ds.coarsen(...).mean(keep_attrs=False) instead of ds.coarsen(..., keep_attrs=False).mean(). Further, coarsen now keeps attributes per default (5227). By Mathias Hauser.
switch the default of the merge combine_attrs parameter to "override". This will keep the current behavior for merging the attrs of variables but stop dropping the attrs of the main objects (4902). By Justus Magin.
Warn when passing concat_dim to xarray.open_mfdataset when combine='by_coords' is specified, which should never have been possible (as xarray.combine_by_coords has no concat_dim argument to pass to). Also removes unneeded internal reordering of datasets in xarray.open_mfdataset when combine='by_coords' is specified. Fixes (5230), via (5231, 5255). By Tom Nicholas.
The lock keyword argument to open_dataset and open_dataarray is now a backend specific option. It will give a warning if passed to a backend that doesn't support it instead of being silently ignored. From the next version it will raise an error. This is part of the refactor to support external backends (5073). By Tom Nicholas and Alessandro Amici.
Properly support DataArray.ffill, DataArray.bfill, Dataset.ffill, Dataset.bfill along chunked dimensions. (2699). By Deepak Cherian.
Fix 2d plot failure for certain combinations of dimensions when x is 1d and y is 2d (5097, 5099). By John Omotani.
Ensure standard calendar times encoded with large values (i.e. greater than approximately 292 years), can be decoded correctly without silently overflowing (5050). This was a regression in xarray 0.17.0. By Zeb Nicholls.
Added support for numpy.bool_ attributes in roundtrips using h5netcdf engine with invalid_netcdf=True [which casts bool s to numpy.bool_] (4981, 4986). By Victor Negîrneac.
Don't allow passing axis to Dataset.reduce methods (3510, 4940). By Justus Magin.
Decode values as signed if attribute _Unsigned = "false" (4954) By Tobias Kölling.
Keep coords attributes when interpolating when the indexer is not a Variable. (4239, 4839 5031) By Jimmy Westling.
Ensure standard calendar dates encoded with a calendar attribute with some or all uppercase letters can be decoded or encoded to or from np.datetime64[ns] dates with or without cftime installed (5093, 5180). By Spencer Clark.
Warn on passing keep_attrs to resample and rolling_exp as they are ignored, pass keep_attrs to the applied function instead (5265). By Mathias Hauser.
New section on add-a-backend in the "Internals" chapter aimed to backend developers (4803, 4810). By Aureliana Barghini.
Add Dataset.polyfit and DataArray.polyfit under "See also" in the docstrings of Dataset.polyfit and DataArray.polyfit (5016, 5020). By Aaron Spring.
New sphinx theme & rearrangement of the docs (4835). By Anderson Banihirwe.
Enable displaying mypy error codes and ignore only specific error codes using # type: ignore[error-code] (5096). By Mathias Hauser.
Replace uses of raises_regex with the more standard pytest.raises(Exception, match="foo"); (5188), (5191). By Maximilian Roos.
This release brings a few important performance improvements, a wide range of usability upgrades, lots of bug fixes, and some new features. These incl
This release brings a few important performance improvements, a wide range of usability upgrades, lots of bug fixes, and some new features. These include better cftime support, a new quiver plot, better unstack performance, more efficient memory use in rolling operations, and some python packaging improvements. We also have a few documentation improvements (and more planned!).
This release brings a few important performance improvements, a wide range of usability upgrades, lots of bug fixes, and some new features. These include better cftime support, a new quiver plot, better unstack performance, more efficient memory use in rolling operations, and some python packaging improvements. We also have a few documentation improvements (and more planned!).
Many thanks to the 36 contributors to this release: Alessandro Amici, Anderson Banihirwe, Aureliana Barghini, Ayrton Bourn, Benjamin Bean, Blair Bonnett, Chun Ho Chow, DWesl, Daniel Mesejo-León, Deepak Cherian, Eric Keenan, Illviljan, Jens Hedegaard Nielsen, Jody Klymak, Julien Seguinot, Julius Busecke, Kai Mühlbauer, Leif Denby, Martin Durant, Mathias Hauser, Maximilian Roos, Michael Mann, Ray Bell, RichardScottOZ, Spencer Clark, Tim Gates, Tom Nicholas, Yunus Sevinchan, alexamici, aurghs, crusaderky, dcherian, ghislainp, keewis, rhkleijn
xarray no longer supports python 3.6
The minimum version policy was changed to also apply to projects with irregular releases. As a result, the minimum versions of some dependencies have changed:
Package |
Old |
New |
|---|---|---|
Python |
3.6 |
3.7 |
setuptools |
38.4 |
40.4 |
numpy |
1.15 |
1.17 |
pandas |
0.25 |
1.0 |
dask |
2.9 |
2.11 |
distributed |
2.9 |
2.11 |
bottleneck |
1.2 |
1.3 |
h5netcdf |
0.7 |
0.8 |
iris |
2.2 |
2.4 |
netcdf4 |
1.4 |
1.5 |
pseudonetcdf |
3.0 |
3.1 |
rasterio |
1.0 |
1.1 |
scipy |
1.3 |
1.4 |
seaborn |
0.9 |
0.10 |
zarr |
2.3 |
2.4 |
(4688, 4720, 4907, 4942)
As a result of 4684 the default units encoding for datetime-like values (np.datetime64[ns] or cftime.datetime) will now always be set such that int64 values can be used. In the past, no units finer than "seconds" were chosen, which would sometimes mean that float64 values were required, which would lead to inaccurate I/O round-trips.
Variables referred to in attributes like bounds and grid_mapping can be set as coordinate variables. These attributes are moved to DataArray.encoding from DataArray.attrs. This behaviour is controlled by the decode_coords kwarg to open_dataset and open_mfdataset. The full list of decoded attributes is in weather-climate (2844, 3689)
As a result of 4911 the output from calling DataArray.sum or DataArray.prod on an integer array with skipna=True and a non-None value for min_count will now be a float array rather than an integer array.
dim argument to DataArray.integrate is being deprecated in favour of a coord argument, for consistency with Dataset.integrate. For now using dim issues a FutureWarning. It will be removed in version 0.19.0 (3993). By Tom Nicholas.
Deprecated autoclose kwargs from open_dataset are removed (4725). By Aureliana Barghini.
the return value of Dataset.update is being deprecated to make it work more like dict.update. It will be removed in version 0.19.0 (4932). By Justus Magin.
~xarray.cftime_range and DataArray.resample now support millisecond ("L" or "ms") and microsecond ("U" or "us") frequencies for cftime.datetime coordinates (4097, 4758). By Spencer Clark.
Significantly higher unstack performance on numpy-backed arrays which contain missing values; 8x faster than previous versions in our benchmark, and now 2x faster than pandas (4746). By Maximilian Roos.
Add Dataset.plot.quiver for quiver plots with Dataset variables. By Deepak Cherian.
Add "drop_conflicts" to the strategies supported by the combine_attrs kwarg (4749, 4827). By Justus Magin.
Allow installing from git archives (4897). By Justus Magin.
~computation.rolling.DataArrayCoarsen and ~computation.rolling.DatasetCoarsen now implement a reduce method, enabling coarsening operations with custom reduction functions (3741, 4939). By Spencer Clark.
Most rolling operations use significantly less memory. (4325). By Deepak Cherian.
Add Dataset.drop_isel and DataArray.drop_isel (4658, 4819). By Daniel Mesejo.
Xarray now leverages updates as of cftime version 1.4.1, which enable exact I/O roundtripping of cftime.datetime objects (4758). By Spencer Clark.
open_dataset and open_mfdataset now accept fsspec URLs (including globs for the latter) for engine="zarr", and so allow reading from many remote and other file systems (4461) By Martin Durant
DataArray.swap_dims & Dataset.swap_dims now accept dims in the form of kwargs as well as a dict, like most similar methods. By Maximilian Roos.
Use specific type checks in xarray.core.variable.as_compatible_data instead of blanket access to values attribute (2097) By Yunus Sevinchan.
DataArray.resample and Dataset.resample do not trigger computations anymore if Dataset.weighted or DataArray.weighted are applied (4625, 4668). By Julius Busecke.
merge with combine_attrs='override' makes a copy of the attrs (4627).
By default, when possible, xarray will now always use values of type int64 when encoding and decoding numpy.datetime64[ns] datetimes. This ensures that maximum precision and accuracy are maintained in the round-tripping process (4045, 4684). It also enables encoding and decoding standard calendar dates with time units of nanoseconds (4400). By Spencer Clark and Mark Harfouche.
DataArray.astype, Dataset.astype and Variable.astype support the order and subok parameters again. This fixes a regression introduced in version 0.16.1 (4644, 4683). By Richard Kleijn .
Remove dictionary unpacking when using .loc to avoid collision with .sel parameters (4695). By Anderson Banihirwe.
Fix the legend created by Dataset.plot.scatter (4641, 4723). By Justus Magin.
Fix a crash in orthogonal indexing on geographic coordinates with engine='cfgrib' (4733 4737). By Alessandro Amici.
Coordinates with dtype str or bytes now retain their dtype on many operations, e.g. reindex, align, concat, assign, previously they were cast to an object dtype (2658 and 4543). By Mathias Hauser.
Limit number of data rows when printing large datasets. (4736, 4750). By Jimmy Westling.
Add missing_dims parameter to transpose (4647, 4767). By Daniel Mesejo.
Resolve intervals before appending other metadata to labels when plotting (4322, 4794). By Justus Magin.
Fix regression when decoding a variable with a scale_factor and add_offset given as a list of length one (4631). By Mathias Hauser.
Expand user directory paths (e.g. ~/) in open_mfdataset and Dataset.to_zarr (4783, 4795). By Julien Seguinot.
Raise DeprecationWarning when trying to typecast a tuple containing a DataArray. User now prompted to first call .data on it (4483). By Chun Ho Chow.
Ensure that Dataset.interp raises ValueError when interpolating outside coordinate range and bounds_error=True (4854, 4855). By Leif Denby.
Fix time encoding bug associated with using cftime versions greater than 1.4.0 with xarray (4870, 4871). By Spencer Clark.
Stop DataArray.sum and DataArray.prod computing lazy arrays when called with a min_count parameter (4898, 4911). By Blair Bonnett.
Fix bug preventing the min_count parameter to DataArray.sum and DataArray.prod working correctly when calculating over all axes of a float64 array (4898, 4911). By Blair Bonnett.
Fix decoding of vlen strings using h5py versions greater than 3.0.0 with h5netcdf backend (4570, 4893). By Kai Mühlbauer.
Allow converting Dataset or DataArray objects with a MultiIndex and at least one other dimension to a pandas object (3008, 4442). By ghislainp.
Add information about requirements for accessor classes (2788, 4657). By Justus Magin.
Start a list of external I/O integrating with xarray (683, 4566). By Justus Magin.
Add concat examples and improve combining documentation (4620, 4645). By Ray Bell and Justus Magin.
explicitly mention that Dataset.update updates inplace (2951, 4932). By Justus Magin.
Added docs on vectorized indexing (4711). By Eric Keenan.
Speed up of the continuous integration tests on azure.
Switched to mamba and use matplotlib-base for a faster installation of all dependencies (4672).
Use pytest.mark.skip instead of pytest.mark.xfail for some tests that can currently not succeed (4685).
Run the tests in parallel using pytest-xdist (4694).
By Justus Magin and Mathias Hauser.
Use pyproject.toml instead of the setup_requires option for setuptools (4897). By Justus Magin.
Replace all usages of assert x.identical(y) with assert_identical(x, y) for clearer error messages (4752). By Maximilian Roos.
Speed up attribute style access (e.g. ds.somevar instead of ds["somevar"]) and tab completion in IPython (4741, 4742). By Richard Kleijn.
Added the set_close method to Dataset and DataArray for backends to specify how to voluntary release all resources. (#4809) By Alessandro Amici.
Update type hints to work with numpy v1.20 (4878). By Mathias Hauser.
Ensure warnings cannot be turned into exceptions in testing.assert_equal and the other assert_* functions (4864). By Mathias Hauser.
Performance improvement when constructing DataArrays. Significantly speeds up repr for Datasets with large number of variables. By Deepak Cherian.
This release brings the ability to write to limited regions of zarr files, open zarr files with open_dataset and open_mfdataset, increased support for
This release brings the ability to write to limited regions of zarr files, open zarr files with open_dataset and open_mfdataset, increased support for propagating attrs using the keep_attrs flag, as well as numerous bugfixes and documentation improvements.
This release brings the ability to write to limited regions of zarr files, open zarr files with open_dataset and open_mfdataset, increased support for propagating attrs using the keep_attrs flag, as well as numerous bugfixes and documentation improvements.
Many thanks to the 31 contributors who contributed to this release: Aaron Spring, Akio Taniguchi, Aleksandar Jelenak, alexamici, Alexandre Poux, Anderson Banihirwe, Andrew Pauling, Ashwin Vishnu, aurghs, Brian Ward, Caleb, crusaderky, Dan Nowacki, darikg, David Brochart, David Huard, Deepak Cherian, Dion Häfner, Gerardo Rivera, Gerrit Holl, Illviljan, inakleinbottle, Jacob Tomlinson, James A. Bednar, jenssss, Joe Hamman, johnomotani, Joris Van den Bossche, Julia Kent, Julius Busecke, Kai Mühlbauer, keewis, Keisuke Fujii, Kyle Cranmer, Luke Volpatti, Mathias Hauser, Maximilian Roos, Michaël Defferrard, Michal Baumgartner, Nick R. Papior, Pascal Bourgault, Peter Hausamann, PGijsbers, Ray Bell, Romain Martinez, rpgoldman, Russell Manser, Sahid Velji, Samnan Rahee, Sander, Spencer Clark, Stephan Hoyer, Thomas Zilio, Tobias Kölling, Tom Augspurger, Wei Ji, Yash Saboo, Zeb Nicholls,
~core.accessor_dt.DatetimeAccessor.weekofyear and ~core.accessor_dt.DatetimeAccessor.week have been deprecated. Use DataArray.dt.isocalendar().week instead (4534). By Mathias Hauser. Maximilian Roos, and Spencer Clark.
DataArray.rolling and Dataset.rolling no longer support passing keep_attrs via its constructor. Pass keep_attrs via the applied function, i.e. use ds.rolling(...).mean(keep_attrs=False) instead of ds.rolling(..., keep_attrs=False).mean() Rolling operations now keep their attributes per default (4510). By Mathias Hauser.
open_dataset and open_mfdataset now works with engine="zarr" (3668, 4003, 4187). By Miguel Jimenez and Wei Ji Leong.
Unary & binary operations follow the keep_attrs flag (3490, 4065, 3433, 3595, 4195). By Deepak Cherian.
Added ~core.accessor_dt.DatetimeAccessor.isocalendar() that returns a Dataset with year, week, and weekday calculated according to the ISO 8601 calendar. Requires pandas version 1.1.0 or greater (4534). By Mathias Hauser, Maximilian Roos, and Spencer Clark.
Dataset.to_zarr now supports a region keyword for writing to limited regions of existing Zarr stores (4035). See io.zarr.appending for full details. By Stephan Hoyer.
Added typehints in align to reflect that the same type received in objects arg will be returned (4522). By Michal Baumgartner.
Dataset.weighted and DataArray.weighted are now executing value checks lazily if weights are provided as dask arrays (4541, 4559). By Julius Busecke.
Added the keep_attrs keyword to rolling_exp.mean(); it now keeps attributes per default. By Mathias Hauser (4592).
Added freq as property to CFTimeIndex and into the CFTimeIndex.repr. (2416, 4597) By Aaron Spring.
Fix bug where reference times without padded years (e.g. since 1-1-1) would lose their units when being passed by encode_cf_datetime (4422, 4506). Such units are ambiguous about which digit represents the years (is it YMD or DMY?). Now, if such formatting is encountered, it is assumed that the first digit is the years, they are padded appropriately (to e.g. since 0001-1-1) and a warning that this assumption is being made is issued. Previously, without cftime, such times would be silently parsed incorrectly (at least based on the CF conventions) e.g. "since 1-1-1" would be parsed (via pandas and dateutil) to since 2001-1-1. By Zeb Nicholls.
Fix DataArray.plot.step. By Deepak Cherian.
Fix bug where reading a scalar value from a NetCDF file opened with the h5netcdf backend would raise a ValueError when decode_cf=True (4471, 4485). By Gerrit Holl.
Fix bug where datetime64 times are silently changed to incorrect values if they are outside the valid date range for ns precision when provided in some other units (4427, 4454). By Andrew Pauling
Fix silently overwriting the engine key when passing open_dataset a file object to an incompatible netCDF (4457). Now incompatible combinations of files and engines raise an exception instead. By Alessandro Amici.
The min_count argument to DataArray.sum() and DataArray.prod() is now ignored when not applicable, i.e. when skipna=False or when skipna=None and the dtype does not have a missing value (4352). By Mathias Hauser.
combine_by_coords now raises an informative error when passing coordinates with differing calendars (4495). By Mathias Hauser.
DataArray.rolling and Dataset.rolling now also keep the attributes and names of of (wrapped) DataArray objects, previously only the global attributes were retained (4497, 4510). By Mathias Hauser.
Improve performance where reading small slices from huge dimensions was slower than necessary (4560). By Dion Häfner.
Fix bug where dask_gufunc_kwargs was silently changed in apply_ufunc (4576). By Kai Mühlbauer.
document the API not supported with duck arrays (4530). By Justus Magin.
Mention the possibility to pass functions to Dataset.where or DataArray.where in the parameter documentation (4223, 4613). By Justus Magin.
Update the docstring of DataArray and Dataset. (4532); By Jimmy Westling.
Raise a more informative error when DataArray.to_dataframe is is called on a scalar, (4228); By Pieter Gijsbers.
Fix grammar and typos in the contributing guide (4545). By Sahid Velji.
Fix grammar and typos in the user-guide/io guide (4553). By Sahid Velji.
Update link to NumPy docstring standard in the contributing guide (4558). By Sahid Velji.
Add docstrings to isnull and notnull, and fix the displayed signature (2760, 4618). By Justus Magin.
Optional dependencies can be installed along with xarray by specifying extras as pip install "xarray[extra]" where extra can be one of io, accel, parallel, viz and complete. See docs for updated installation instructions. (2888, 4480). By Ashwin Vishnu, Justus Magin and Mathias Hauser.
Removed stray spaces that stem from black removing new lines (4504). By Mathias Hauser.
Ensure tests are not skipped in the py38-all-but-dask test environment (4509). By Mathias Hauser.
Ignore select numpy warnings around missing values, where xarray handles the values appropriately, (4536); By Maximilian Roos.
Replace the internal use of pd.Index.__or__ and pd.Index.__and__ with pd.Index.union and pd.Index.intersection as they will stop working as set operations in the future (4565). By Mathias Hauser.
Add GitHub action for running nightly tests against upstream dependencies (4583). By Anderson Banihirwe.
Ensure all figures are closed properly in plot tests (4600). By Yash Saboo, Nirupam K N and Mathias Hauser.
This patch release fixes an incompatibility with a recent pandas change, which was causing an issue indexing with a datetime64. It also includes impro
This patch release fixes an incompatibility with a recent pandas change, which was causing an issue indexing with a datetime64. It also includes improvements to rolling, to_dataframe, cov & corr methods and bug fixes. Our documentation has a number of improvements, including fixing all doctests and confirming their accuracy on every commit.
This patch release fixes an incompatibility with a recent pandas change, which was causing an issue indexing with a datetime64. It also includes improvements to rolling, to_dataframe, cov & corr methods and bug fixes. Our documentation has a number of improvements, including fixing all doctests and confirming their accuracy on every commit.
Many thanks to the 36 contributors who contributed to this release:
Aaron Spring, Akio Taniguchi, Aleksandar Jelenak, Alexandre Poux, Caleb, Dan Nowacki, Deepak Cherian, Gerardo Rivera, Jacob Tomlinson, James A. Bednar, Joe Hamman, Julia Kent, Kai Mühlbauer, Keisuke Fujii, Mathias Hauser, Maximilian Roos, Nick R. Papior, Pascal Bourgault, Peter Hausamann, Romain Martinez, Russell Manser, Samnan Rahee, Sander, Spencer Clark, Stephan Hoyer, Thomas Zilio, Tobias Kölling, Tom Augspurger, alexamici, crusaderky, darikg, inakleinbottle, jenssss, johnomotani, keewis, and rpgoldman.
DataArray.astype and Dataset.astype now preserve attributes. Keep the old behavior by passing keep_attrs=False (2049, 4314). By Dan Nowacki and Gabriel Joel Mitchell.
~xarray.DataArray.rolling and ~xarray.Dataset.rolling now accept more than 1 dimension. (4219) By Keisuke Fujii.
~xarray.DataArray.to_dataframe and ~xarray.Dataset.to_dataframe now accept a dim_order parameter allowing to specify the resulting dataframe's dimensions order (4331, 4333). By Thomas Zilio.
Support multiple outputs in xarray.apply_ufunc when using dask='parallelized'. (1815, 4060). By Kai Mühlbauer.
min_count can be supplied to reductions such as .sum when specifying multiple dimension to reduce over; (4356). By Maximilian Roos.
xarray.cov and xarray.corr now handle missing values; (4351). By Maximilian Roos.
Add support for parsing datetime strings formatted following the default string representation of cftime objects, i.e. YYYY-MM-DD hh:mm:ss, in partial datetime string indexing, as well as ~xarray.cftime_range (4337). By Spencer Clark.
Build CFTimeIndex.__repr__ explicitly as pandas.Index. Add calendar as a new property for CFTimeIndex and show calendar and length in CFTimeIndex.__repr__ (2416, 4092) By Aaron Spring.
Use a wrapped array's _repr_inline_ method to construct the collapsed repr of DataArray and Dataset objects and document the new method in internals/index. (4248). By Justus Magin.
Allow per-variable fill values in most functions. (4237). By Justus Magin.
Expose use_cftime option in ~xarray.open_zarr (2886, 3229) By Samnan Rahee and Anderson Banihirwe.
Fix indexing with datetime64 scalars with pandas 1.1 (4283). By Stephan Hoyer and Justus Magin.
Variables which are chunked using dask only along some dimensions can be chunked while storing with zarr along previously unchunked dimensions (4312) By Tobias Kölling.
Fixed a bug in backend caused by basic installation of Dask (4164, 4318) Sam Morley.
Fixed a few bugs with Dataset.polyfit when encountering deficient matrix ranks (4190, 4193). By Pascal Bourgault.
Fixed inconsistencies between docstring and functionality for DataArray.str.get and DataArray.str.wrap (4334). By Mathias Hauser.
Fixed overflow issue causing incorrect results in computing means of cftime.datetime arrays (4341). By Spencer Clark.
Fixed Dataset.coarsen, DataArray.coarsen dropping attributes on original object (4120, 4360). By Julia Kent.
fix the signature of the plot methods. (4359) By Justus Magin.
Fix xarray.apply_ufunc with vectorize=True and exclude_dims (3890). By Mathias Hauser.
Fix KeyError when doing linear interpolation to an nd DataArray that contains NaNs (4233). By Jens Svensmark
Fix incorrect legend labels for Dataset.plot.scatter (4126). By Peter Hausamann.
Fix dask.optimize on DataArray producing an invalid Dask task graph (3698) By Tom Augspurger
Fix pip install . when no .git directory exists; namely when the xarray source directory has been rsync'ed by PyCharm Professional for a remote deployment over SSH. By Guido Imperiale
Preserve dimension and coordinate order during xarray.concat (2811, 4072, 4419). By Kai Mühlbauer.
Avoid relying on set objects for the ordering of the coordinates (4409) By Justus Magin.
Update the docstring of DataArray.copy to remove incorrect mention of 'dataset' (3606) By Sander van Rijn.
Removed skipna argument from DataArray.count, DataArray.any, DataArray.all. (755) By Sander van Rijn
Update the contributing guide to use merges instead of rebasing and state that we squash-merge. (4355). By Justus Magin.
Make sure the examples from the docstrings actually work (4408). By Justus Magin.
Updated Vectorized Indexing to a clearer example. By Maximilian Roos
Fixed all doctests and enabled their running in CI. By Justus Magin.
Relaxed the mindeps_policy to support:
all versions of setuptools released in the last 42 months (but no older than 38.4)
all versions of dask and dask.distributed released in the last 12 months (but no older than 2.9)
all versions of other packages released in the last 12 months
All are up from 6 months (4295) Guido Imperiale.
Use dask.array.apply_gufunc instead of dask.array.blockwise in xarray.apply_ufunc when using dask='parallelized'. (4060, 4391, 4392) By Kai Mühlbauer.
Align mypy versions to 0.782 across requirements and .pre-commit-config.yml files. (4390) By Maximilian Roos
Only load resource files when running inside a Jupyter Notebook (4294) By Guido Imperiale
Silenced most numpy warnings such as Mean of empty slice. (4369) By Maximilian Roos
Enable type checking for concat (4238) By Mathias Hauser.
Updated plot functions for matplotlib version 3.3 and silenced warnings in the plot tests (4365). By Mathias Hauser.
Versions in pre-commit.yaml are now pinned, to reduce the chances of conflicting versions. (4388) By Maximilian Roos
This release adds xarray.cov & xarray.corr for covariance & correlation respectively; the idxmax & idxmin methods, the polyfit method & xarray.polyval
This release adds xarray.cov & xarray.corr for covariance & correlation respectively; the idxmax & idxmin methods, the polyfit method & xarray.polyval for fitting polynomials, as well as a number of documentation improvements, other features, and bug fixes. Many thanks to all 44 contributors who contributed to this release.
This release adds xarray.cov & xarray.corr for covariance & correlation respectively; the idxmax & idxmin methods, the polyfit method & xarray.polyval for fitting polynomials, as well as a number of documentation improvements, other features, and bug fixes. Many thanks to all 44 contributors who contributed to this release:
Akio Taniguchi, Andrew Williams, Aurélien Ponte, Benoit Bovy, Dave Cole, David Brochart, Deepak Cherian, Elliott Sales de Andrade, Etienne Combrisson, Hossein Madadi, Huite, Joe Hamman, Kai Mühlbauer, Keisuke Fujii, Maik Riechert, Marek Jacob, Mathias Hauser, Matthieu Ancellin, Maximilian Roos, Noah D Brenowitz, Oriol Abril, Pascal Bourgault, Phillip Butcher, Prajjwal Nijhara, Ray Bell, Ryan Abernathey, Ryan May, Spencer Clark, Spencer Hill, Srijan Saurav, Stephan Hoyer, Taher Chegini, Todd, Tom Nicholas, Yohai Bar Sinai, Yunus Sevinchan, arabidopsis, aurghs, clausmichele, dmey, johnomotani, keewis, raphael dussin, risebell
Minimum supported versions for the following packages have changed: dask >=2.9, distributed>=2.9. By Deepak Cherian
groupby operations will restore coord dimension order. Pass restore_coord_dims=False to revert to previous behavior.
DataArray.transpose will now transpose coordinates by default. Pass transpose_coords=False to revert to previous behaviour. By Maximilian Roos
Alternate draw styles for plot.step must be passed using the drawstyle (or ds) keyword argument, instead of the linestyle (or ls) keyword argument, in line with the upstream change in Matplotlib. (3274) By Elliott Sales de Andrade
The old auto_combine function has now been removed in favour of the combine_by_coords and combine_nested functions. This also means that the default behaviour of open_mfdataset has changed to use combine='by_coords' as the default argument value. (2616, 3926) By Tom Nicholas.
The DataArray and Variable HTML reprs now expand the data section by default (4176) By Stephan Hoyer.
DataArray.argmin and DataArray.argmax now support sequences of 'dim' arguments, and if a sequence is passed return a dict (which can be passed to DataArray.isel to get the value of the minimum) of the indices for each dimension of the minimum or maximum of a DataArray. (3936) By John Omotani, thanks to Keisuke Fujii for work in 1469.
Added xarray.cov and xarray.corr (3784, 3550, 4089). By Andrew Williams and Robin Beer.
Implement DataArray.idxmax, DataArray.idxmin, Dataset.idxmax, Dataset.idxmin. (60, 3871) By Todd Jennings
Added DataArray.polyfit and xarray.polyval for fitting polynomials. (3349, 3733, 4099) By Pascal Bourgault.
Added xarray.infer_freq for extending frequency inferring to CFTime indexes and data (4033). By Pascal Bourgault.
chunks='auto' is now supported in the chunks argument of Dataset.chunk. (4055) By Andrew Williams
Control over attributes of result in merge, concat, combine_by_coords and combine_nested using combine_attrs keyword argument. (3865, 3877) By John Omotani
missing_dims argument to Dataset.isel, DataArray.isel and Variable.isel to allow replacing the exception when a dimension passed to isel is not present with a warning, or just ignore the dimension. (3866, 3923) By John Omotani
Support dask handling for DataArray.idxmax, DataArray.idxmin, Dataset.idxmax, Dataset.idxmin. (3922, 4135) By Kai Mühlbauer and Pascal Bourgault.
More support for unit aware arrays with pint (3643, 3975, 4163) By Justus Magin.
Support overriding existing variables in to_zarr() with mode='a' even without append_dim, as long as dimension sizes do not change. By Stephan Hoyer.
Allow plotting of boolean arrays. (3766) By Marek Jacob
Enable using MultiIndex levels as coordinates in 1D and 2D plots (3927). By Mathias Hauser.
A days_in_month accessor for xarray.CFTimeIndex, analogous to the days_in_month accessor for a pandas.DatetimeIndex, which returns the days in the month each datetime in the index. Now days in month weights for both standard and non-standard calendars can be obtained using the ~core.accessor_dt.DatetimeAccessor (3935). This feature requires cftime version 1.1.0 or greater. By Spencer Clark.
For the netCDF3 backend, added dtype coercions for unsigned integer types. (4014, 4018) By Yunus Sevinchan
map_blocks now accepts a template kwarg. This allows use cases where the result of a computation could not be inferred automatically. By Deepak Cherian
map_blocks can now handle dask-backed xarray objects in args. (3818) By Deepak Cherian
Add keyword decode_timedelta to xarray.open_dataset, (xarray.open_dataarray, xarray.open_dataarray, xarray.decode_cf) that allows to disable/enable the decoding of timedeltas independently of time decoding (1621) Aureliana Barghini
Performance improvement of DataArray.interp and Dataset.interp We performs independent interpolation sequentially rather than interpolating in one large multidimensional space. (2223) By Keisuke Fujii.
DataArray.interp now support interpolations over chunked dimensions (4155). By Alexandre Poux.
Major performance improvement for Dataset.from_dataframe when the dataframe has a MultiIndex (4184). By Stephan Hoyer. - DataArray.reset_index and Dataset.reset_index now keep coordinate attributes (4103). By Oriol Abril.
Axes kwargs such as facecolor can now be passed to DataArray.plot in subplot_kws. This works for both single axes plots and FacetGrid plots. By Raphael Dussin.
Array items with long string reprs are now limited to a reasonable width (3900) By Maximilian Roos
Large arrays whose numpy reprs would have greater than 40 lines are now limited to a reasonable length. (3905) By Maximilian Roos
Fix errors combining attrs in open_mfdataset (4009, 4173) By John Omotani
If groupby receives a DataArray with name=None, assign a default name (158) By Phil Butcher.
Support dark mode in VS code (4024) By Keisuke Fujii.
Fix bug when converting multiindexed pandas objects to sparse xarray objects. (4019) By Deepak Cherian.
ValueError is raised when fill_value is not a scalar in full_like. (3977) By Huite Bootsma.
Fix wrong order in converting a pd.Series with a MultiIndex to DataArray. (3951, 4186) By Keisuke Fujii and Stephan Hoyer.
Fix renaming of coords when one or more stacked coords is not in sorted order during stack+groupby+apply operations. (3287, 3906) By Spencer Hill
Fix a regression where deleting a coordinate from a copied DataArray can affect the original DataArray. (3899, 3871) By Todd Jennings
Fix ~xarray.plot.FacetGrid plots with a single contour. (3569, 3915). By Deepak Cherian
Use divergent colormap if levels spans 0. (3524) By Deepak Cherian
Fix ~xarray.plot.FacetGrid when vmin == vmax. (3734) By Deepak Cherian
Fix plotting when levels is a scalar and norm is provided. (3735) By Deepak Cherian
Fix bug where plotting line plots with 2D coordinates depended on dimension order. (3933) By Tom Nicholas.
Fix RasterioDeprecationWarning when using a vrt in open_rasterio. (3964) By Taher Chegini.
Fix AttributeError on displaying a Variable in a notebook context. (3972, 3973) By Ian Castleden.
Fix bug causing DataArray.interpolate_na to always drop attributes, and added keep_attrs argument. (3968) By Tom Nicholas.
Fix bug in time parsing failing to fall back to cftime. This was causing time variables with a time unit of 'msecs' to fail to parse. (3998) By Ryan May.
Fix weighted mean when passing boolean weights (4074). By Mathias Hauser.
Fix html repr in untrusted notebooks: fallback to plain text repr. (4053) By Benoit Bovy.
Fix DataArray.to_unstacked_dataset for single-dimension variables. (4049) By Deepak Cherian
Fix open_rasterio for WarpedVRT with specified src_crs. (4104) By Dave Cole.
update the docstring of DataArray.assign_coords : clarify how to add a new coordinate to an existing dimension and illustrative example (3952, 3958) By Etienne Combrisson.
update the docstring of Dataset.diff and DataArray.diff so it does document the dim parameter as required. (1040, 3909) By Justus Magin.
Updated Calculating Seasonal Averages from Timeseries of Monthly Means example notebook to take advantage of the new days_in_month accessor for xarray.CFTimeIndex (3935). By Spencer Clark.
Updated the list of current core developers. (3892) By Tom Nicholas.
Add example for multi-dimensional extrapolation and note different behavior of kwargs in Dataset.interp and DataArray.interp for 1-d and n-d interpolation (3956). By Matthias Riße.
Apply black to all the code in the documentation (4012) By Justus Magin.
Narrative documentation now describes map_blocks: dask.automatic-parallelization. By Deepak Cherian.
Document .plot, .dt, .str accessors the way they are called. (3625, 3988) By Justus Magin.
Add documentation for the parameters and return values of DataArray.sel. By Justus Magin.
Raise more informative error messages for chunk size conflicts when writing to zarr files. By Deepak Cherian.
Run the isort pre-commit hook only on python source files and update the flake8 version. (3750, 3711) By Justus Magin.
Add blackdoc to the list of checkers for development. (4177) By Justus Magin.
Add a CI job that runs the tests with every optional dependency except dask. (3794, 3919) By Justus Magin.
Use async / await for the asynchronous distributed tests. (3987, 3989) By Justus Magin.
Various internal code clean-ups (4026, 4038). By Prajjwal Nijhara.
This release brings many new features such as weighted methods for weighted array reductions, a new jupyter repr by default, and the start of units in
This release brings many new features such as weighted methods for weighted array reductions, a new jupyter repr by default, and the start of units integration with pint. There's also the usual batch of usability improvements, documentation additions, and bug fixes.
This release brings many new features such as Dataset.weighted methods for weighted array reductions, a new jupyter repr by default, and the start of units integration with pint. There's also the usual batch of usability improvements, documentation additions, and bug fixes.
Raise an error when assigning to the .values or .data attribute of dimension coordinates i.e. IndexVariable objects. This has been broken since v0.12.0. Please use DataArray.assign_coords or Dataset.assign_coords instead. (3470, 3862) By Deepak Cherian
Weighted array reductions are now supported via the new DataArray.weighted and Dataset.weighted methods. See compute.weighted. (422, 2922). By Mathias Hauser.
The new jupyter notebook repr (Dataset._repr_html_ and DataArray._repr_html_) (introduced in 0.14.1) is now on by default. To disable, use xarray.set_options(display_style="text"). By Julia Signell.
Added support for pandas.DatetimeIndex-style rounding of cftime.datetime objects directly via a CFTimeIndex or via the ~core.accessor_dt.DatetimeAccessor. By Spencer Clark
Support new h5netcdf backend keyword phony_dims (available from h5netcdf v0.8.0 for ~xarray.backends.H5NetCDFStore. By Kai Mühlbauer.
Add partial support for unit aware arrays with pint. (3706, 3611) By Justus Magin.
Dataset.groupby and DataArray.groupby now raise a TypeError on multiple string arguments. Receiving multiple string arguments often means a user is attempting to pass multiple dimensions as separate arguments and should instead pass a single list of dimensions. (3802) By Maximilian Roos
map_blocks can now apply functions that add new unindexed dimensions. By Deepak Cherian
An ellipsis (...) is now supported in the dims argument of Dataset.stack and DataArray.stack, meaning all unlisted dimensions, similar to its meaning in DataArray.transpose. (3826) By Maximilian Roos
Dataset.where and DataArray.where accept a lambda as a first argument, which is then called on the input; replicating pandas' behavior. By Maximilian Roos.
skipna is available in Dataset.quantile, DataArray.quantile, core.groupby.DatasetGroupBy.quantile, core.groupby.DataArrayGroupBy.quantile (3843, 3844) By Aaron Spring.
Add a diff summary for testing.assert_allclose. (3617, 3847) By Justus Magin.
Fix Dataset.interp when indexing array shares coordinates with the indexed variable (3252). By David Huard.
Fix recombination of groups in Dataset.groupby and DataArray.groupby when performing an operation that changes the size of the groups along the grouped dimension. By Eric Jansen.
Fix use of multi-index with categorical values (3674). By Matthieu Ancellin.
Fix alignment with join="override" when some dimensions are unindexed. (3681). By Deepak Cherian.
Fix Dataset.swap_dims and DataArray.swap_dims producing index with name reflecting the previous dimension name instead of the new one (3748, 3752). By Joseph K Aicher.
Use dask_array_type instead of dask_array.Array for type checking. (3779, 3787) By Justus Magin.
concat can now handle coordinate variables only present in one of the objects to be concatenated when coords="different". By Deepak Cherian.
xarray now respects the over, under and bad colors if set on a provided colormap. (3590, 3601) By johnomotani.
coarsen and rolling now respect xr.set_options(keep_attrs=True) to preserve attributes. Dataset.coarsen accepts a keyword argument keep_attrs to change this setting. (3376, 3801) By Andrew Thomas.
Delete associated indexes when deleting coordinate variables. (3746). By Deepak Cherian.
Fix Dataset.to_zarr when using append_dim and group simultaneously. (3170). By Matthias Meyer.
Fix html repr on Dataset with non-string keys (3807). By Maximilian Roos.
Fix documentation of DataArray removing the deprecated mention that when omitted, dims are inferred from a coords-dict. (3821) By Sander van Rijn.
Improve the where docstring. By Maximilian Roos
Update the installation instructions: only explicitly list recommended dependencies (3756). By Mathias Hauser.
Remove the internal import_seaborn function which handled the deprecation of the seaborn.apionly entry point (3747). By Mathias Hauser.
Don't test pint integration in combination with datetime objects. (3778, 3788) By Justus Magin.
Change test_open_mfdataset_list_attr to only run with dask installed (3777, 3780). By Bruno Pagani.
Preserve the ability to index with method="nearest" with a CFTimeIndex with pandas versions greater than 1.0.1 (3751). By Spencer Clark.
Greater flexibility and improved test coverage of subtracting various types of objects from a CFTimeIndex. By Spencer Clark.
Update Azure CI MacOS image, given pending removal. By Maximilian Roos
Remove xfails for scipy 1.0.1 for tests that append to netCDF files (3805). By Mathias Hauser.
Remove conversion to pandas.Panel, given its removal in pandas in favor of xarray's objects. By Maximilian Roos
Breaking changes ~~~~~~~~~~~~~~~~
This release brings many improvements to xarray's documentation: our examples are now binderized notebooks (click here) and we have new example notebooks from our SciPy 2019 sprint (many thanks to our contributors!).
This release also features many API improvements such as a new ~core.accessor_dt.TimedeltaAccessor and support for CFTimeIndex in ~DataArray.interpolate_na); as well as many bug fixes.
Bumped minimum tested versions for dependencies:
numpy 1.15
pandas 0.25
dask 2.2
distributed 2.2
scipy 1.3
Remove compat and encoding kwargs from DataArray, which have been deprecated since 0.12. (3650). Instead, specify the encoding kwarg when writing to disk or set the DataArray.encoding attribute directly. By Maximilian Roos.
xarray.dot, DataArray.dot, and the @ operator now use align="inner" (except when xarray.set_options(arithmetic_join="exact"); 3694) by Mathias Hauser.
Implement DataArray.pad and Dataset.pad. (2605, 3596). By Mark Boer.
DataArray.sel and Dataset.sel now support pandas.CategoricalIndex. (3669) By Keisuke Fujii.
Support using an existing, opened h5netcdf File with ~xarray.backends.H5NetCDFStore. This permits creating an ~xarray.Dataset from a h5netcdf File that has been opened using other means (3618). By Kai Mühlbauer.
Implement median and nanmedian for dask arrays. This works by rechunking to a single chunk along all reduction axes. (2999). By Deepak Cherian.
~xarray.concat now preserves attributes from the first Variable. (2575, 2060, 1614) By Deepak Cherian.
Dataset.quantile, DataArray.quantile and GroupBy.quantile now work with dask Variables. By Deepak Cherian.
Added the count reduction method to both ~computation.rolling.DatasetCoarsen and ~computation.rolling.DataArrayCoarsen objects. (3500) By Deepak Cherian
Add meta kwarg to ~xarray.apply_ufunc; this is passed on to dask.array.blockwise. (3660) By Deepak Cherian.
Add attrs_file option in ~xarray.open_mfdataset to choose the source file for global attributes in a multi-file dataset (2382, 3498). By Julien Seguinot.
Dataset.swap_dims and DataArray.swap_dims now allow swapping to dimension names that don't exist yet. (3636) By Justus Magin.
Extend ~core.accessor_dt.DatetimeAccessor properties and support .dt accessor for timedeltas via ~core.accessor_dt.TimedeltaAccessor (3612) By Anderson Banihirwe.
Improvements to interpolating along time axes (3641, 3631). By David Huard.
Support CFTimeIndex in DataArray.interpolate_na
define 1970-01-01 as the default offset for the interpolation index for both pandas.DatetimeIndex and CFTimeIndex,
use microseconds in the conversion from timedelta objects to floats to avoid overflow errors.
Applying a user-defined function that adds new dimensions using apply_ufunc and vectorize=True now works with dask > 2.0. (3574, 3660). By Deepak Cherian.
Fix ~xarray.combine_by_coords to allow for combining incomplete hypercubes of Datasets (3648). By Ian Bolliger.
Fix ~xarray.combine_by_coords when combining cftime coordinates which span long time intervals (3535). By Spencer Clark.
Fix plotting with transposed 2D non-dimensional coordinates. (3138, 3441) By Deepak Cherian.
plot.FacetGrid.set_titles can now replace existing row titles of a ~xarray.plot.FacetGrid plot. In addition ~xarray.plot.FacetGrid gained two new attributes: ~xarray.plot.FacetGrid.col_labels and ~xarray.plot.FacetGrid.row_labels contain matplotlib.text.Text handles for both column and row labels. These can be used to manually change the labels. By Deepak Cherian.
Fix issue with Dask-backed datasets raising a KeyError on some computations involving map_blocks (3598). By Tom Augspurger.
Ensure Dataset.quantile, DataArray.quantile issue the correct error when q is out of bounds (3634) by Mathias Hauser.
Fix regression in xarray 0.14.1 that prevented encoding times with certain dtype, _FillValue, and missing_value encodings (3624). By Spencer Clark
Raise an error when trying to use Dataset.rename_dims to rename to an existing name (3438, 3645) By Justus Magin.
Dataset.rename, DataArray.rename now check for conflicts with MultiIndex level names.
Dataset.merge no longer fails when passed a DataArray instead of a Dataset. By Tom Nicholas.
Fix a regression in Dataset.drop: allow passing any iterable when dropping variables (3552, 3693) By Justus Magin.
Fixed errors emitted by mypy --strict in modules that import xarray. (3695) by Guido Imperiale.
Allow plotting of binned coordinates on the y axis in plot.line and plot.step plots (3571, 3685) by Julien Seguinot.
setuptools is now marked as a dependency of xarray (3628) by Richard Höchenberger.
Switch doc examples to use nbsphinx and replace sphinx_gallery scripts with Jupyter notebooks. (3105, 3106, 3121) By Ryan Abernathey.
Added example notebook demonstrating use of xarray with Regional Ocean Modeling System (ROMS) ocean hydrodynamic model output. (3116) By Robert Hetland.
Added example notebook demonstrating the visualization of ERA5 GRIB data. (3199) By Zach Bruick and Stephan Siemen.
Added examples for DataArray.quantile, Dataset.quantile and GroupBy.quantile. (3576) By Justus Magin.
Add new example notebook example notebook demonstrating vectorization of a 1D function using apply_ufunc , dask and numba. By Deepak Cherian.
Added example for ~xarray.map_blocks. (3667) By Riley X. Brady.
Make sure dask names change when rechunking by different chunk sizes. Conversely, make sure they stay the same when rechunking by the same chunk size. (3350) By Deepak Cherian.
2x to 5x speed boost (on small arrays) for Dataset.isel, DataArray.isel, and DataArray.__getitem__ when indexing by int, slice, list of int, scalar ndarray, or 1-dimensional ndarray. (3533) by Guido Imperiale.
Removed internal method Dataset._from_vars_and_coord_names, which was dominated by Dataset._construct_direct. (3565) By Maximilian Roos.
Replaced versioneer with setuptools-scm. Moved contents of setup.py to setup.cfg. Removed pytest-runner from setup.py, as per deprecation notice on the pytest-runner project. (3714) by Guido Imperiale.
Use of isort is now enforced by CI. (3721) by Guido Imperiale
Breaking changes ~~~~~~~~~~~~~~~~
Broken compatibility with cftime < 1.0.3 . By Deepak Cherian.
Warning
cftime version 1.0.4 is broken (cftime/126); please use version 1.0.4.2 instead.
All leftover support for dates from non-standard calendars through netcdftime, the module included in versions of netCDF4 prior to 1.4 that eventually became the cftime package, has been removed in favor of relying solely on the standalone cftime package (3450). By Spencer Clark.
Added the sparse option to ~xarray.DataArray.unstack, ~xarray.Dataset.unstack, ~xarray.DataArray.reindex, ~xarray.Dataset.reindex (3518). By Keisuke Fujii.
Added the fill_value option to DataArray.unstack and Dataset.unstack (3518, 3541). By Keisuke Fujii.
Added the max_gap kwarg to ~xarray.DataArray.interpolate_na and ~xarray.Dataset.interpolate_na. This controls the maximum size of the data gap that will be filled by interpolation. By Deepak Cherian.
Added Dataset.drop_sel & DataArray.drop_sel for dropping labels. Dataset.drop_vars & DataArray.drop_vars have been added for dropping variables (including coordinates). The existing Dataset.drop & DataArray.drop methods remain as a backward compatible option for dropping either labels or variables, but using the more specific methods is encouraged. (3475) By Maximilian Roos
Added Dataset.map & GroupBy.map & Resample.map for mapping / applying a function over each item in the collection, reflecting the widely used and least surprising name for this operation. The existing apply methods remain for backward compatibility, though using the map methods is encouraged. (3459) By Maximilian Roos
Dataset.transpose and DataArray.transpose now support an ellipsis (...) to represent all 'other' dimensions. For example, to move one dimension to the front, use .transpose('x', ...). (3421) By Maximilian Roos
Changed xr.ALL_DIMS to equal python's Ellipsis (...), and changed internal usages to use ... directly. As before, you can use this to instruct a groupby operation to reduce over all dimensions. While we have no plans to remove xr.ALL_DIMS, we suggest using .... (3418) By Maximilian Roos
xarray.dot, and DataArray.dot now support the dims=... option to sum over the union of dimensions of all input arrays (3423) by Mathias Hauser.
Added new Dataset._repr_html_ and DataArray._repr_html_ to improve representation of objects in Jupyter. By default this feature is turned off for now. Enable it with xarray.set_options(display_style="html"). (3425) by Benoit Bovy and Julia Signell.
Implement dask deterministic hashing for xarray objects. Note that xarray objects with a dask.array backend already used deterministic hashing in previous releases; this change implements it when whole xarray objects are embedded in a dask graph, e.g. when DataArray.map_blocks is invoked. (3378, 3446, 3515) By Deepak Cherian and Guido Imperiale.
Add the documented-but-missing ~core.groupby.DatasetGroupBy.quantile.
xarray now respects the DataArray.encoding["coordinates"] attribute when writing to disk. See io.coordinates for more. (3351, 3487) By Deepak Cherian.
Add the documented-but-missing ~core.groupby.DatasetGroupBy.quantile. (3525, 3527). By Justus Magin.
Ensure an index of type CFTimeIndex is not converted to a DatetimeIndex when calling Dataset.rename, Dataset.rename_dims and Dataset.rename_vars. By Mathias Hauser. (3522).
Fix a bug in DataArray.set_index in case that an existing dimension becomes a level variable of MultiIndex. (3520). By Keisuke Fujii.
Harmonize _FillValue, missing_value during encoding and decoding steps. (3502) By Anderson Banihirwe.
Fix regression introduced in v0.14.0 that would cause a crash if dask is installed but cloudpickle isn't (3401) by Rhys Doyle
Fix grouping over variables with NaNs. (2383, 3406). By Deepak Cherian.
Make alignment and concatenation significantly more efficient by using dask names to compare dask objects prior to comparing values after computation. This change makes it more convenient to carry around large non-dimensional coordinate variables backed by dask arrays. Existing workarounds involving reset_coords(drop=True) should now be unnecessary in most cases. (3068, 3311, 3454, 3453). By Deepak Cherian.
Add support for cftime>=1.0.4. By Anderson Banihirwe.
Rolling reduction operations no longer compute dask arrays by default. (3161). In addition, the allow_lazy kwarg to reduce is deprecated. By Deepak Cherian.
Fix GroupBy.reduce when reducing over multiple dimensions. (3402). By Deepak Cherian
Allow appending datetime and bool data variables to zarr stores. (3480). By Akihiro Matsukawa.
Add support for numpy >=1.18 (); bugfix mean() on datetime64 arrays on dask backend (3409, 3537). By Guido Imperiale.
Add support for pandas >=0.26 (3440). By Deepak Cherian.
Add support for pseudonetcdf >=3.1 (3485). By Barron Henderson.
Fix leap year condition in monthly means example. By Mickaël Lalande.
Fix the documentation of DataArray.resample and Dataset.resample, explicitly stating that a datetime-like dimension is required. (3400) By Justus Magin.
Update the terminology page to address multidimensional coordinates. (3410) By Jon Thielen.
Fix the documentation of Dataset.integrate and DataArray.integrate and add an example to Dataset.integrate. (3469) By Justus Magin.
Added integration tests against pint. (3238, 3447, 3493, 3508) by Justus Magin.
Note
At the moment of writing, these tests as well as the ability to use pint in general require a highly experimental version of pint (install with pip install git+https://github.com/andrewgsavage/pint.git@refs/pull/6/head). Even with it, interaction with non-numpy array libraries, e.g. dask or sparse, is broken.
Use Python 3.6 idioms throughout the codebase. (3419) By Maximilian Roos
Run basic CI tests on Python 3.8. (3477) By Maximilian Roos
Enable type checking on default sentinel values (3472) By Maximilian Roos
Add Variable._replace for simpler replacing of a subset of attributes (3472) By Maximilian Roos
Breaking changes ~~~~~~~~~~~~~~~~
This release introduces a rolling policy for minimum dependency versions: mindeps_policy.
Several minimum versions have been increased:
Package |
Old |
New |
|---|---|---|
Python |
3.5.3 |
3.6 |
numpy |
1.12 |
1.14 |
pandas |
0.19.2 |
0.24 |
dask |
0.16 (tested: 2.4) |
1.2 |
bottleneck |
1.1 (tested: 1.2) |
1.2 |
matplotlib |
1.5 (tested: 3.1) |
3.1 |
Obsolete patch versions (x.y.Z) are not tested anymore. The oldest supported versions of all optional dependencies are now covered by automated tests (before, only the very latest versions were tested).
(3222, 3293, 3340, 3346, 3358). By Guido Imperiale.
Dropped the drop=False optional parameter from Variable.isel. It was unused and doesn't make sense for a Variable. (3375). By Guido Imperiale.
Remove internal usage of collections.OrderedDict. After dropping support for Python <=3.5, most uses of OrderedDict in xarray were no longer necessary. We have removed the internal use of the OrderedDict in favor of Python's builtin dict object which is now ordered itself. This change will be most obvious when interacting with the attrs property on Dataset and DataArray objects. (3380, 3389). By Joe Hamman.
Added ~xarray.map_blocks, modeled after dask.array.map_blocks. Also added Dataset.unify_chunks, DataArray.unify_chunks and testing.assert_chunks_equal. (3276). By Deepak Cherian and Guido Imperiale.
core.groupby.GroupBy enhancements. By Deepak Cherian.
Added a repr (3344). Example:
>>> da.groupby("time.season")
DataArrayGroupBy, grouped over 'season'
4 groups with labels 'DJF', 'JJA', 'MAM', 'SON'
Added a GroupBy.dims property that mirrors the dimensions of each group (3344).
Speed up Dataset.isel up to 33% and DataArray.isel up to 25% for small arrays (2799, 3375). By Guido Imperiale.
Reintroduce support for weakref (broken in v0.13.0). Support has been reinstated for ~xarray.DataArray and ~xarray.Dataset objects only. Internal xarray objects remain unaddressable by weakref in order to save memory (3317). By Guido Imperiale.
Line plots with the x or y argument set to a 1D non-dimensional coord now plot the correct data for 2D DataArrays (3334). By Tom Nicholas.
Make ~xarray.concat more robust when merging variables present in some datasets but not others (508). By Deepak Cherian.
The default behaviour of reducing across all dimensions for ~xarray.core.groupby.DataArrayGroupBy objects has now been properly removed as was done for ~xarray.core.groupby.DatasetGroupBy in 0.13.0 (3337). Use xarray.ALL_DIMS if you need to replicate previous behaviour. Also raise nicer error message when no groups are created (1764). By Deepak Cherian.
Fix error in concatenating unlabeled dimensions (3362). By Deepak Cherian.
Warn if the dim kwarg is passed to rolling operations. This is redundant since a dimension is specified when the ~computation.rolling.DatasetRolling or ~computation.rolling.DataArrayRolling object is created. (3362). By Deepak Cherian.
Created a glossary of important xarray terms (2410, 3352). By Gregory Gundersen.
Created a "How do I..." section (howdoi) for solutions to common questions. (3357). By Deepak Cherian.
Add examples for Dataset.swap_dims and DataArray.swap_dims (3331, 3331). By Justus Magin.
Add examples for align, merge, combine_by_coords, full_like, zeros_like, ones_like, Dataset.pipe, Dataset.assign, Dataset.reindex, Dataset.fillna (3328). By Anderson Banihirwe.
Fixed documentation to clean up an unwanted file created in ipython example (3353). By Gregory Gundersen.
Breaking changes ~~~~~~~~~~~~~~~~
This release includes many exciting changes: wrapping of NEP18 compliant numpy-like arrays; new ~Dataset.plot.scatter plotting method that can scatter two DataArrays in a Dataset against each other; support for converting pandas DataFrames to xarray objects that wrap pydata/sparse; and more!
This release increases the minimum required Python version from 3.5.0 to 3.5.3 (3089). By Guido Imperiale.
The isel_points and sel_points methods are removed, having been deprecated since v0.10.0. These are redundant with the isel / sel methods. See vectorized-indexing for the details By Maximilian Roos
The inplace kwarg for public methods now raises an error, having been deprecated since v0.11.0. By Maximilian Roos
~xarray.concat now requires the dim argument. Its indexers, mode and concat_over kwargs have now been removed. By Deepak Cherian
Passing a list of colors in cmap will now raise an error, having been deprecated since v0.6.1.
Most xarray objects now define __slots__. This reduces overall RAM usage by ~22% (not counting the underlying numpy buffers); on CPython 3.7/x64, a trivial DataArray has gone down from 1.9kB to 1.5kB.
Caveats:
Pickle streams produced by older versions of xarray can't be loaded using this release, and vice versa.
Any user code that was accessing the __dict__ attribute of xarray objects will break. The best practice to attach custom metadata to xarray objects is to use the attrs dictionary.
Any user code that defines custom subclasses of xarray classes must now explicitly define __slots__ itself. Subclasses that don't add any attributes must state so by defining __slots__ = () right after the class header. Omitting __slots__ will now cause a FutureWarning to be logged, and will raise an error in a later release.
by Guido Imperiale.
The default dimension for Dataset.groupby, Dataset.resample, DataArray.groupby and DataArray.resample reductions is now the grouping or resampling dimension.
DataArray.to_dataset requires name to be passed as a kwarg (previously ambiguous positional arguments were deprecated)
Reindexing with variables of a different dimension now raise an error (previously deprecated)
xarray.broadcast_array is removed (previously deprecated in favor of ~xarray.broadcast)
Variable.expand_dims is removed (previously deprecated in favor of Variable.set_dims)
xarray can now wrap around any NEP18 compliant numpy-like library (important: read notes about NUMPY_EXPERIMENTAL_ARRAY_FUNCTION in the above link). Added explicit test coverage for sparse. (3117, 3202). This requires sparse>=0.8.0. By Nezar Abdennur and Guido Imperiale.
~Dataset.from_dataframe and ~DataArray.from_series now support sparse=True for converting pandas objects into xarray objects wrapping sparse arrays. This is particularly useful with sparsely populated hierarchical indexes. (3206) By Stephan Hoyer.
The xarray package is now discoverable by mypy (although typing hints coverage is not complete yet). mypy type checking is now enforced by CI. Libraries that depend on xarray and use mypy can now remove from their setup.cfg the lines:
[mypy-xarray] ignore_missing_imports = True
(2877, 3088, 3090, 3112, 3117, 3207) By Guido Imperiale and Maximilian Roos.
Added DataArray.broadcast_like and Dataset.broadcast_like. By Deepak Cherian and David Mertz.
Dataset plotting API for visualizing dependencies between two DataArrays! Currently only Dataset.plot.scatter is implemented. By Yohai Bar Sinai and Deepak Cherian
Added DataArray.head, DataArray.tail and DataArray.thin; as well as Dataset.head, Dataset.tail and Dataset.thin methods. (319) By Gerardo Rivera.
Multiple enhancements to ~xarray.concat and ~xarray.open_mfdataset. By Deepak Cherian
Added compat='override'. When merging, this option picks the variable from the first dataset and skips all comparisons.
Added join='override'. When aligning, this only checks that index sizes are equal among objects and skips checking indexes for equality.
~xarray.concat and ~xarray.open_mfdataset now support the join kwarg. It is passed down to ~xarray.align.
~xarray.concat now calls ~xarray.merge on variables that are not concatenated (i.e. variables without concat_dim when data_vars or coords are "minimal"). ~xarray.concat passes its new compat kwarg down to ~xarray.merge. (2064)
Users can avoid a common bottleneck when using ~xarray.open_mfdataset on a large number of files with variables that are known to be aligned and some of which need not be concatenated. Slow equality comparisons can now be avoided, for e.g.:
data = xr.open_mfdataset(files, concat_dim='time', data_vars='minimal',
coords='minimal', compat='override', join='override')
In ~xarray.Dataset.to_zarr, passing mode is not mandatory if append_dim is set, as it will automatically be set to 'a' internally. By David Brochart.
Added the ability to initialize an empty or full DataArray with a single value. (277) By Gerardo Rivera.
~xarray.Dataset.to_netcdf() now supports the invalid_netcdf kwarg when used with engine="h5netcdf". It is passed to h5netcdf.File. By Ulrich Herter.
xarray.Dataset.drop now supports keyword arguments; dropping index labels by using both dim and labels or using a ~core.coordinates.DataArrayCoordinates object are deprecated (2910). By Gregory Gundersen.
Added examples of Dataset.set_index and DataArray.set_index, as well are more specific error messages when the user passes invalid arguments (3176). By Gregory Gundersen.
Dataset.filter_by_attrs now filters the coordinates as well as the variables. By Spencer Jones.
Improve "missing dimensions" error message for ~xarray.apply_ufunc (2078). By Rick Russotto.
~xarray.DataArray.assign_coords now supports dictionary arguments (3231). By Gregory Gundersen.
Fix regression introduced in v0.12.2 where copy(deep=True) would convert unicode indices to dtype=object (3094). By Guido Imperiale.
Improved error handling and documentation for .expand_dims() read-only view.
Fix tests for big-endian systems (3125). By Graham Inggs.
XFAIL several tests which are expected to fail on ARM systems due to a datetime issue in NumPy (2334). By Graham Inggs.
Fix KeyError that arises when using .sel method with float values different from coords float type (3137). By Hasan Ahmad.
Fixed bug in combine_by_coords() causing a ValueError if the input had an unused dimension with coordinates which were not monotonic (3150). By Tom Nicholas.
Fixed crash when applying distributed.Client.compute() to a DataArray (3171). By Guido Imperiale.
Better error message when using groupby on an empty DataArray (3037). By Hasan Ahmad.
Fix error that arises when using open_mfdataset on a series of netcdf files having differing values for a variable attribute of type list. (3034) By Hasan Ahmad.
Prevent ~xarray.DataArray.argmax and ~xarray.DataArray.argmin from calling dask compute (3237). By Ulrich Herter.
Plots in 2 dimensions (pcolormesh, contour) now allow to specify levels as numpy array (3284). By Mathias Hauser.
Fixed bug in DataArray.quantile failing to keep attributes when keep_attrs was True (3304). By David Huard.
Created a PR checklist as a quick reference for tasks before creating a new PR or pushing new commits. By Gregory Gundersen.
Fixed documentation to clean up unwanted files created in ipython examples (3227). By Gregory Gundersen.
Resolved deprecation warnings from newer versions of matplotlib and dask.
New methods Dataset.to_stacked_array and DataArray.to_unstacked_dataset for reshaping Datasets of variables with different dimensions (1317). This is useful for feeding data from xarray into machine learning models, as described in reshape.stacking_different. By Noah Brenowitz.
Support for renaming Dataset variables and dimensions independently with ~Dataset.rename_vars and ~Dataset.rename_dims (3026). By Julia Kent.
Add scales, offsets, units and descriptions attributes to ~xarray.DataArray returned by ~xarray.open_rasterio. (3013) By Erle Carrara.
Resolved deprecation warnings from newer versions of matplotlib and dask.
Compatibility fixes for the upcoming pandas 0.25 and NumPy 1.17 releases. By Stephan Hoyer.
Fix summaries for multiindex coordinates (3079). By Jonas Hörsch.
Fix HDF5 error that could arise when reading multiple groups from a file at once (2954). By Stephan Hoyer.
The older function auto_combine has been deprecated, because its functionality has been subsumed by the new functions. To avoid FutureWarnings switch…
Two new functions, ~xarray.combine_nested and ~xarray.combine_by_coords, allow for combining datasets along any number of dimensions, instead of the one-dimensional list of datasets supported by ~xarray.concat.
The new combine_nested will accept the datasets as a nested list-of-lists, and combine by applying a series of concat and merge operations. The new combine_by_coords instead uses the dimension coordinates of datasets to order them.
~xarray.open_mfdataset can use either combine_nested or combine_by_coords to combine datasets along multiple dimensions, by specifying the argument combine='nested' or combine='by_coords'.
The older function auto_combine has been deprecated, because its functionality has been subsumed by the new functions. To avoid FutureWarnings switch to using combine_nested or combine_by_coords, (or set the combine argument in open_mfdataset). (2159) By Tom Nicholas.
~xarray.DataArray.rolling_exp and ~xarray.Dataset.rolling_exp added, similar to pandas' pd.DataFrame.ewm method. Calling .mean on the resulting object will return an exponentially weighted moving average. By Maximilian Roos.
New DataArray.str for string related manipulations, based on pandas.Series.str. By 0x0L.
Added strftime method to .dt accessor, making it simpler to hand a datetime DataArray to other code expecting formatted dates and times. (2090). ~xarray.CFTimeIndex.strftime is also now available on CFTimeIndex. By Alan Brammer and Ryan May.
GroupBy.quantile is now a method of GroupBy objects (3018). By David Huard.
Argument and return types are added to most methods on DataArray and Dataset, allowing static type checking both within xarray and external libraries. Type checking with mypy is enabled in CI (though not required yet). By Guido Imperiale and Maximilian Roos.
Add keepdims argument for reduce operations (2170) By Scott Wales.
Enable @ operator for DataArray. This is equivalent to DataArray.dot By Maximilian Roos.
Add fill_value argument for reindex, align, and merge operations to enable custom fill values. (2876) By Zach Griffith.
DataArray.transpose now accepts a keyword argument transpose_coords which enables transposition of coordinates in the same way as Dataset.transpose. DataArray.groupby DataArray.groupby_bins, and DataArray.resample now accept a keyword argument restore_coord_dims which keeps the order of the dimensions of multi-dimensional coordinates intact (1856). By Peter Hausamann.
Clean up Python 2 compatibility in code (2950) By Guido Imperiale.
Better warning message when supplying invalid objects to xr.merge (2948). By Mathias Hauser.
Add errors keyword argument to Dataset.drop and Dataset.drop_dims that allows ignoring errors if a passed label or dimension is not in the dataset (2994). By Andrew Ross.
Implement ~xarray.load_dataset and ~xarray.load_dataarray as alternatives to ~xarray.open_dataset and ~xarray.open_dataarray to open, load into memory, and close files, returning the Dataset or DataArray. These functions are helpful for avoiding file-lock errors when trying to write to files opened using open_dataset() or open_dataarray(). (2887) By Dan Nowacki.
It is now possible to extend existing io.zarr datasets, by using mode='a' and the new append_dim argument in ~xarray.Dataset.to_zarr. By Jendrik Jördening, David Brochart, Ryan Abernathey and Shikhar Goenka.
xr.open_zarr now accepts manually specified chunks with the chunks= parameter. auto_chunk=True is equivalent to chunks='auto' for backwards compatibility. The overwrite_encoded_chunks parameter is added to remove the original zarr chunk encoding. By Lily Wang.
netCDF chunksizes are now only dropped when original_shape is different, not when it isn't found. (2207) By Karel van de Plassche.
Character arrays' character dimension name decoding and encoding handled by var.encoding['char_dim_name'] (2895) By James McCreight.
open_rasterio() now supports rasterio.vrt.WarpedVRT with custom transform, width and height (2864). By Julien Michel.
Rolling operations on xarray objects containing dask arrays could silently compute the incorrect result or use large amounts of memory (2940). By Stephan Hoyer.
Don't set encoding attributes on bounds variables when writing to netCDF. (2921) By Deepak Cherian.
NetCDF4 output: variables with unlimited dimensions must be chunked (not contiguous) on output. (1849) By James McCreight.
indexing with an empty list creates an object with zero-length axis (2882) By Mayeul d'Avezac.
Return correct count for scalar datetime64 arrays (2770) By Dan Nowacki.
Fixed max, min exception when applied to a multiIndex (2923) By Ian Castleden
A deep copy deep-copies the coords (1463) By Martin Pletcher.
Increased support for missing_value (2871) By Deepak Cherian.
Removed usages of pytest.config, which is deprecated (2988) By Maximilian Roos.
Fixed performance issues with cftime installed (3000) By 0x0L.
Replace incorrect usages of message in pytest assertions with match (3011) By Maximilian Roos.
Add explicit pytest markers, now required by pytest (3032). By Maximilian Roos.
Test suite fixes for newer versions of pytest (3011, 3032). By Maximilian Roos and Stephan Hoyer.
Allow expand_dims method to support inserting/broadcasting dimensions with size > 1. (2710) By Martin Pletcher _.
Allow expand_dims method to support inserting/broadcasting dimensions with size > 1. (2710) By Martin Pletcher.
Dataset.copy(deep=True) now creates a deep copy of the attrs (2835). By Andras Gefferth.
Fix incorrect indexes resulting from various Dataset operations (e.g., swap_dims, isel, reindex, []) (2842, 2856). By Stephan Hoyer.
The compat argument to Dataset and the encoding argument to DataArray are deprecated and will be removed in a future release. (1188) By Maximilian Roo…
Highlights include:
Removed support for Python 2. This is the first version of xarray that is Python 3 only!
New ~xarray.DataArray.coarsen and ~xarray.DataArray.integrate methods. See compute.coarsen and compute.using_coordinates for details.
Many improvements to cftime support. See below for details.
The compat argument to Dataset and the encoding argument to DataArray are deprecated and will be removed in a future release. (1188) By Maximilian Roos.
Resampling of standard and non-standard calendars indexed by ~xarray.CFTimeIndex is now possible. (2191). By Jwen Fai Low and Spencer Clark.
Taking the mean of arrays of cftime.datetime objects, and by extension, use of ~xarray.DataArray.coarsen with cftime.datetime coordinates is now possible. By Spencer Clark.
Internal plotting now supports cftime.datetime objects as time series. (2164) By Julius Busecke and Spencer Clark.
~xarray.cftime_range now supports QuarterBegin and QuarterEnd offsets (2663). By Jwen Fai Low
~xarray.open_dataset now accepts a use_cftime argument, which can be used to require that cftime.datetime objects are always used, or never used when decoding dates encoded with a standard calendar. This can be used to ensure consistent date types are returned when using ~xarray.open_mfdataset (1263) and/or to silence serialization warnings raised if dates from a standard calendar are found to be outside the pandas.Timestamp-valid range (2754). By Spencer Clark.
pandas.Series.dropna is now supported for a pandas.Series indexed by a ~xarray.CFTimeIndex (2688). By Spencer Clark.
Added ability to open netcdf4/hdf5 file-like objects with open_dataset. Requires (h5netcdf>0.7 and h5py>2.9.0). (2781) By Scott Henderson
Add data=False option to to_dict() methods. (2656) By Ryan Abernathey
DataArray.coarsen and Dataset.coarsen are newly added. See compute.coarsen for details. (2525) By Keisuke Fujii.
Upsampling an array via interpolation with resample is now dask-compatible, as long as the array is not chunked along the resampling dimension. By Spencer Clark.
xarray.testing.assert_equal and xarray.testing.assert_identical now provide a more detailed report showing what exactly differs between the two objects (dimensions / coordinates / variables / attributes) (1507). By Benoit Bovy.
Add tolerance option to resample() methods bfill, pad, nearest. (2695) By Hauke Schulz.
DataArray.integrate and Dataset.integrate are newly added. See compute.using_coordinates for the detail. (1332) By Keisuke Fujii.
Added ~xarray.Dataset.drop_dims (1949). By Kevin Squire.
Silenced warnings that appear when using pandas 0.24. By Stephan Hoyer
Interpolating via resample now internally specifies bounds_error=False as an argument to scipy.interpolate.interp1d, allowing for interpolation from higher frequencies to lower frequencies. Datapoints outside the bounds of the original time coordinate are now filled with NaN (2197). By Spencer Clark.
Line plots with the x argument set to a non-dimensional coord now plot the correct data for 1D DataArrays. (2725). By Tom Nicholas.
Subtracting a scalar cftime.datetime object from a CFTimeIndex now results in a pandas.TimedeltaIndex instead of raising a TypeError (2671). By Spencer Clark.
backend_kwargs are no longer ignored when using open_dataset with pynio engine (:issue:'2380') By Jonathan Joyce.
Fix open_rasterio creating a WKT CRS instead of PROJ.4 with rasterio 1.0.14+ (2715). By David Hoese.
Masking data arrays with xarray.DataArray.where now returns an array with the name of the original masked array (2748 and 2457). By Yohai Bar-Sinai.
Fixed error when trying to reduce a DataArray using a function which does not require an axis argument. (2768) By Tom Nicholas.
Concatenating a sequence of ~xarray.DataArray with varying names sets the name of the output array to None, instead of the name of the first input array. If the names are the same it sets the name to that, instead to the name of the first DataArray in the list as it did before. (2775). By Tom Nicholas.
Per the CF conventions section on calendars, specifying 'standard' as the calendar type in ~xarray.cftime_range now correctly refers to the 'gregorian' calendar instead of the 'proleptic_gregorian' calendar (2761).
Saving files with times encoded with reference dates with timezones (e.g. '2000-01-01T00:00:00-05:00') no longer raises an error (2649). By Spencer Cl
Saving files with times encoded with reference dates with timezones (e.g. '2000-01-01T00:00:00-05:00') no longer raises an error (2649). By Spencer Clark.
Fixed performance regression with open_mfdataset (2662). By Tom Nicholas.
Fixed supplying an explicit dimension in the concat_dim argument to to open_mfdataset (2647). By Ben Root.
Removes inadvertently introduced setup dependency on pytest-runner (2641). Otherwise, this release is exactly equivalent to 0.11.1.
Removes inadvertently introduced setup dependency on pytest-runner (2641). Otherwise, this release is exactly equivalent to 0.11.1.
Warning
This is the last xarray release that will support Python 2.7. Future releases will be Python 3 only, but older versions of xarray will always be available for Python 2.7 users. For the more details, see:
Xarray Github issue discussing dropping Python 2
This minor release includes a number of enhancements and bug fixes, and two (slightly) breaking changes.
This minor release includes a number of enhancements and bug fixes, and two (slightly) breaking changes.
Minimum rasterio version increased from 0.36 to 1.0 (for open_rasterio)
Time bounds variables are now also decoded according to CF conventions (2565). The previous behavior was to decode them only if they had specific time attributes, now these attributes are copied automatically from the corresponding time coordinate. This might break downstream code that was relying on these variables to be brake downstream code that was relying on these variables to be not decoded. By Fabien Maussion.
Ability to read and write consolidated metadata in zarr stores (2558). By Ryan Abernathey.
CFTimeIndex uses slicing for string indexing when possible (like pandas.DatetimeIndex), which avoids unnecessary copies. By Stephan Hoyer
Enable passing rasterio.io.DatasetReader or rasterio.vrt.WarpedVRT to open_rasterio instead of file path string. Allows for in-memory reprojection, see (2588). By Scott Henderson.
Like pandas.DatetimeIndex, CFTimeIndex now supports "dayofyear" and "dayofweek" accessors (2597). Note this requires a version of cftime greater than 1.0.2. By Spencer Clark.
The option 'warn_for_unclosed_files' (False by default) has been added to allow users to enable a warning when files opened by xarray are deallocated but were not explicitly closed. This is mostly useful for debugging; we recommend enabling it in your test suites if you use xarray for IO. By Stephan Hoyer
Support Dask HighLevelGraphs by Matthew Rocklin.
DataArray.resample and Dataset.resample now supports the loffset kwarg just like pandas. By Deepak Cherian
Datasets are now guaranteed to have a 'source' encoding, so the source file name is always stored (2550). By Tom Nicholas.
The apply methods for DatasetGroupBy, DataArrayGroupBy, DatasetResample and DataArrayResample now support passing positional arguments to the applied function as a tuple to the args argument. By Matti Eskelinen.
0d slices of ndarrays are now obtained directly through indexing, rather than extracting and wrapping a scalar, avoiding unnecessary copying. By Daniel Wennberg.
Added support for fill_value with ~xarray.DataArray.shift and ~xarray.Dataset.shift By Maximilian Roos
Ensure files are automatically closed, if possible, when no longer referenced by a Python variable (2560). By Stephan Hoyer
Fixed possible race conditions when reading/writing to disk in parallel (2595). By Stephan Hoyer
Fix h5netcdf saving scalars with filters or chunks (2563). By Martin Raspaud.
Fix parsing of _Unsigned attribute set by OPENDAP servers. (2583). By Deepak Cherian
Fix failure in time encoding when exporting to netCDF with versions of pandas less than 0.21.1 (2623). By Spencer Clark.
Fix MultiIndex selection to update label and level (2619). By Keisuke Fujii.
Breaking changes ~~~~~~~~~~~~~~~~
Finished deprecations (changed behavior with this release):
Dataset.T has been removed as a shortcut for Dataset.transpose. Call Dataset.transpose directly instead.
Iterating over a Dataset now includes only data variables, not coordinates. Similarly, calling len and bool on a Dataset now includes only data variables.
DataArray.__contains__ (used by Python's in operator) now checks array data, not coordinates.
The old resample syntax from before xarray 0.10, e.g., data.resample('1D', dim='time', how='mean'), is no longer supported will raise an error in most cases. You need to use the new resample syntax instead, e.g., data.resample(time='1D').mean() or data.resample({'time': '1D'}).mean().
New deprecations (behavior will be changed in xarray 0.12):
Reduction of DataArray.groupby and DataArray.resample without dimension argument will change in the next release. Now we warn a FutureWarning. By Keisuke Fujii.
The inplace kwarg of a number of DataArray and Dataset methods is being deprecated and will be removed in the next release. By Deepak Cherian.
Refactored storage backends:
Xarray's storage backends now automatically open and close files when necessary, rather than requiring opening a file with autoclose=True. A global least-recently-used cache is used to store open files; the default limit of 128 open files should suffice in most cases, but can be adjusted if necessary with xarray.set_options(file_cache_maxsize=...). The autoclose argument to open_dataset and related functions has been deprecated and is now a no-op.
This change, along with an internal refactor of xarray's storage backends, should significantly improve performance when reading and writing netCDF files with Dask, especially when working with many files or using Dask Distributed. By Stephan Hoyer
Support for non-standard calendars used in climate science:
Xarray will now always use cftime.datetime objects, rather than by default trying to coerce them into np.datetime64[ns] objects. A ~xarray.CFTimeIndex will be used for indexing along time coordinates in these cases.
A new method ~xarray.CFTimeIndex.to_datetimeindex has been added to aid in converting from a ~xarray.CFTimeIndex to a pandas.DatetimeIndex for the remaining use-cases where using a ~xarray.CFTimeIndex is still a limitation (e.g. for resample or plotting).
Setting the enable_cftimeindex option is now a no-op and emits a FutureWarning.
xarray.DataArray.plot.line can now accept multidimensional coordinate variables as input. hue must be a dimension name in this case. (2407) By Deepak Cherian.
Added support for Python 3.7. (2271). By Joe Hamman.
Added support for plotting data with pandas.Interval coordinates, such as those created by ~xarray.DataArray.groupby_bins By Maximilian Maahn.
Added ~xarray.CFTimeIndex.shift for shifting the values of a CFTimeIndex by a specified frequency. (2244). By Spencer Clark.
Added support for using cftime.datetime coordinates with ~xarray.DataArray.differentiate, ~xarray.Dataset.differentiate, ~xarray.DataArray.interp, and ~xarray.Dataset.interp. By Spencer Clark
There is now a global option to either always keep or always discard dataset and dataarray attrs upon operations. The option is set with xarray.set_options(keep_attrs=True), and the default is to use the old behaviour. By Tom Nicholas.
Added a new backend for the GRIB file format based on ECMWF cfgrib python driver and ecCodes C-library. (2475) By Alessandro Amici, sponsored by ECMWF.
Resample now supports a dictionary mapping from dimension to frequency as its first argument, e.g., data.resample({'time': '1D'}).mean(). This is consistent with other xarray functions that accept either dictionaries or keyword arguments. By Stephan Hoyer.
The preferred way to access tutorial data is now to load it lazily with xarray.tutorial.open_dataset. xarray.tutorial.load_dataset calls Dataset.load() prior to returning (and is now deprecated). This was changed in order to facilitate using tutorial datasets with dask. By Joe Hamman.
DataArray can now use xr.set_option(keep_attrs=True) and retain attributes in binary operations, such as (+, -, * ,/). Default behaviour is unchanged (Attributes will be dismissed). By Michael Blaschek
FacetGrid now properly uses the cbar_kwargs keyword argument. (1504, 1717) By Deepak Cherian.
Addition and subtraction operators used with a CFTimeIndex now preserve the index's type. (2244). By Spencer Clark.
We now properly handle arrays of datetime.datetime and datetime.timedelta provided as coordinates. (2512) By Deepak Cherian.
xarray.DataArray.roll correctly handles multidimensional arrays. (2445) By Keisuke Fujii.
xarray.plot() now properly accepts a norm argument and does not override the norm's vmin and vmax. (2381) By Deepak Cherian.
xarray.DataArray.std() now correctly accepts ddof keyword argument. (2240) By Keisuke Fujii.
Restore matplotlib's default of plotting dashed negative contours when a single color is passed to DataArray.contour() e.g. colors='k'. By Deepak Cherian.
Fix a bug that caused some indexing operations on arrays opened with open_rasterio to error (2454). By Stephan Hoyer.
Subtracting one CFTimeIndex from another now returns a pandas.TimedeltaIndex, analogous to the behavior for DatetimeIndexes (2484). By Spencer Clark.
Adding a TimedeltaIndex to, or subtracting a TimedeltaIndex from a CFTimeIndex is now allowed (2484). By Spencer Clark.
Avoid use of Dask's deprecated get= parameter in tests by Matthew Rocklin.
An OverflowError is now accurately raised and caught during the encoding process if a reference date is used that is so distant that the dates must be encoded using cftime rather than NumPy (2272). By Spencer Clark.
Chunked datasets can now roundtrip to Zarr storage continually with to_zarr and open_zarr (2300). By Lily Wang.
…coordinates rolled by default, raises a deprecation warning unless explicitly setting the keyword argument. (1875) By Andrew Huang _.
This minor release contains a number of backwards compatible enhancements.
Announcements of note:
Xarray is now a NumFOCUS fiscally sponsored project! Read the announcement for more details.
We have a new roadmap that outlines our future development plans.
Dataset.apply now properly documents the way func is called. By Matti Eskelinen.
~xarray.DataArray.differentiate and ~xarray.Dataset.differentiate are newly added. (1332) By Keisuke Fujii.
Default colormap for sequential and divergent data can now be set via ~xarray.set_options() (2394) By Julius Busecke.
min_count option is newly supported in ~xarray.DataArray.sum, ~xarray.DataArray.prod and ~xarray.Dataset.sum, and ~xarray.Dataset.prod. (2230) By Keisuke Fujii.
~plot.plot() now accepts the kwargs xscale, yscale, xlim, ylim, xticks, yticks just like pandas. Also xincrease=False, yincrease=False now use matplotlib's axis inverting methods instead of setting limits. By Deepak Cherian. (2224)
DataArray coordinates and Dataset coordinates and data variables are now displayed as a b ... y z rather than a b c d .... (1186) By Seth P.
A new CFTimeIndex-enabled cftime_range function for use in generating dates from standard or non-standard calendars. By Spencer Clark.
When interpolating over a datetime64 axis, you can now provide a datetime string instead of a datetime64 object. E.g. da.interp(time='1991-02-01') (2284) By Deepak Cherian.
A clear error message is now displayed if a set or dict is passed in place of an array (2331) By Maximilian Roos.
Applying unstack to a large DataArray or Dataset is now much faster if the MultiIndex has not been modified after stacking the indices. (1560) By Maximilian Maahn.
You can now control whether or not to offset the coordinates when using the roll method and the current behavior, coordinates rolled by default, raises a deprecation warning unless explicitly setting the keyword argument. (1875) By Andrew Huang.
You can now call unstack without arguments to unstack every MultiIndex in a DataArray or Dataset. By Julia Signell.
Added the ability to pass a data kwarg to copy to create a new object with the same metadata as the original object but using new values. By Julia Signell.
xarray.plot.imshow() correctly uses the origin argument. (2379) By Deepak Cherian.
Fixed DataArray.to_iris() failure while creating DimCoord by falling back to creating AuxCoord. Fixed dependency on var_name attribute being set. (2201) By Thomas Voigt.
Fixed a bug in zarr backend which prevented use with datasets with invalid chunk size encoding after reading from an existing store (2278). By Joe Hamman.
Tests can be run in parallel with pytest-xdist By Tony Tung.
Follow up the renamings in dask; from dask.ghost to dask.overlap By Keisuke Fujii.
Now raises a ValueError when there is a conflict between dimension names and level names of MultiIndex. (2299) By Keisuke Fujii.
Follow up the renamings in dask; from dask.ghost to dask.overlap By Keisuke Fujii.
Now ~xarray.apply_ufunc raises a ValueError when the size of input_core_dims is inconsistent with the number of arguments. (2341) By Keisuke Fujii.
Fixed Dataset.filter_by_attrs() behavior not matching netCDF4.Dataset.get_variables_by_attributes(). When more than one key=value is passed into Dataset.filter_by_attrs() it will now return a Dataset with variables which pass all the filters. (2315) By Andrew Barna.
Breaking changes ~~~~~~~~~~~~~~~~
Xarray no longer supports python 3.4. Additionally, the minimum supported versions of the following dependencies has been updated and/or clarified:
pandas: 0.18 -> 0.19
NumPy: 1.11 -> 1.12
Dask: 0.9 -> 0.16
Matplotlib: unspecified -> 1.5
(2204). By Joe Hamman.
~xarray.DataArray.interp_like and ~xarray.Dataset.interp_like methods are newly added. (2218) By Keisuke Fujii.
Added support for curvilinear and unstructured generic grids to ~xarray.DataArray.to_cdms2 and ~xarray.DataArray.from_cdms2 (2262). By Stephane Raynaud.
Fixed a bug in zarr backend which prevented use with datasets with incomplete chunks in multiple dimensions (2225). By Joe Hamman.
Fixed a bug in ~Dataset.to_netcdf which prevented writing datasets when the arrays had different chunk sizes (2254). By Mike Neish.
Fixed masking during the conversion to cdms2 objects by ~xarray.DataArray.to_cdms2 (2262). By Stephane Raynaud.
Fixed a bug in 2D plots which incorrectly raised an error when 2D coordinates weren't monotonic (2250). By Fabien Maussion.
Fixed warning raised in ~Dataset.to_netcdf due to deprecation of effective_get in dask (2238). By Joe Hamman.
Plot labels now make use of metadata that follow CF conventions (2135). By Deepak Cherian _ and Ryan Abernathey _.
Plot labels now make use of metadata that follow CF conventions (2135). By Deepak Cherian and Ryan Abernathey.
Line plots now support facetting with row and col arguments (2107). By Yohai Bar Sinai.
~xarray.DataArray.interp and ~xarray.Dataset.interp methods are newly added. See interp for the detail. (2079) By Keisuke Fujii.
Fixed a bug in rasterio backend which prevented use with distributed. The rasterio backend now returns pickleable objects (2021). By Joe Hamman.
The minor release includes a number of bug-fixes and backwards compatible enhancements.
The minor release includes a number of bug-fixes and backwards compatible enhancements.
New PseudoNetCDF backend for many Atmospheric data formats including GEOS-Chem, CAMx, NOAA arlpacked bit and many others. See io.PseudoNetCDF for more details. By Barron Henderson.
The Dataset constructor now aligns DataArray arguments in data_vars to indexes set explicitly in coords, where previously an error would be raised. (674) By Maximilian Roos.
~DataArray.sel, ~DataArray.isel & ~DataArray.reindex, (and their Dataset counterparts) now support supplying a dict as a first argument, as an alternative to the existing approach of supplying kwargs. This allows for more robust behavior of dimension names which conflict with other keyword names, or are not strings. By Maximilian Roos.
~DataArray.rename now supports supplying **kwargs, as an alternative to the existing approach of supplying a dict as the first argument. By Maximilian Roos.
~DataArray.cumsum and ~DataArray.cumprod now support aggregation over multiple dimensions at the same time. This is the default behavior when dimensions are not specified (previously this raised an error). By Stephan Hoyer
DataArray.dot and dot are partly supported with older dask<0.17.4. (related to 2203) By Keisuke Fujii.
Xarray now uses Versioneer to manage its version strings. (1300). By Joe Hamman.
Fixed a regression in 0.10.4, where explicitly specifying dtype='S1' or dtype=str in encoding with to_netcdf() raised an error (2149). Stephan Hoyer
apply_ufunc now directly validates output variables (1931). By Stephan Hoyer.
Fixed a bug where to_netcdf(..., unlimited_dims='bar') yielded NetCDF files with spurious 0-length dimensions (i.e. b, a, and r) (2134). By Joe Hamman.
Removed spurious warnings with Dataset.update(Dataset) (2161) and array.equals(array) when array contains NaT (2162). By Stephan Hoyer.
Aggregations with Dataset.reduce (including mean, sum, etc) no longer drop unrelated coordinates (1470). Also fixed a bug where non-scalar data-variables that did not include the aggregation dimension were improperly skipped. By Stephan Hoyer
Fix ~DataArray.stack with non-unique coordinates on pandas 0.23 (2160). By Stephan Hoyer
Selecting data indexed by a length-1 CFTimeIndex with a slice of strings now behaves as it does when using a length-1 DatetimeIndex (i.e. it no longer falsely returns an empty array when the slice includes the value in the index) (2165). By Spencer Clark.
Fix DataArray.groupby().reduce() mutating coordinates on the input array when grouping over dimension coordinates with duplicated entries (2153). By Stephan Hoyer
Fix Dataset.to_netcdf() cannot create group with engine="h5netcdf" (2177). By Stephan Hoyer
Nothing published for this version
The minor release includes a number of bug-fixes and backwards compatible enhancements. A highlight is CFTimeIndex, which offers support for non-stand
The minor release includes a number of bug-fixes and backwards compatible enhancements. A highlight is CFTimeIndex, which offers support for non-standard calendars used in climate modeling.
New FAQ entry, ecosystem. By Deepak Cherian.
assigning-values now includes examples on how to select and assign values to a ~xarray.DataArray with .loc. By Chiara Lepore.
Add an option for using a CFTimeIndex for indexing times with non-standard calendars and/or outside the Timestamp-valid range; this index enables a subset of the functionality of a standard pandas.DatetimeIndex. See CFTimeIndex for full details. (789, 1084, 1252) By Spencer Clark with help from Stephan Hoyer.
Allow for serialization of cftime.datetime objects (789, 1084, 2008, 1252) using the standalone cftime library. By Spencer Clark.
Support writing lists of strings as netCDF attributes (2044). By Dan Nowacki.
~xarray.Dataset.to_netcdf with engine='h5netcdf' now accepts h5py encoding settings compression and compression_opts, along with the NetCDF4-Python style settings gzip=True and complevel. This allows using any compression plugin installed in hdf5, e.g. LZF (1536). By Guido Imperiale.
~xarray.dot on dask-backed data will now call dask.array.einsum. This greatly boosts speed and allows chunking on the core dims. The function now requires dask >= 0.17.3 to work on dask-backed data (2074). By Guido Imperiale.
plot.line() learned new kwargs: xincrease, yincrease that change the direction of the respective axes. By Deepak Cherian.
Added the parallel option to open_mfdataset. This option uses dask.delayed to parallelize the open and preprocessing steps within open_mfdataset. This is expected to provide performance improvements when opening many files, particularly when used in conjunction with dask's multiprocessing or distributed schedulers (1981). By Joe Hamman.
New compute option in ~xarray.Dataset.to_netcdf, ~xarray.Dataset.to_zarr, and ~xarray.save_mfdataset to allow for the lazy computation of netCDF and zarr stores. This feature is currently only supported by the netCDF4 and zarr backends. (1784). By Joe Hamman.
ValueError is raised when coordinates with the wrong size are assigned to a DataArray. (2112) By Keisuke Fujii.
Fixed a bug in ~xarray.DataArray.rolling with bottleneck. Also, fixed a bug in rolling an integer dask array. (2113) By Keisuke Fujii.
Fixed a bug where keep_attrs=True flag was neglected if apply_ufunc was used with Variable. (2114) By Keisuke Fujii.
When assigning a DataArray to Dataset, any conflicted non-dimensional coordinates of the DataArray are now dropped. (2068) By Keisuke Fujii.
Better error handling in open_mfdataset (2077). By Stephan Hoyer.
plot.line() does not call autofmt_xdate() anymore. Instead it changes the rotation and horizontal alignment of labels without removing the x-axes of any other subplots in the figure (if any). By Deepak Cherian.
Colorbar limits are now determined by excluding ±Infs too. By Deepak Cherian. By Joe Hamman.
Fixed to_iris to maintain lazy dask array after conversion (2046). By Alex Hilson and Stephan Hoyer.
The minor release includes a number of bug-fixes and backwards compatible enhancements.
The minor release includes a number of bug-fixes and backwards compatible enhancements.
For full details, see the release notes: http://xarray.pydata.org/en/latest/whats-new.html
The minor release includes a number of bug-fixes and backwards compatible enhancements.
~xarray.DataArray.isin and ~xarray.Dataset.isin methods, which test each value in the array for whether it is contained in the supplied list, returning a bool array. See selecting-values-with-isin for full details. Similar to the np.isin function. By Maximilian Roos.
Some speed improvement to construct ~xarray.computation.rolling.DataArrayRolling object (1993) By Keisuke Fujii.
Handle variables with different values for missing_value and _FillValue by masking values for both attributes; previously this resulted in a ValueError. (2016) By Ryan May.
Fixed decode_cf function to operate lazily on dask arrays (1372). By Ryan Abernathey.
Fixed labeled indexing with slice bounds given by xarray objects with datetime64 or timedelta64 dtypes (1240). By Stephan Hoyer.
Attempting to convert an xarray.Dataset into a numpy array now raises an informative error message. By Stephan Hoyer.
Fixed a bug in decode_cf_datetime where int32 arrays weren't parsed correctly (2002). By Fabien Maussion.
When calling xr.auto_combine() or xr.open_mfdataset() with a concat_dim, the resulting dataset will have that one-element dimension (it was silently dropped, previously) (1988). By Ben Root.
The minor release includes a number of bug-fixes and enhancements, along with one possibly backwards incompatible change (when applying NumPy ufunc me…
The minor release includes a number of bug-fixes and enhancements, along with one possibly backwards incompatible change (when applying NumPy ufunc methods to xarray objects).
For full details, see the release notes.
The minor release includes a number of bug-fixes and enhancements, along with one possibly backwards incompatible change.
The addition of __array_ufunc__ for xarray objects (see below) means that NumPy ufunc methods (e.g., np.add.reduce) that previously worked on xarray.DataArray objects by converting them into NumPy arrays will now raise NotImplementedError instead. In all cases, the work-around is simple: convert your objects explicitly into NumPy arrays before calling the ufunc (e.g., with .values).
Added ~xarray.dot, equivalent to numpy.einsum. Also, ~xarray.DataArray.dot now supports dims option, which specifies the dimensions to sum over. (1951) By Keisuke Fujii.
Support for writing xarray datasets to netCDF files (netcdf4 backend only) when using the dask.distributed scheduler (1464). By Joe Hamman.
Support lazy vectorized-indexing. After this change, flexible indexing such as orthogonal/vectorized indexing, becomes possible for all the backend arrays. Also, lazy transpose is now also supported. (1897) By Keisuke Fujii.
Implemented NumPy's __array_ufunc__ protocol for all xarray objects (1617). This enables using NumPy ufuncs directly on xarray.Dataset objects with recent versions of NumPy (v1.13 and newer):
ds = xr.Dataset({"a": 1})
np.sin(ds)
This obliviates the need for the xarray.ufuncs module, which will be deprecated in the future when xarray drops support for older versions of NumPy. By Stephan Hoyer.
Improve ~xarray.DataArray.rolling logic. ~xarray.computation.rolling.DataArrayRolling object now supports ~xarray.computation.rolling.DataArrayRolling.construct method that returns a view of the DataArray / Dataset object with the rolling-window dimension added to the last axis. This enables more flexible operation, such as strided rolling, windowed rolling, ND-rolling, short-time FFT and convolution. (1831, 1142, 819) By Keisuke Fujii.
~plot.line() learned to make plots with data on x-axis if so specified. (575) By Deepak Cherian.
Raise an informative error message when using apply_ufunc with numpy v1.11 (1956). By Stephan Hoyer.
Fix the precision drop after indexing datetime64 arrays (1932). By Keisuke Fujii.
Silenced irrelevant warnings issued by open_rasterio (1964). By Stephan Hoyer.
Fix kwarg colors clashing with auto-inferred cmap (1461) By Deepak Cherian.
Fix ~xarray.plot.imshow error when passed an RGB array with size one in a spatial dimension. By Zac Hatfield-Dodds.
The minor release includes a number of bug-fixes and backwards compatible enhancements. For full details, see the release notes.
The minor release includes a number of bug-fixes and backwards compatible enhancements. For full details, see the release notes.
The minor release includes a number of bug-fixes and backwards compatible enhancements.
Added a new guide on contributing (640) By Joe Hamman.
Added apply_ufunc example to /examples/weather-data (1844). By Liam Brannigan.
New entry Why don’t aggregations return Python scalars? in the faq (1726). By 0x0L.
New functions and methods:
Added DataArray.to_iris and DataArray.from_iris for converting data arrays to and from Iris Cubes with the same data and coordinates (621 and 37). By Neil Parley and Duncan Watson-Parris.
Experimental support for using Zarr as storage layer for xarray (1223). By Ryan Abernathey and Joe Hamman.
New ~xarray.DataArray.rank on arrays and datasets. Requires bottleneck (1731). By 0x0L.
.dt accessor can now ceil, floor and round timestamps to specified frequency. By Deepak Cherian.
Plotting enhancements:
xarray.plot.imshow now handles RGB and RGBA images. Saturation can be adjusted with vmin and vmax, or with robust=True. By Zac Hatfield-Dodds.
~plot.contourf() learned to contour 2D variables that have both a 1D coordinate (e.g. time) and a 2D coordinate (e.g. depth as a function of time) (1737). By Deepak Cherian.
~plot.plot() rotates x-axis ticks if x-axis is time. By Deepak Cherian.
~plot.line() can draw multiple lines if provided with a 2D variable. By Deepak Cherian.
Other enhancements:
Reduce methods such as DataArray.sum() now handles object-type array.
da = xr.DataArray(np.array([True, False, np.nan], dtype=object), dims="x")
da.sum()
(1866) By Keisuke Fujii.
Reduce methods such as DataArray.sum() now accepts dtype arguments. (1838) By Keisuke Fujii.
Added nodatavals attribute to DataArray when using ~xarray.open_rasterio. (1736). By Alan Snow.
Use pandas.Grouper class in xarray resample methods rather than the deprecated pandas.TimeGrouper class (1766). By Joe Hamman.
Experimental support for parsing ENVI metadata to coordinates and attributes in xarray.open_rasterio. By Matti Eskelinen.
Reduce memory usage when decoding a variable with a scale_factor, by converting 8-bit and 16-bit integers to float32 instead of float64 (1840), and keeping float16 and float32 as float32 (1842). Correspondingly, encoded variables may also be saved with a smaller dtype. By Zac Hatfield-Dodds.
Speed of reindexing/alignment with dask array is orders of magnitude faster when inserting missing values (1847). By Stephan Hoyer.
Fix axis keyword ignored when applying np.squeeze to DataArray (1487). By Florian Pinault.
netcdf4-python has moved the its time handling in the netcdftime module to a standalone package (netcdftime). As such, xarray now considers netcdftime an optional dependency. One benefit of this change is that it allows for encoding/decoding of datetimes with non-standard calendars without the netcdf4-python dependency (1084). By Joe Hamman.
New functions/methods
New ~xarray.DataArray.rank on arrays and datasets. Requires bottleneck (1731). By 0x0L.
Rolling aggregation with center=True option now gives the same result with pandas including the last element (1046). By Keisuke Fujii.
Support indexing with a 0d-np.ndarray (1921). By Keisuke Fujii.
Added warning in api.py of a netCDF4 bug that occurs when the filepath has 88 characters (1745). By Liam Brannigan.
Fixed encoding of multi-dimensional coordinates in ~Dataset.to_netcdf (1763). By Mike Neish.
Fixed chunking with non-file-based rasterio datasets (1816) and refactored rasterio test suite. By Ryan Abernathey
Bug fix in open_dataset(engine='pydap') (1775) By Keisuke Fujii.
Bug fix in vectorized assignment (1743, 1744). Now item assignment to ~DataArray.__setitem__ checks
Bug fix in vectorized assignment (1743, 1744). Now item assignment to DataArray.__setitem__ checks coordinates of target, destination and keys. If there are any conflict among these coordinates, IndexError will be raised. By Keisuke Fujii.
Properly point DataArray.__dask_scheduler__ to dask.threaded.get. By Matthew Rocklin.
Bug fixes in DataArray.plot.imshow: all-NaN arrays and arrays with size one in some dimension can now be plotted, which is good for exploring satellite imagery (1780). By Zac Hatfield-Dodds.
Fixed UnboundLocalError when opening netCDF file (1781). By Stephan Hoyer.
The variables, attrs, and dimensions properties have been deprecated as part of a bug fix addressing an issue where backends were unintentionally loading the datastores data and attributes repeatedly during writes (1798). By Joe Hamman.
Compatibility fixes to plotting module for NumPy 1.14 and pandas 0.22 (1813). By Joe Hamman.
Bug fix in encoding coordinates with {'_FillValue': None} in netCDF metadata (1865). By Chris Roth.
Fix indexing with lists for arrays loaded from netCDF files with engine='h5netcdf (1864). By Stephan Hoyer.
Corrected a bug with incorrect coordinates for non-georeferenced geotiff files (1686). Internally, we now use the rasterio coordinate transform tool instead of doing the computations ourselves. A parse_coordinates kwarg has been added to ~open_rasterio (set to True per default). By Fabien Maussion.
The colors of discrete colormaps are now the same regardless if seaborn is installed or not (1896). By Fabien Maussion.
Fixed dtype promotion rules in where and concat to match pandas (1847). A combination of strings/numbers or unicode/bytes now promote to object dtype, instead of strings or unicode. By Stephan Hoyer.
Fixed bug where ~xarray.DataArray.isnull was loading data stored as dask arrays (1937). By Joe Hamman.
This is a major release that includes bug fixes, new features and a few backwards incompatible changes. Highlights include:
This is a major release that includes bug fixes, new features and a few backwards incompatible changes. Highlights include:
resample has a new groupby-like API like pandas.xarray.apply_ufunc facilitates wrapping and parallelizing functions written for NumPy arrays.open_mfdataset.For more details, see the release notes: http://xarray.pydata.org/en/latest/whats-new.html
This is a major release that includes bug fixes, new features and a few backwards incompatible changes. Highlights include:
Indexing now supports broadcasting over dimensions, similar to NumPy's vectorized indexing (but better!).
~DataArray.resample has a new groupby-like API like pandas.
~xarray.apply_ufunc facilitates wrapping and parallelizing functions written for NumPy arrays.
Performance improvements, particularly for dask and open_mfdataset.
xarray now supports a form of vectorized indexing with broadcasting, where the result of indexing depends on dimensions of indexers, e.g., array.sel(x=ind) with ind.dims == ('y',). Alignment between coordinates on indexed and indexing objects is also now enforced. Due to these changes, existing uses of xarray objects to index other xarray objects will break in some cases.
The new indexing API is much more powerful, supporting outer, diagonal and vectorized indexing in a single interface. The isel_points and sel_points methods are deprecated, since they are now redundant with the isel / sel methods. See vectorized-indexing for the details (1444, 1436). By Keisuke Fujii and Stephan Hoyer.
A new resampling interface to match pandas' groupby-like API was added to Dataset.resample and DataArray.resample (1272). Timeseries resampling is fully supported for data with arbitrary dimensions as is both downsampling and upsampling (including linear, quadratic, cubic, and spline interpolation).
Old syntax:
ds.resample("24H", dim="time", how="max")
New syntax:
ds.resample(time="24H").max()
Note that both versions are currently supported, but using the old syntax will produce a warning encouraging users to adopt the new syntax. By Daniel Rothenberg.
Calling repr() or printing xarray objects at the command line or in a Jupyter Notebook will not longer automatically compute dask variables or load data on arrays lazily loaded from disk (1522). By Guido Imperiale.
Supplying coords as a dictionary to the DataArray constructor without also supplying an explicit dims argument is no longer supported. This behavior was deprecated in version 0.9 but will now raise an error (727).
Several existing features have been deprecated and will change to new behavior in xarray v0.11. If you use any of them with xarray v0.10, you should see a FutureWarning that describes how to update your code:
Dataset.T has been deprecated an alias for Dataset.transpose() (1232). In the next major version of xarray, it will provide short- cut lookup for variables or attributes with name 'T'.
DataArray.__contains__ (e.g., key in data_array) currently checks for membership in DataArray.coords. In the next major version of xarray, it will check membership in the array data found in DataArray.values instead (1267).
Direct iteration over and counting a Dataset (e.g., [k for k in ds], ds.keys(), ds.values(), len(ds) and if ds) currently includes all variables, both data and coordinates. For improved usability and consistency with pandas, in the next major version of xarray these will change to only include data variables (884). Use ds.variables, ds.data_vars or ds.coords as alternatives.
Changes to minimum versions of dependencies:
Old numpy < 1.11 and pandas < 0.18 are no longer supported (1512). By Keisuke Fujii.
The minimum supported version bottleneck has increased to 1.1 (1279). By Joe Hamman.
New functions/methods
New helper function ~xarray.apply_ufunc for wrapping functions written to work on NumPy arrays to support labels on xarray objects (770). apply_ufunc also support automatic parallelization for many functions with dask. See compute.wrapping-custom and dask.automatic-parallelization for details. By Stephan Hoyer.
Added new method Dataset.to_dask_dataframe, convert a dataset into a dask dataframe. This allows lazy loading of data from a dataset containing dask arrays (1462). By James Munroe.
New function ~xarray.where for conditionally switching between values in xarray objects, like numpy.where:
import xarray as xr
arr = xr.DataArray([[1, 2, 3], [4, 5, 6]], dims=("x", "y"))
xr.where(arr % 2, "even", "odd")
<xarray.DataArray (x: 2, y: 3)>
array([['even', 'odd', 'even'],
['odd', 'even', 'odd']],
dtype='<U4')
Dimensions without coordinates: x, y
Equivalently, the ~xarray.Dataset.where method also now supports the other argument, for filling with a value other than NaN (576). By Stephan Hoyer.
Added ~xarray.show_versions function to aid in debugging (1485). By Joe Hamman.
Performance improvements
~xarray.concat was computing variables that aren't in memory (e.g. dask-based) multiple times; ~xarray.open_mfdataset was loading them multiple times from disk. Now, both functions will instead load them at most once and, if they do, store them in memory in the concatenated array/dataset (1521). By Guido Imperiale.
Speed-up (x 100) of xarray.conventions.decode_cf_datetime. By Christian Chwala.
IO related improvements
Unicode strings (str on Python 3) are now round-tripped successfully even when written as character arrays (e.g., as netCDF3 files or when using engine='scipy') (1638). This is controlled by the _Encoding attribute convention, which is also understood directly by the netCDF4-Python interface. See io.string-encoding for full details. By Stephan Hoyer.
Support for data_vars and coords keywords from ~xarray.concat added to ~xarray.open_mfdataset (438). Using these keyword arguments can significantly reduce memory usage and increase speed. By Oleksandr Huziy.
Support for pathlib.Path objects added to ~xarray.open_dataset, ~xarray.open_mfdataset, xarray.to_netcdf, and ~xarray.save_mfdataset (799):
from pathlib import Path # In Python 2, use pathlib2!
data_dir = Path("data/")
one_file = data_dir / "dta_for_month_01.nc"
xr.open_dataset(one_file)
By Willi Rath.
You can now explicitly disable any default _FillValue (NaN for floating point values) by passing the encoding {'_FillValue': None} (1598). By Stephan Hoyer.
More attributes available in ~xarray.Dataset.attrs dictionary when raster files are opened with ~xarray.open_rasterio. By Greg Brener.
Support for NetCDF files using an _Unsigned attribute to indicate that a a signed integer data type should be interpreted as unsigned bytes (1444). By Eric Bruning.
Support using an existing, opened netCDF4 Dataset with ~xarray.backends.NetCDF4DataStore. This permits creating an ~xarray.Dataset from a netCDF4 Dataset that has been opened using other means (1459). By Ryan May.
Changed ~xarray.backends.PydapDataStore to take a Pydap dataset. This permits opening Opendap datasets that require authentication, by instantiating a Pydap dataset with a session object. Also added xarray.backends.PydapDataStore.open which takes a url and session object (1068). By Philip Graae.
Support reading and writing unlimited dimensions with h5netcdf (1636). By Joe Hamman.
Other improvements
Added _ipython_key_completions_ to xarray objects, to enable autocompletion for dictionary-like access in IPython, e.g., ds['tem + tab -> ds['temperature'] (1628). By Keisuke Fujii.
Support passing keyword arguments to load, compute, and persist methods. Any keyword arguments supplied to these methods are passed on to the corresponding dask function (1523). By Joe Hamman.
Encoding attributes are now preserved when xarray objects are concatenated. The encoding is copied from the first object (1297). By Joe Hamman and Gerrit Holl.
Support applying rolling window operations using bottleneck's moving window functions on data stored as dask arrays (1279). By Joe Hamman.
Experimental support for the Dask collection interface (1674). By Matthew Rocklin.
Suppress RuntimeWarning issued by numpy for "invalid value comparisons" (e.g. NaN). Xarray now behaves similarly to pandas in its treatment of binary and unary operations on objects with NaNs (1657). By Joe Hamman.
Unsigned int support for reduce methods with skipna=True (1562). By Keisuke Fujii.
Fixes to ensure xarray works properly with pandas 0.21:
Fix ~xarray.DataArray.isnull method (1549).
~xarray.DataArray.to_series and ~xarray.Dataset.to_dataframe should not return a pandas.MultiIndex for 1D data (1548).
Fix plotting with datetime64 axis labels (1661).
By Stephan Hoyer.
~xarray.open_rasterio method now shifts the rasterio coordinates so that they are centered in each pixel (1468). By Greg Brener.
~xarray.Dataset.rename method now doesn't throw errors if some Variable is renamed to the same name as another Variable as long as that other Variable is also renamed (1477). This method now does throw when two Variables would end up with the same name after the rename (since one of them would get overwritten in this case). By Prakhar Goel.
Fix xarray.testing.assert_allclose to actually use atol and rtol arguments when called on DataArray objects (1488). By Stephan Hoyer.
xarray quantile methods now properly raise a TypeError when applied to objects with data stored as dask arrays (1529). By Joe Hamman.
Fix positional indexing to allow the use of unsigned integers (1405). By Joe Hamman and Gerrit Holl.
Creating a Dataset now raises MergeError if a coordinate shares a name with a dimension but is comprised of arbitrary dimensions (1120). By Joe Hamman.
~xarray.open_rasterio method now skips rasterio's crs attribute if its value is None (1520). By Leevi Annala.
Fix xarray.DataArray.to_netcdf to return bytes when no path is provided (1410). By Joe Hamman.
Fix xarray.save_mfdataset to properly raise an informative error when objects other than Dataset are provided (1555). By Joe Hamman.
xarray.Dataset.copy would not preserve the encoding property (1586). By Guido Imperiale.
xarray.concat would eagerly load dask variables into memory if the first argument was a numpy variable (1588). By Guido Imperiale.
Fix bug in ~xarray.Dataset.to_netcdf when writing in append mode (1215). By Joe Hamman.
Fix netCDF4 backend to properly roundtrip the shuffle encoding option (1606). By Joe Hamman.
Fix bug when using pytest class decorators to skipping certain unittests. The previous behavior unintentionally causing additional tests to be skipped (1531). By Joe Hamman.
Fix pynio backend for upcoming release of pynio with Python 3 support (1611). By Ben Hillman.
Fix seaborn import warning for Seaborn versions 0.8 and newer when the apionly module was deprecated. (1633). By Joe Hamman.
Fix COMPAT: MultiIndex checking is fragile (1833). By Florian Pinault.
Fix rasterio backend for Rasterio versions 1.0alpha10 and newer. (1641). By Chris Holden.
Suppress warning in IPython autocompletion, related to the deprecation of .T attributes (1675). By Keisuke Fujii.
Fix a bug in lazily-indexing netCDF array. (1688) By Keisuke Fujii.
(Internal bug) MemoryCachedArray now supports the orthogonal indexing. Also made some internal cleanups around array wrappers (1429). By Keisuke Fujii.
(Internal bug) MemoryCachedArray now always wraps np.ndarray by NumpyIndexingAdapter. (1694) By Keisuke Fujii.
Fix importing xarray when running Python with -OO (1706). By Stephan Hoyer.
Saving a netCDF file with a coordinates with a spaces in its names now raises an appropriate warning (1689). By Stephan Hoyer.
Fix two bugs that were preventing dask arrays from being specified as coordinates in the DataArray constructor (1684). By Joe Hamman.
Fixed apply_ufunc with dask='parallelized' for scalar arguments (1697). By Stephan Hoyer.
Fix "Chunksize cannot exceed dimension size" error when writing netCDF4 files loaded from disk (1225). By Stephan Hoyer.
Validate the shape of coordinates with names matching dimensions in the DataArray constructor (1709). By Stephan Hoyer.
Raise NotImplementedError when attempting to save a MultiIndex to a netCDF file (1547). By Stephan Hoyer.
Remove netCDF dependency from rasterio backend tests. By Matti Eskelinen
Fixed unexpected behavior in Dataset.set_index() and DataArray.set_index() introduced by pandas 0.21.0. Setting a new index with a single variable resulted in 1-level pandas.MultiIndex instead of a simple pandas.Index (1722). By Benoit Bovy.
Fixed unexpected memory loading of backend arrays after print. (1720). By Keisuke Fujii.
Nothing published for this version
Nothing published for this version
This release includes a number of backwards compatible enhancements and bug fixes.
This release includes a number of backwards compatible enhancements and bug fixes.
Enhancements
Bug fixes
Documentation
Testing
This release includes a number of backwards compatible enhancements and bug fixes.
New ~xarray.Dataset.sortby method to Dataset and DataArray that enable sorting along dimensions (967). See the docs for examples. By Chun-Wei Yuan and Kyle Heuton.
Add .dt accessor to DataArrays for computing datetime-like properties for the values they contain, similar to pandas.Series (358). By Daniel Rothenberg.
Renamed internal dask arrays created by open_dataset to match new dask conventions (1343). By Ryan Abernathey.
~xarray.as_variable is now part of the public API (1303). By Benoit Bovy.
~xarray.align now supports join='exact', which raises an error instead of aligning when indexes to be aligned are not equal. By Stephan Hoyer.
New function ~xarray.open_rasterio for opening raster files with the rasterio library. See the docs for details. By Joe Hamman, Nic Wayand and Fabien Maussion
Fix error from repeated indexing of datasets loaded from disk (1374). By Stephan Hoyer.
Fix a bug where .isel_points wrongly assigns unselected coordinate to data_vars. By Keisuke Fujii.
Tutorial datasets are now checked against a reference MD5 sum to confirm successful download (1392). By Matthew Gidden.
DataArray.chunk() now accepts dask specific kwargs like Dataset.chunk() does. By Fabien Maussion.
Support for engine='pydap' with recent releases of Pydap (3.2.2+), including on Python 3 (1174).
A new gallery allows to add interactive examples to the documentation. By Fabien Maussion.
Fix test suite failure caused by changes to pandas.cut function (1386). By Ryan Abernathey.
Enhanced tests suite by use of @network decorator, which is controlled via --run-network-tests command line argument to py.test (1393). By Matthew Gidden.
Remove an inadvertently introduced print statement.
Remove an inadvertently introduced print statement.
Nothing published for this version
Add .persist() method to Datasets and DataArrays to enable persisting data in distributed memory (GH1344). By Matthew Rocklin.
Enhancements
Bug fixes
This minor release includes bug-fixes and backwards compatible enhancements.
New ~xarray.DataArray.persist method to Datasets and DataArrays to enable persisting data in distributed memory when using Dask (1344). By Matthew Rocklin.
New ~xarray.DataArray.expand_dims method for DataArray and Dataset (1326). By Keisuke Fujii.
Fix .where() with drop=True when arguments do not have indexes (1350). This bug, introduced in v0.9, resulted in xarray producing incorrect results in some cases. By Stephan Hoyer.
Fixed writing to file-like objects with ~xarray.Dataset.to_netcdf (1320). Stephan Hoyer.
Fixed explicitly setting engine='scipy' with to_netcdf when not providing a path (1321). Stephan Hoyer.
Fixed open_dataarray does not pass properly its parameters to open_dataset (1359). Stephan Hoyer.
Ensure test suite works when runs from an installed version of xarray (1336). Use @pytest.mark.slow instead of a custom flag to mark slow tests. By Stephan Hoyer
The minor release includes bug-fixes and backwards compatible enhancements.
The minor release includes bug-fixes and backwards compatible enhancements.
The minor release includes bug-fixes and backwards compatible enhancements.
rolling on Dataset is now supported (859).
.rolling() on Dataset is now supported (859). By Keisuke Fujii.
When bottleneck version 1.1 or later is installed, use bottleneck for rolling var, argmin, argmax, and rank computations. Also, rolling median now accepts a min_periods argument (1276). By Joe Hamman.
When .plot() is called on a 2D DataArray and only one dimension is specified with x= or y=, the other dimension is now guessed (1291). By Vincent Noel.
Added new method ~Dataset.assign_attrs to DataArray and Dataset, a chained-method compatible implementation of the dict.update method on attrs (1281). By Henry S. Harrison.
Added new autoclose=True argument to ~xarray.open_mfdataset to explicitly close opened files when not in use to prevent occurrence of an OS Error related to too many open files (1198). Note, the default is autoclose=False, which is consistent with previous xarray behavior. By Phillip J. Wolfram.
The repr() of Dataset and DataArray attributes uses a similar format to coordinates and variables, with vertically aligned entries truncated to fit on a single line (1319). Hopefully this will stop people writing data.attrs = {} and discarding metadata in notebooks for the sake of cleaner output. The full metadata is still available as data.attrs. By Zac Hatfield-Dodds.
Enhanced tests suite by use of @slow and @flaky decorators, which are controlled via --run-flaky and --skip-slow command line arguments to py.test (1336). By Stephan Hoyer and Phillip J. Wolfram.
New aggregation on rolling objects ~computation.rolling.DataArrayRolling.count which providing a rolling count of valid values (1138).
Rolling operations now keep preserve original dimension order (1125). By Keisuke Fujii.
Fixed sel with method='nearest' on Python 2.7 and 64-bit Windows (1140). Stephan Hoyer.
Fixed where with drop='True' for empty masks (1341). By Stephan Hoyer and Phillip J. Wolfram.
Renamed the "Unindexed dimensions" section in the Dataset and DataArray repr (added in v0.9.0) to "Dimensions without coordinates".
Renamed the "Unindexed dimensions" section in the Dataset and DataArray repr (added in v0.9.0) to "Dimensions without coordinates".
Renamed the "Unindexed dimensions" section in the Dataset and DataArray repr (added in v0.9.0) to "Dimensions without coordinates" (1199).
This major release includes five months worth of enhancements and bug fixes from 24 contributors, including some significant changes that are not full
This major release includes five months worth of enhancements and bug fixes from 24 contributors, including some significant changes that are not fully backwards compatible. Highlights include:
For more details, see what's new.
This major release includes five months worth of enhancements and bug fixes from 24 contributors, including some significant changes that are not fully backwards compatible. Highlights include:
Coordinates are now optional in the xarray data model, even for dimensions.
Changes to caching, lazy loading and pickling to improve xarray's experience for parallel computing.
Improvements for accessing and manipulating pandas.MultiIndex levels.
Many new methods and functions, including ~DataArray.quantile, ~DataArray.cumsum, ~DataArray.cumprod ~DataArray.combine_first ~DataArray.set_index, ~DataArray.reset_index, ~DataArray.reorder_levels, ~xarray.full_like, ~xarray.zeros_like, ~xarray.ones_like ~xarray.open_dataarray, ~DataArray.compute, Dataset.info, testing.assert_equal, testing.assert_identical, and testing.assert_allclose.
Index coordinates for each dimensions are now optional, and no longer created by default 1017. You can identify such dimensions without coordinates by their appearance in list of "Dimensions without coordinates" in the Dataset or DataArray repr:
xr.Dataset({"foo": (("x", "y"), [[1, 2]])})
<xarray.Dataset>
Dimensions: (x: 1, y: 2)
Dimensions without coordinates: x, y
Data variables:
foo (x, y) int64 1 2
This has a number of implications:
~align and ~Dataset.reindex can now error, if dimensions labels are missing and dimensions have different sizes.
Because pandas does not support missing indexes, methods such as to_dataframe/from_dataframe and stack/unstack no longer roundtrip faithfully on all inputs. Use ~Dataset.reset_index to remove undesired indexes.
Dataset.__delitem__ and ~Dataset.drop no longer delete/drop variables that have dimensions matching a deleted/dropped variable.
DataArray.coords.__delitem__ is now allowed on variables matching dimension names.
.sel and .loc now handle indexing along a dimension without coordinate labels by doing integer based indexing. See indexing.missing_coordinates for an example.
~Dataset.indexes is no longer guaranteed to include all dimensions names as keys. The new method ~Dataset.get_index has been added to get an index for a dimension guaranteed, falling back to produce a default RangeIndex if necessary.
The default behavior of merge is now compat='no_conflicts', so some merges will now succeed in cases that previously raised xarray.MergeError. Set compat='broadcast_equals' to restore the previous default. See combining.no_conflicts for more details.
Reading ~DataArray.values no longer always caches values in a NumPy array 1128. Caching of .values on variables read from netCDF files on disk is still the default when open_dataset is called with cache=True. By Guido Imperiale and Stephan Hoyer.
Pickling a Dataset or DataArray linked to a file on disk no longer caches its values into memory before pickling (1128). Instead, pickle stores file paths and restores objects by reopening file references. This enables preliminary, experimental use of xarray for opening files with dask.distributed. By Stephan Hoyer.
Coordinates used to index a dimension are now loaded eagerly into pandas.Index objects, instead of loading the values lazily. By Guido Imperiale.
Automatic levels for 2d plots are now guaranteed to land on vmin and vmax when these kwargs are explicitly provided (1191). The automated level selection logic also slightly changed. By Fabien Maussion.
DataArray.rename() behavior changed to strictly change the DataArray.name if called with string argument, or strictly change coordinate names if called with dict-like argument. By Markus Gonser.
By default to_netcdf() add a _FillValue = NaN attributes to float types. By Frederic Laliberte.
repr on DataArray objects uses an shortened display for NumPy array data that is less likely to overflow onto multiple pages (1207). By Stephan Hoyer.
xarray no longer supports python 3.3, versions of dask prior to v0.9.0, or versions of bottleneck prior to v1.0.
Renamed the Coordinate class from xarray's low level API to ~xarray.IndexVariable. Variable.to_variable and Variable.to_coord have been renamed to ~xarray.Variable.to_base_variable and ~xarray.Variable.to_index_variable.
Deprecated supplying coords as a dictionary to the DataArray constructor without also supplying an explicit dims argument. The old behavior encouraged relying on the iteration order of dictionaries, which is a bad practice (727).
Removed a number of methods deprecated since v0.7.0 or earlier: load_data, vars, drop_vars, dump, dumps and the variables keyword argument to Dataset.
Removed the dummy module that enabled import xray.
Added new method ~DataArray.combine_first to DataArray and Dataset, based on the pandas method of the same name (see combine). By Chun-Wei Yuan.
Added the ability to change default automatic alignment (arithmetic_join="inner") for binary operations via ~xarray.set_options() (see math-automatic-alignment). By Chun-Wei Yuan.
Add checking of attr names and values when saving to netCDF, raising useful error messages if they are invalid. (911). By Robin Wilson.
Added ability to save DataArray objects directly to netCDF files using ~xarray.DataArray.to_netcdf, and to load directly from netCDF files using ~xarray.open_dataarray (915). These remove the need to convert a DataArray to a Dataset before saving as a netCDF file, and deals with names to ensure a perfect 'roundtrip' capability. By Robin Wilson.
Multi-index levels are now accessible as "virtual" coordinate variables, e.g., ds['time'] can pull out the 'time' level of a multi-index (see coordinates). sel also accepts providing multi-index levels as keyword arguments, e.g., ds.sel(time='2000-01') (see multi-level-indexing). By Benoit Bovy.
Added set_index, reset_index and reorder_levels methods to easily create and manipulate (multi-)indexes (see reshape.set_index). By Benoit Bovy.
Added the compat option 'no_conflicts' to merge, allowing the combination of xarray objects with disjoint (742) or overlapping (835) coordinates as long as all present data agrees. By Johnnie Gray. See combining.no_conflicts for more details.
It is now possible to set concat_dim=None explicitly in ~xarray.open_mfdataset to disable inferring a dimension along which to concatenate. By Stephan Hoyer.
Added methods DataArray.compute, Dataset.compute, and Variable.compute as a non-mutating alternative to ~DataArray.load. By Guido Imperiale.
Adds DataArray and Dataset methods ~xarray.DataArray.cumsum and ~xarray.DataArray.cumprod. By Phillip J. Wolfram.
New properties Dataset.sizes and DataArray.sizes for providing consistent access to dimension length on both Dataset and DataArray (921). By Stephan Hoyer.
New keyword argument drop=True for ~DataArray.sel, ~DataArray.isel and ~DataArray.squeeze for dropping scalar coordinates that arise from indexing. DataArray (242). By Stephan Hoyer.
New top-level functions ~xarray.full_like, ~xarray.zeros_like, and ~xarray.ones_like By Guido Imperiale.
Overriding a preexisting attribute with ~xarray.register_dataset_accessor or ~xarray.register_dataarray_accessor now issues a warning instead of raising an error (1082). By Stephan Hoyer.
Options for axes sharing between subplots are exposed to ~xarray.plot.FacetGrid and ~xarray.plot.plot, so axes sharing can be disabled for polar plots. By Bas Hoonhout.
New utility functions ~xarray.testing.assert_equal, ~xarray.testing.assert_identical, and ~xarray.testing.assert_allclose for asserting relationships between xarray objects, designed for use in a pytest test suite.
figsize, size and aspect plot arguments are now supported for all plots (897). See plotting-figsize for more details. By Stephan Hoyer and Fabien Maussion.
New ~Dataset.info method to summarize Dataset variables and attributes. The method prints to a buffer (e.g. stdout) with output similar to what the command line utility ncdump -h produces (1150). By Joe Hamman.
Added the ability write unlimited netCDF dimensions with the scipy and netcdf4 backends via the new xray.Dataset.encoding attribute or via the unlimited_dims argument to xray.Dataset.to_netcdf. By Joe Hamman.
New ~DataArray.quantile method to calculate quantiles from DataArray objects (1187). By Joe Hamman.
groupby_bins now restores empty bins by default (1019). By Ryan Abernathey.
Fix issues for dates outside the valid range of pandas timestamps (975). By Mathias Hauser.
Unstacking produced flipped array after stacking decreasing coordinate values (980). By Stephan Hoyer.
Setting dtype via the encoding parameter of to_netcdf failed if the encoded dtype was the same as the dtype of the original array (873). By Stephan Hoyer.
Fix issues with variables where both attributes _FillValue and missing_value are set to NaN (997). By Marco Zühlke.
.where() and .fillna() now preserve attributes (1009). By Fabien Maussion.
Applying broadcast() to an xarray object based on the dask backend won't accidentally convert the array from dask to numpy anymore (978). By Guido Imperiale.
Dataset.concat() now preserves variables order (1027). By Fabien Maussion.
Fixed an issue with pcolormesh (781). A new infer_intervals keyword gives control on whether the cell intervals should be computed or not. By Fabien Maussion.
Grouping over an dimension with non-unique values with groupby gives correct groups. By Stephan Hoyer.
Fixed accessing coordinate variables with non-string names from .coords. By Stephan Hoyer.
~xarray.DataArray.rename now simultaneously renames the array and any coordinate with the same name, when supplied via a dict (1116). By Yves Delley.
Fixed sub-optimal performance in certain operations with object arrays (1121). By Yves Delley.
Fix .groupby(group) when group has datetime dtype (1132). By Jonas Sølvsteen.
Fixed a bug with facetgrid (the norm keyword was ignored, 1159). By Fabien Maussion.
Resolved a concurrency bug that could cause Python to crash when simultaneously reading and writing netCDF4 files with dask (1172). By Stephan Hoyer.
Fix to make .copy() actually copy dask arrays, which will be relevant for future releases of dask in which dask arrays will be mutable (1180). By Stephan Hoyer.
Fix opening NetCDF files with multi-dimensional time variables (1229). By Stephan Hoyer.
xarray.Dataset.isel_points and xarray.Dataset.sel_points now use vectorised indexing in numpy and dask (1161), which can result in several orders of magnitude speedup. By Jonathan Chambers.
Nothing published for this version
This release includes a number of bug fixes and minor enhancements.
This release includes a number of bug fixes and minor enhancements.
This release includes a number of bug fixes and minor enhancements.
~xarray.broadcast and ~xarray.concat now auto-align inputs, using join=outer. Previously, these functions raised ValueError for non-aligned inputs. By Guido Imperiale.
New documentation on panel-transition. By Maximilian Roos.
New Dataset and DataArray methods ~xarray.Dataset.to_dict and ~xarray.Dataset.from_dict to allow easy conversion between dictionaries and xarray objects (432). See dictionary IO for more details. By Julia Signell.
Added exclude and indexes optional parameters to ~xarray.align, and exclude optional parameter to ~xarray.broadcast. By Guido Imperiale.
Better error message when assigning variables without dimensions (971). By Stephan Hoyer.
Better error message when reindex/align fails due to duplicate index values (956). By Stephan Hoyer.
Ensure xarray works with h5netcdf v0.3.0 for arrays with dtype=str (953). By Stephan Hoyer.
Dataset.__dir__() (i.e. the method python calls to get autocomplete options) failed if one of the dataset's keys was not a string (852). By Maximilian Roos.
Dataset constructor can now take arbitrary objects as values (647). By Maximilian Roos.
Clarified copy argument for ~xarray.DataArray.reindex and ~xarray.align, which now consistently always return new xarray objects (927).
Fix open_mfdataset with engine='pynio' (936). By Stephan Hoyer.
groupby_bins sorted bin labels as strings (952). By Stephan Hoyer.
Fix bug introduced by v0.8.0 that broke assignment to datasets when both the left and right side have the same non-unique index values (956).
Fix bug in v0.8.0 that broke assignment to Datasets with non-unique indexes (#943). By Stephan Hoyer.
Fix bug in v0.8.0 that broke assignment to Datasets with non-unique indexes (943). By Stephan Hoyer.
This release includes new features and bug fixes, including several breaking changes.
This release includes new features and bug fixes, including several breaking changes.
DataArray.values and .data now always returns an NumPy array-like object, even for 0-dimensional arrays with object dtype (#867). Previously, .values returned native Python objects in such cases. To convert the values of scalar arrays to Python objects, use the .item() method.xarray.Dataset.groupby_bins has also been added to allow users to specify bins for grouping. The new features are described in groupby.multidim and examples.multidim. By Ryan Abernathey.where now supports a drop=True option that clips coordinate elements that are fully masked. By Phillip J. Wolfram.merge function allows for combining variables from any number of Dataset and/or DataArray variables. See merge for more details. By Stephan Hoyer.resample now supports the keep_attrs=False option that determines whether variable and dataset attributes are retained in the resampled object. By Jeremy McGibbon.sel and loc methods, which now behave more closely to pandas and which also accept dictionaries for indexing based on given level names and labels (see multi-level indexing). By Benoit Bovy.xarray.register_dataset_accessor and xarray.register_dataarray_accessor for registering custom xarray extensions without subclassing. They are described in the new documentation page on internals. By Stephan Hoyer.bool datatype. This feature reads/writes a dtype attribute to boolean variables in netCDF files. By Joe Hamman.cbar_ax and cbar_kwargs), allowing more control on the colorbar (#872). By Fabien Maussion.filter_by_attrs, akin to netCDF4.Dataset.get_variables_by_attributes, to easily filter data variables using its attributes. Filipe Fernandes.keep_attrs=False option, they will no longer be retained by default. This may be backwards-incompatible with some scripts, but the attributes may be kept by adding the keep_attrs=True option. By Jeremy McGibbon.decode_cf_timedelta now accepts arrays with ndim >1 (#842). This fixes issue #665. Filipe Fernandes.xarray.ufuncs that take two arguments would incorrectly use to numpy functions instead of dask.array functions (#876). By Stephan Hoyer.xarray.ufuncs (#901). By Stephan Hoyer.Variable.copy(deep=True) no longer converts MultiIndex into a base Index (#769). By Benoit Bovy.dim argument for isel_points/sel_points when a pandas.Index is passed. By Stephan Hoyer.xarray.plot.contour now plots the correct number of contours (#866). By Fabien Maussion.Nothing published for this version
This release includes two new, entirely backwards compatible features and several bug fixes.
This release includes two new, entirely backwards compatible features and several bug fixes.
New DataArray method DataArray.dot for calculating the dot product of two DataArrays along shared dimensions. By Dean Pospisil.
Rolling window operations on DataArray objects are now supported via a new DataArray.rolling method. For example:
import xarray as xr
import numpy as np
arr = xr.DataArray(np.arange(0, 7.5, 0.5).reshape(3, 5), dims=("x", "y"))
arr
<xarray.DataArray (x: 3, y: 5)>
array([[ 0. , 0.5, 1. , 1.5, 2. ],
[ 2.5, 3. , 3.5, 4. , 4.5],
[ 5. , 5.5, 6. , 6.5, 7. ]])
Coordinates:
* x (x) int64 0 1 2
* y (y) int64 0 1 2 3 4
arr.rolling(y=3, min_periods=2).mean()
<xarray.DataArray (x: 3, y: 5)>
array([[ nan, 0.25, 0.5 , 1. , 1.5 ],
[ nan, 2.75, 3. , 3.5 , 4. ],
[ nan, 5.25, 5.5 , 6. , 6.5 ]])
Coordinates:
* x (x) int64 0 1 2
* y (y) int64 0 1 2 3 4
See compute.rolling for more details. By Joe Hamman.
Fixed an issue where plots using pcolormesh and Cartopy axes were being distorted by the inference of the axis interval breaks. This change chooses not to modify the coordinate variables when the axes have the attribute projection, allowing Cartopy to handle the extent of pcolormesh plots (781). By Joe Hamman.
2D plots now better handle additional coordinates which are not DataArray dimensions (788). By Fabien Maussion.
This is a bug fix release that includes two small, backwards compatible enhancements. We recommend that all users upgrade.
This is a bug fix release that includes two small, backwards compatible enhancements. We recommend that all users upgrade.
Numerical operations now return empty objects on no overlapping labels rather than raising ValueError (739).
~pandas.Series is now supported as valid input to the Dataset constructor (740).
Restore checks for shape consistency between data and coordinates in the DataArray constructor (758).
Single dimension variables no longer transpose as part of a broader .transpose. This behavior was causing pandas.PeriodIndex dimensions to lose their type (749)
~xarray.Dataset labels remain as their native type on .to_dataset. Previously they were coerced to strings (745)
Fixed a bug where replacing a DataArray index coordinate would improperly align the coordinate (725).
DataArray.reindex_like now maintains the dtype of complex numbers when reindexing leads to NaN values (738).
Dataset.rename and DataArray.rename support the old and new names being the same (724).
Fix ~xarray.Dataset.from_dataframe for DataFrames with Categorical column and a MultiIndex index (737).
Fixes to ensure xarray works properly after the upcoming pandas v0.18 and NumPy v1.11 releases.
The following individuals contributed to this release:
Edward Richards
Maximilian Roos
Rafael Guedes
Spencer Hill
Stephan Hoyer
Breaking changes ~~~~~~~~~~~~~~~~
This major release includes redesign of ~xarray.DataArray internals, as well as new methods for reshaping, rolling and shifting data. It includes preliminary support for pandas.MultiIndex, as well as a number of other features and bug fixes, several of which offer improved compatibility with pandas.
The project formerly known as "xray" is now "xarray", pronounced "x-array"! This avoids a namespace conflict with the entire field of x-ray science. Renaming our project seemed like the right thing to do, especially because some scientists who work with actual x-rays are interested in using this project in their work. Thanks for your understanding and patience in this transition. You can now find our documentation and code repository at new URLs:
To ease the transition, we have simultaneously released v0.7.0 of both xray and xarray on the Python Package Index. These packages are identical. For now, import xray still works, except it issues a deprecation warning. This will be the last xray release. Going forward, we recommend switching your import statements to import xarray as xr.
The internal data model used by xray.DataArray has been rewritten to fix several outstanding issues (367, 634, this stackoverflow report). Internally, DataArray is now implemented in terms of ._variable and ._coords attributes instead of holding variables in a Dataset object.
This refactor ensures that if a DataArray has the same name as one of its coordinates, the array and the coordinate no longer share the same data.
In practice, this means that creating a DataArray with the same name as one of its dimensions no longer automatically uses that array to label the corresponding coordinate. You will now need to provide coordinate labels explicitly. Here's the old behavior:
xray.DataArray([4, 5, 6], dims="x", name="x")
<xray.DataArray 'x' (x: 3)>
array([4, 5, 6])
Coordinates:
* x (x) int64 4 5 6
and the new behavior (compare the values of the x coordinate):
xray.DataArray([4, 5, 6], dims="x", name="x")
<xray.DataArray 'x' (x: 3)>
array([4, 5, 6])
Coordinates:
* x (x) int64 0 1 2
It is no longer possible to convert a DataArray to a Dataset with xray.DataArray.to_dataset if it is unnamed. This will now raise ValueError. If the array is unnamed, you need to supply the name argument.
Basic support for ~pandas.MultiIndex coordinates on xray objects, including indexing, ~DataArray.stack and ~DataArray.unstack:
df = pd.DataFrame({"foo": range(3), "x": ["a", "b", "b"], "y": [0, 0, 1]})
s = df.set_index(["x", "y"])["foo"]
arr = xray.DataArray(s, dims="z")
arr
<xray.DataArray 'foo' (z: 3)>
array([0, 1, 2])
Coordinates:
* z (z) object ('a', 0) ('b', 0) ('b', 1)
arr.indexes["z"]
MultiIndex(levels=[[u'a', u'b'], [0, 1]],
labels=[[0, 1, 1], [0, 0, 1]],
names=[u'x', u'y'])
arr.unstack("z")
<xray.DataArray 'foo' (x: 2, y: 2)>
array([[ 0., nan],
[ 1., 2.]])
Coordinates:
* x (x) object 'a' 'b'
* y (y) int64 0 1
arr.unstack("z").stack(z=("x", "y"))
<xray.DataArray 'foo' (z: 4)>
array([ 0., nan, 1., 2.])
Coordinates:
* z (z) object ('a', 0) ('a', 1) ('b', 0) ('b', 1)
See reshape.stack for more details.
Warning
xray's MultiIndex support is still experimental, and we have a long to- do list of desired additions (719), including better display of multi-index levels when printing a Dataset, and support for saving datasets with a MultiIndex to a netCDF file. User contributions in this area would be greatly appreciated.
Support for reading GRIB, HDF4 and other file formats via PyNIO.
Better error message when a variable is supplied with the same name as one of its dimensions.
Plotting: more control on colormap parameters (642). vmin and vmax will not be silently ignored anymore. Setting center=False prevents automatic selection of a divergent colormap.
New xray.Dataset.shift and xray.Dataset.roll methods for shifting/rotating datasets or arrays along a dimension:
array = xray.DataArray([5, 6, 7, 8], dims="x")
array.shift(x=2)
array.roll(x=2)
Notice that shift moves data independently of coordinates, but roll moves both data and coordinates.
Assigning a pandas object directly as a Dataset variable is now permitted. Its index names correspond to the dims of the Dataset, and its data is aligned.
Passing a pandas.DataFrame or pandas.Panel to a Dataset constructor is now permitted.
New function xray.broadcast for explicitly broadcasting DataArray and Dataset objects against each other. For example:
a = xray.DataArray([1, 2, 3], dims="x")
b = xray.DataArray([5, 6], dims="y")
a
b
a2, b2 = xray.broadcast(a, b)
a2
b2
Fixes for several issues found on DataArray objects with the same name as one of their coordinates (see v0.7.0.breaking for more details).
DataArray.to_masked_array always returns masked array with mask being an array (not a scalar value) (684)
Allows for (imperfect) repr of Coords when underlying index is PeriodIndex (645).
Fixes for several issues found on DataArray objects with the same name as one of their coordinates (see v0.7.0.breaking for more details).
Attempting to assign a Dataset or DataArray variable/attribute using attribute-style syntax (e.g., ds.foo = 42) now raises an error rather than silently failing (656, 714).
You can now pass pandas objects with non-numpy dtypes (e.g., categorical or datetime64 with a timezone) into xray without an error (716).
The following individuals contributed to this release:
Antony Lee
Fabien Maussion
Joe Hamman
Maximilian Roos
Stephan Hoyer
Takeshi Kanmae
femtotrader
Your coding agent can read these notes before it upgrades. Set up the MCP server →