Upgrading xarray 0.8 to 0.9
Breaking0.8.2 → 0.9.6Breaking1New12Changed7Fixed12Other5
BreakingUpgrade verdict
1 breaking change.
In plain terms
- You no longer have to attach coordinate labels to every dimension of your data.
Must act 1 item needs code or config changes
What you must change
Breaking1
Coordinates are now optional in the xarray data model, even for dimensions.
API changes
Generated by DepDelta from published Python source. Not mixed with prose notes.
- added:
export IndexVariable - added:
export as_variable - added:
export full_like - added:
export ones_like - added:
export open_dataarray - added:
export open_rasterio - added:
export testing - added:
export ufuncs - added:
export zeros_like
- changed:
function open_dataset(filename_or_obj, group=…, decode_cf=…, mask_and_scale=…, decode_times=…, concat_characters=…, decode_coords=…, engine=…, chunks=…, lock=…, drop_variables=…) → function open_dataset(filename_or_obj, group=…, decode_cf=…, mask_and_scale=…, decode_times=…, autoclose=…, concat_characters=…, decode_coords=…, engine=…, chunks=…, lock=…, cache=…, drop_variables=…) - changed:
function open_mfdataset(paths, chunks=…, concat_dim=…, preprocess=…, engine=…, lock=…, **kwargs) → function open_mfdataset(paths, chunks=…, concat_dim=…, compat=…, preprocess=…, engine=…, lock=…, **kwargs) - changed:
function to_netcdf(dataset, path=…, mode=…, format=…, group=…, engine=…, writer=…, encoding=…) → function to_netcdf(dataset, path_or_file=…, mode=…, format=…, group=…, engine=…, writer=…, encoding=…, unlimited_dims=…) - added:
function open_dataarray(*args, **kwargs) - added:
variable DATAARRAY_NAME - added:
variable DATAARRAY_VARIABLE
- removed:
function is_trivial_index(var) - changed:
method AbstractWritableDataStore.set_necessary_dimensions(variable) → method AbstractWritableDataStore.set_necessary_dimensions(variable, unlimited_dims=…) - changed:
method AbstractWritableDataStore.set_variables(variables, check_encoding_set) → method AbstractWritableDataStore.set_variables(variables, check_encoding_set, unlimited_dims=…) - changed:
method AbstractWritableDataStore.store(variables, attributes, check_encoding_set=…) → method AbstractWritableDataStore.store(variables, attributes, check_encoding_set=…, unlimited_dims=…) - changed:
method WritableCFDataStore.store(variables, attributes, check_encoding_set=…) → method WritableCFDataStore.store(variables, attributes, *args, **kwargs) - added:
class DataStorePickleMixin(object) - added:
function find_root(ds) - added:
method AbstractDataStore.get_encoding() - added:
method DataStorePickleMixin.assert_open() - added:
method DataStorePickleMixin.ensure_open(autoclose) - added:
variable GLOBAL_LOCK
- changed:
class H5NetCDFStore(WritableCFDataStore) → class H5NetCDFStore(WritableCFDataStore, DataStorePickleMixin) - changed:
constructor H5NetCDFStore(filename, mode=…, format=…, group=…, writer=…) → constructor H5NetCDFStore(filename, mode=…, format=…, group=…, writer=…, autoclose=…) - changed:
method H5NetCDFStore.open_store_variable(var) → method H5NetCDFStore.open_store_variable(name, var) - changed:
method H5NetCDFStore.prepare_variable(name, variable, check_encoding=…) → method H5NetCDFStore.prepare_variable(name, variable, check_encoding=…, unlimited_dims=…) - added:
class H5NetCDFArrayWrapper(BaseNetCDF4Array)
- changed:
method InMemoryDataStore.prepare_variable(k, v, check_encoding=…) → method InMemoryDataStore.prepare_variable(k, v, *args, **kwargs)
- removed:
constructor NetCDF4ArrayWrapper(array, is_remote=…) - removed:
property BaseNetCDF4Array.dtype - changed:
class BaseNetCDF4Array(NDArrayMixin) → class BaseNetCDF4Array(NdimSizeLenMixin, DunderArrayMixin) - changed:
class NetCDF4DataStore(WritableCFDataStore) → class NetCDF4DataStore(WritableCFDataStore, DataStorePickleMixin) - changed:
constructor BaseNetCDF4Array(array, is_remote=…) → constructor BaseNetCDF4Array(variable_name, datastore) - changed:
constructor NetCDF4DataStore(filename, mode=…, format=…, group=…, writer=…, clobber=…, diskless=…, persist=…) → constructor NetCDF4DataStore(filename, mode=…, format=…, group=…, writer=…, clobber=…, diskless=…, persist=…, autoclose=…) - changed:
method NetCDF4DataStore.open_store_variable(var) → method NetCDF4DataStore.open_store_variable(name, var) - changed:
method NetCDF4DataStore.prepare_variable(name, variable, check_encoding=…) → method NetCDF4DataStore.prepare_variable(name, variable, check_encoding=…, unlimited_dims=…) - added:
method BaseNetCDF4Array.get_array() - added:
method NetCDF4DataStore.get_encoding() - added:
method NetCDF4DataStore.set_variables(*args, **kwargs)
- removed:
property NioArrayWrapper.dtype - changed:
class NioArrayWrapper(NDArrayMixin) → class NioArrayWrapper(NdimSizeLenMixin, DunderArrayMixin) - changed:
class NioDataStore(AbstractDataStore) → class NioDataStore(AbstractDataStore, DataStorePickleMixin) - changed:
constructor NioArrayWrapper(array, ds) → constructor NioArrayWrapper(variable_name, datastore) - changed:
constructor NioDataStore(filename, mode=…) → constructor NioDataStore(filename, mode=…, autoclose=…) - changed:
method NioDataStore.open_store_variable(var) → method NioDataStore.open_store_variable(name, var) - added:
method NioArrayWrapper.get_array() - added:
method NioDataStore.get_encoding()
- added:
class RasterioArrayWrapper(NdimSizeLenMixin, DunderArrayMixin) - added:
constructor RasterioArrayWrapper(rasterio_ds) - added:
function open_rasterio(filename, chunks=…, cache=…, lock=…) - added:
property RasterioArrayWrapper.dtype - added:
property RasterioArrayWrapper.shape - added:
variable RASTERIO_LOCK
- removed:
property ScipyArrayWrapper.array - removed:
property ScipyArrayWrapper.dtype - changed:
class ScipyArrayWrapper(NumpyIndexingAdapter) → class ScipyArrayWrapper(NdimSizeLenMixin, DunderArrayMixin) - changed:
class ScipyDataStore(WritableCFDataStore) → class ScipyDataStore(WritableCFDataStore, DataStorePickleMixin) - changed:
constructor ScipyArrayWrapper(netcdf_file, variable_name) → constructor ScipyArrayWrapper(variable_name, datastore) - changed:
constructor ScipyDataStore(filename_or_obj, mode=…, format=…, group=…, writer=…, mmap=…) → constructor ScipyDataStore(filename_or_obj, mode=…, format=…, group=…, writer=…, mmap=…, autoclose=…) - changed:
method ScipyDataStore.prepare_variable(name, variable, check_encoding=…) → method ScipyDataStore.prepare_variable(name, variable, check_encoding=…, unlimited_dims=…) - added:
method ScipyArrayWrapper.get_array() - added:
method ScipyDataStore.get_encoding()
- added:
function maybe_default_fill_value(var)
- added:
class DatetimeAccessor(object) - added:
constructor DatetimeAccessor(xarray_obj) - added:
field DatetimeAccessor.day - added:
field DatetimeAccessor.dayofweek - added:
field DatetimeAccessor.dayofyear - added:
field DatetimeAccessor.days_in_month - added:
field DatetimeAccessor.daysinmonth - added:
field DatetimeAccessor.hour - added:
field DatetimeAccessor.microsecond - added:
field DatetimeAccessor.minute - added:
field DatetimeAccessor.month - added:
field DatetimeAccessor.nanosecond - added:
field DatetimeAccessor.quarter - added:
field DatetimeAccessor.season - added:
field DatetimeAccessor.second - added:
field DatetimeAccessor.time - added:
field DatetimeAccessor.week - added:
field DatetimeAccessor.weekday - added:
field DatetimeAccessor.weekday_name - added:
field DatetimeAccessor.weekofyear - added:
field DatetimeAccessor.year
- changed:
function reindex_variables(variables, indexes, indexers, method=…, tolerance=…, copy=…) → function reindex_variables(variables, sizes, indexes, indexers, method=…, tolerance=…, copy=…) - added:
function deep_align(objects, join=…, copy=…, indexes=…, exclude=…, raise_on_invalid=…) - added:
function reindex_like_indexers(target, other)
- changed:
function auto_combine(datasets, concat_dim=…) → function auto_combine(datasets, concat_dim=…, compat=…)
- removed:
class ImplementsRollingArrayReduce(object) - removed:
function squeeze(xarray_obj, dims, dim=…) - added:
function full_like(other, fill_value, dtype=…) - added:
function get_squeeze_dims(xarray_obj, dim) - added:
function is_datetime_like(dtype) - added:
function ones_like(other, dtype=…) - added:
function zeros_like(other, dtype=…) - added:
method BaseDataObject.assign_attrs(*args, **kwargs) - added:
method BaseDataObject.close() - added:
method BaseDataObject.get_index(key) - added:
method BaseDataObject.squeeze(dim=…, drop=…) - added:
property AbstractArray.sizes
- added:
function apply_array_ufunc(func, *args, **kwargs) - added:
function apply_dataarray_ufunc(func, *args, **kwargs) - added:
function apply_dataset_ufunc(func, *args, **kwargs) - added:
function apply_dict_of_variables_ufunc(func, *args, **kwargs) - added:
function apply_groupby_ufunc(func, *args) - added:
function apply_ufunc(func, *args, **kwargs) - added:
function apply_variable_ufunc(func, *args, **kwargs) - added:
function broadcast_compat_data(variable, broadcast_dims, core_dims) - added:
function build_output_coords(args, signature, exclude_dims=…) - added:
function collect_dict_values(objects, keys, fill_value=…) - added:
function join_dict_keys(objects, how=…) - added:
function ordered_set_intersection(all_keys) - added:
function ordered_set_union(all_keys) - added:
function result_name(objects) - added:
function unified_dim_sizes(variables, exclude_dims=…) - added:
variable SLICE_NONE
- changed:
constructor Indexes(variables, dims) → constructor Indexes(variables, sizes) - added:
class LevelCoordinatesSource(object) - added:
constructor LevelCoordinatesSource(data_object)
- removed:
field DataArray.groupby_cls - removed:
field DataArray.rolling_cls - removed:
method DataArray.load_data() - removed:
method DataArray.squeeze(dim=…) - changed:
method DataArray.chunk(chunks=…) → method DataArray.chunk(chunks=…, name_prefix=…, token=…, lock=…) - changed:
method DataArray.isel(**indexers) → method DataArray.isel(drop=…, **indexers) - changed:
method DataArray.sel(method=…, tolerance=…, **indexers) → method DataArray.sel(method=…, tolerance=…, drop=…, **indexers) - added:
field DataArray.dt - added:
method DataArray.combine_first(other) - added:
method DataArray.compute() - added:
method DataArray.expand_dims(dim, axis=…) - added:
method DataArray.persist() - added:
method DataArray.quantile(q, dim=…, interpolation=…, keep_attrs=…) - added:
method DataArray.reorder_levels(inplace=…, **dim_order) - added:
method DataArray.reset_index(dims_or_levels, drop=…, inplace=…) - added:
method DataArray.set_index(append=…, inplace=…, **indexes) - added:
method DataArray.sortby(variables, ascending=…) - added:
method DataArray.to_netcdf(*args, **kwargs)
- removed:
field Dataset.dump - removed:
field Dataset.dumps - removed:
field Dataset.groupby_cls - removed:
method Dataset.close() - removed:
method Dataset.drop_vars(*names) - removed:
method Dataset.load_data() - removed:
method Dataset.squeeze(dim=…) - removed:
property Dataset.vars - changed:
constructor Dataset(data_vars=…, coords=…, attrs=…, compat=…, **kwargs) → constructor Dataset(data_vars=…, coords=…, attrs=…, compat=…) - changed:
method Dataset.dump_to_store(store, encoder=…, sync=…, encoding=…) → method Dataset.dump_to_store(store, encoder=…, sync=…, encoding=…, unlimited_dims=…) - changed:
method Dataset.isel(**indexers) → method Dataset.isel(drop=…, **indexers) - changed:
method Dataset.sel(method=…, tolerance=…, **indexers) → method Dataset.sel(method=…, tolerance=…, drop=…, **indexers) - changed:
method Dataset.to_netcdf(path=…, mode=…, format=…, group=…, engine=…, encoding=…) → method Dataset.to_netcdf(path=…, mode=…, format=…, group=…, engine=…, encoding=…, unlimited_dims=…) - added:
function merge_indexes(indexes, variables, coord_names, append=…) - added:
function split_indexes(dims_or_levels, variables, coord_names, level_coords, drop=…) - added:
method Dataset.combine_first(other) - added:
method Dataset.compute() - added:
method Dataset.expand_dims(dim, axis=…) - added:
method Dataset.info(buf=…) - added:
method Dataset.persist() - added:
method Dataset.quantile(q, dim=…, interpolation=…, numeric_only=…, keep_attrs=…) - added:
method Dataset.reorder_levels(inplace=…, **dim_order) - added:
method Dataset.reset_index(dims_or_levels, drop=…, inplace=…) - added:
method Dataset.set_index(append=…, inplace=…, **indexes) - added:
method Dataset.sortby(variables, ascending=…) - added:
property DataVariables.variables - added:
property Dataset.encoding - added:
property Dataset.sizes
- added:
function allclose_or_equiv(arr1, arr2, rtol=…, atol=…) - added:
function array_equiv(arr1, arr2) - added:
function array_notnull_equiv(arr1, arr2) - added:
function as_like_arrays(*data) - added:
function asarray(data) - added:
function count(data, axis=…) - added:
function fail_on_dask_array_input(values, msg=…, func_name=…) - added:
function first(values, axis, skipna=…) - added:
function isnull(data) - added:
function last(values, axis, skipna=…) - added:
function where_method(data, cond, other=…) - added:
variable argmax - added:
variable argmin - added:
variable around - added:
variable array_all - added:
variable array_any - added:
variable bn - added:
variable broadcast_to - added:
variable concatenate - added:
variable cumprod - added:
variable cumsum - added:
variable has_bottleneck - added:
variable has_dask - added:
variable insert - added:
variable isclose - added:
variable max - added:
variable mean - added:
variable median - added:
variable min - added:
variable notnull - added:
variable prod - added:
variable stack - added:
variable std - added:
variable sum - added:
variable take - added:
variable tensordot - added:
variable transpose - added:
variable var - added:
variable where
- removed:
class AccessorRegistrationError(Exception) - added:
class AccessorRegistrationWarning(Warning)
- removed:
variable coords_repr - removed:
variable vars_repr - added:
function coords_repr(coords, col_width=…) - added:
function dim_summary(obj) - added:
function last_item(x) - added:
function set_numpy_options(*args, **kwargs) - added:
function short_array_repr(array) - added:
function unindexed_dims_repr(dims, coords) - added:
variable data_vars_repr
- removed:
class LazyIntegerRange(utils.NDArrayMixin) - removed:
constructor LazyIntegerRange(*args, **kwdargs) - removed:
property LazyIntegerRange.dtype - removed:
property LazyIntegerRange.ndim - removed:
property LazyIntegerRange.shape - removed:
property LazyIntegerRange.size - added:
class CopyOnWriteArray(utils.NDArrayMixin) - added:
class MemoryCachedArray(utils.NDArrayMixin) - added:
constructor CopyOnWriteArray(array) - added:
constructor MemoryCachedArray(array) - added:
function get_dim_indexers(data_obj, indexers) - added:
function get_indexer(index, labels, method=…, tolerance=…) - added:
function get_loc(index, label, method=…, tolerance=…)
- removed:
function merge_coords_without_align(objs, priority_vars=…) - changed:
function dataset_merge_method(dataset, other, overwrite_vars=…, compat=…, join=…) → function dataset_merge_method(dataset, other, overwrite_vars, compat, join) - added:
function expand_and_merge_variables(objs, priority_arg=…) - added:
function merge_coords_for_inplace_math(objs, priority_vars=…)
- added:
function nancumprod(a, axis=…, dtype=…, out=…) - added:
function nancumsum(a, axis=…, dtype=…, out=…)
- removed:
function allclose_or_equiv(arr1, arr2, rtol=…, atol=…) - removed:
function array_equiv(arr1, arr2) - removed:
function as_like_arrays(*data) - removed:
function asarray(data) - removed:
function count(data, axis=…) - removed:
function first(values, axis, skipna=…) - removed:
function last(values, axis, skipna=…) - removed:
function prod(values, axis=…, skipna=…, **kwargs) - removed:
function where_method(data, cond, other=…) - removed:
variable argmax - removed:
variable argmin - removed:
variable around - removed:
variable array_all - removed:
variable array_any - removed:
variable broadcast_to - removed:
variable concatenate - removed:
variable has_dask - removed:
variable insert - removed:
variable isclose - removed:
variable isnull - removed:
variable max - removed:
variable mean - removed:
variable median - removed:
variable min - removed:
variable notnull - removed:
variable stack - removed:
variable std - removed:
variable sum - removed:
variable take - removed:
variable tensordot - removed:
variable transpose - removed:
variable var - removed:
variable where - changed:
function fillna(data, other) → function fillna(data, other, join=…, dataset_join=…) - added:
function inject_cum_methods(cls) - added:
function inject_datasetrolling_methods(cls) - added:
variable NAN_CUM_METHODS
- added:
class ExitStack(object) - added:
constructor ExitStack() - added:
method ExitStack.callback(callback, *args, **kwds) - added:
method ExitStack.close() - added:
method ExitStack.enter_context(cm) - added:
method ExitStack.pop_all() - added:
method ExitStack.push(exit) - added:
variable integer_types
- removed:
method Rolling.reduce(func, **kwargs) - removed:
property Rolling.windows - changed:
class DataArrayRolling(Rolling, ImplementsRollingArrayReduce) → class DataArrayRolling(Rolling) - added:
class DatasetRolling(Rolling) - added:
constructor DataArrayRolling(obj, min_periods=…, center=…, **windows) - added:
constructor DatasetRolling(obj, min_periods=…, center=…, **windows) - added:
method DataArrayRolling.reduce(func, **kwargs) - added:
method DatasetRolling.reduce(func, **kwargs) - added:
property DataArrayRolling.windows
- removed:
function class_alias(obj, old_name) - removed:
function function_alias(obj, old_name) - changed:
class NDArrayMixin(NdimSizeLenMixin) → class NDArrayMixin(NdimSizeLenMixin, DunderArrayMixin) - added:
class DunderArrayMixin(object) - added:
function alias(obj, old_name) - added:
function alias_message(old_name, new_name) - added:
function decode_numpy_dict_values(attrs) - added:
function ensure_us_time_resolution(val) - added:
function multiindex_from_product_levels(levels, names=…)
- removed:
class Coordinate(Variable) - removed:
constructor Coordinate(name, data, attrs=…, encoding=…, fastpath=…) - removed:
function default_index_coordinate(dim, size) - removed:
method Coordinate.copy(deep=…) - removed:
method Coordinate.to_coord() - removed:
method Coordinate.to_index() - removed:
method Variable.load_data() - removed:
method Variable.to_coord() - removed:
method Variable.to_variable() - removed:
property Coordinate.name - removed:
static method Coordinate.concat(variables, dim=…, positions=…, shortcut=…) - changed:
function as_variable(obj, name=…, copy=…) → function as_variable(obj, name=…) - changed:
method Variable.broadcast_equals(other) → method Variable.broadcast_equals(other, equiv=…) - changed:
method Variable.equals(other) → method Variable.equals(other, equiv=…) - changed:
method Variable.expand_dims(dims, shape=…) → method Variable.expand_dims(*args) - added:
class IndexVariable(Variable) - added:
constructor IndexVariable(dims, data, attrs=…, encoding=…, fastpath=…) - added:
field IndexVariable.to_coord - added:
field Variable.to_coord - added:
field Variable.to_variable - added:
function assert_unique_multiindex_level_names(variables) - added:
method IndexVariable.chunk(chunks=…, name=…, lock=…) - added:
method IndexVariable.copy(deep=…) - added:
method IndexVariable.data(data) - added:
method IndexVariable.equals(other, equiv=…) - added:
method IndexVariable.get_level_variable(level) - added:
method IndexVariable.load() - added:
method IndexVariable.to_index() - added:
method IndexVariable.to_index_variable() - added:
method Variable.compute() - added:
method Variable.no_conflicts(other) - added:
method Variable.quantile(q, dim=…, interpolation=…) - added:
method Variable.set_dims(dims, shape=…) - added:
method Variable.to_base_variable() - added:
method Variable.to_index_variable() - added:
property IndexVariable.level_names - added:
property IndexVariable.name - added:
static method IndexVariable.concat(variables, dim=…, positions=…, shortcut=…) - added:
variable Coordinate
- changed:
constructor FacetGrid(data, col=…, row=…, col_wrap=…, aspect=…, size=…, subplot_kws=…) → constructor FacetGrid(data, col=…, row=…, col_wrap=…, sharex=…, sharey=…, figsize=…, aspect=…, size=…, subplot_kws=…)
- changed:
function hist(darray, ax=…, **kwargs) → function hist(darray, figsize=…, size=…, aspect=…, ax=…, **kwargs) - changed:
function pcolormesh(x, y, z, ax, **kwargs) → function pcolormesh(x, y, z, ax, infer_intervals=…, **kwargs)
- added:
function get_axis(figsize, size, aspect, ax)
- changed:
function load_dataset(name, cache=…, cache_dir=…, github_url=…, **kws) → function load_dataset(name, cache=…, cache_dir=…, github_url=…, branch=…, **kws) - added:
function file_md5_checksum(fname)