Releases: pydata/xarray
Releases · pydata/xarray
v0.9.6
This release includes a number of backwards compatible enhancements and bug fixes.
Enhancements
- New sortby() method to Dataset and DataArray that enable sorting along dimensions (GH967). 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 (GH358). By Daniel Rothenberg.
- Renamed internal dask arrays created by open_dataset to match new dask conventions (GH1343). By Ryan Abernathey.
- as_variable() is now part of the public API (GH1303). By Benoit Bovy.
- 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 open_rasterio() for opening raster files with the rasterio library. See the docs for details. By Joe Hamman, Nic Wayand and Fabien Maussion
Bug fixes
- Fix error from repeated indexing of datasets loaded from disk (GH1374). 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 (GH1392). 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 (GH1174).
Documentation
- A new gallery allows to add interactive examples to the documentation. By Fabien Maussion.
Testing
- Fix test suite failure caused by changes to pandas.cut function (GH1386). By Ryan Abernathey.
- Enhanced tests suite by use of @network decorator, which is controlled via --run-network-tests command line argument to py.test (GH1393). By Matthew Gidden.
v0.9.5
v0.9.3
Enhancements
- Add .persist() method to Datasets and DataArrays to enable persisting data in distributed memory (GH1344). By Matthew Rocklin.
- New expand_dims() method for DataArray and Dataset (GH1326). By Keisuke Fujii.
Bug fixes
- Fix .where() with drop=True when arguments do not have indexes (GH1350). 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 to_netcdf() (GH1320). Stephan Hoyer.
- Fixed explicitly setting engine='scipy' with to_netcdf when not providing a path (GH1321). Stephan Hoyer.
- Fixed open_dataarray does not pass properly its parameters to open_dataset (GH1359). Stephan Hoyer.
- Ensure test suite works when runs from an installed version of xarray (GH1336). Use @pytest.mark.slow instead of a custom flag to mark slow tests. By Stephan Hoyer
v0.9.2
The minor release includes bug-fixes and backwards compatible enhancements.
Enhancements
- .rolling() on Dataset is now supported (GH859). 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 (GH1276). 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 (GH1291). By Vincent Noel.
- Added new method assign_attrs() to DataArray and Dataset, a chained-method compatible implementation of the dict.update method on attrs (GH1281). By Henry S. Harrison.
- Added new autoclose=True argument to open_mfdataset() to explicitly close opened files when not in use to prevent occurrence of an OS Error related to too many open files (GH1198). 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 (GH1319). 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 (GH1336). By Stephan Hoyer and Phillip J. Wolfram.
Bug fixes
- Rolling operations now keep preserve original dimension order (GH1125). By Keisuke Fujii.
- Fixed sel with method='nearest' on Python 2.7 and 64-bit Windows (GH1140). Stephan Hoyer.
- Fixed where with drop='True' for empty masks (GH1341). By Stephan Hoyer and Phillip J. Wolfram.
v0.9.1
v0.9.0
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 quantile(), cumsum(), cumprod() combine_first set_index(), reset_index(), reorder_levels(), full_like(), zeros_like(), ones_like() open_dataarray(), compute(), Dataset.info(), testing.assert_equal(), testing.assert_identical(), and testing.assert_allclose().
For more details, see what's new.
v0.9.0rc1
v0.8.2
This release includes a number of bug fixes and minor enhancements.
Breaking changes
- broadcast() and concat() now auto-align inputs, using join=outer. Previously, these functions raised ValueError for non-aligned inputs. By Guido Imperiale.
Enhancements
- New documentation on Transitioning from pandas.Panel to xarray. By Maximilian Roos.
- New Dataset and DataArray methods to_dict() and 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 align(), and exclude optional parameter to 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.
Bug fixes
- 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 reindex() and 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).
v0.8.1
v0.8.0
v0.8.0 (2 August 2016)
This release includes new features and bug fixes, including several breaking changes.
Breaking changes
- Dropped support for Python 2.6 (#855).
- Indexing on multi-index now drop levels, which is consistent with pandas. It also changes the name of the dimension / coordinate when the multi-index is reduced to a single index (#802).
- Contour plots no longer add a colorbar per default (#866). Filled contour plots are unchanged.
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.
Enhancements
- Groupby operations now support grouping over multidimensional variables. A new method called
xarray.Dataset.groupby_bins
has also been added to allow users to specify bins for grouping. The new features are described ingroupby.multidim
andexamples.multidim
. By Ryan Abernathey. - DataArray and Dataset method
where
now supports adrop=True
option that clips coordinate elements that are fully masked. By Phillip J. Wolfram. - New top level
merge
function allows for combining variables from any number ofDataset
and/orDataArray
variables. Seemerge
for more details. By Stephan Hoyer. - DataArray and Dataset method
resample
now supports thekeep_attrs=False
option that determines whether variable and dataset attributes are retained in the resampled object. By Jeremy McGibbon. - Better multi-index support in DataArray and Dataset
sel
andloc
methods, which now behave more closely to pandas and which also accept dictionaries for indexing based on given level names and labels (seemulti-level indexing
). By Benoit Bovy. - New (experimental) decorators
xarray.register_dataset_accessor
andxarray.register_dataarray_accessor
for registering custom xarray extensions without subclassing. They are described in the new documentation page oninternals
. By Stephan Hoyer. - Round trip boolean datatypes. Previously, writing boolean datatypes to netCDF formats would raise an error since netCDF does not have a
bool
datatype. This feature reads/writes adtype
attribute to boolean variables in netCDF files. By Joe Hamman. - 2D plotting methods now have two new keywords (
cbar_ax
andcbar_kwargs
), allowing more control on the colorbar (#872). By Fabien Maussion. - New Dataset method
filter_by_attrs
, akin tonetCDF4.Dataset.get_variables_by_attributes
, to easily filter data variables using its attributes. Filipe Fernandes.
Bug fixes
- Attributes were being retained by default for some resampling operations when they should not. With the
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 thekeep_attrs=True
option. By Jeremy McGibbon. - Concatenating xarray objects along an axis with a MultiIndex or PeriodIndex preserves the nature of the index (#875). By Stephan Hoyer.
- Fixed bug in arithmetic operations on DataArray objects whose dimensions are numpy structured arrays or recarrays #861, #837. By Maciek Swat.
decode_cf_timedelta
now accepts arrays withndim
>1 (#842). This fixes issue #665. Filipe Fernandes.- Fix a bug where
xarray.ufuncs
that take two arguments would incorrectly use to numpy functions instead of dask.array functions (#876). By Stephan Hoyer. - Support for pickling functions from
xarray.ufuncs
(#901). By Stephan Hoyer. Variable.copy(deep=True)
no longer converts MultiIndex into a base Index (#769). By Benoit Bovy.- Fixes for groupby on dimensions with a multi-index (#867). By Stephan Hoyer.
- Fix printing datasets with unicode attributes on Python 2 (#892). By Stephan Hoyer.
- Fixed incorrect test for dask version (#891). By Stephan Hoyer.
- Fixed
dim
argument forisel_points
/sel_points
when apandas.Index
is passed. By Stephan Hoyer. xarray.plot.contour
now plots the correct number of contours (#866). By Fabien Maussion.