Upgrading xarray 0.7 to 0.8
Breaking0.7.2 → 0.8.2Breaking5Platform1New10Changed4Fixed18Other1
BreakingUpgrade verdict
5 breaking changes and a platform requirement change.
In plain terms
- Selecting from a multi-index now removes the unused levels like pandas does, and the dimension or coordinate name changes if only one index level remains.
- Plain contour plots stop adding a colorbar automatically. Filled contour plots behave as before.
- Some resampling operations used to keep attributes when they should not. They are now dropped unless you ask to keep them.
- Combining arrays with broadcast or concat no longer fails when their labels do not match; they are aligned automatically.
Must act Top 4 of 6 that need code or config changes
Installs 5 packages in all (was 4).
Also installs six.
Moves python-dateutil 4.0.0 → 3.0.0. Your build may pick other versions.
What you must change
Breaking5
Indexing on a multi-index now drops levels, consistent with pandas, and renames the dimension or coordinate when reduced to a single index.
Contour plots no longer add a colorbar by default; filled contour plots are unchanged.
Resampling operations no longer retain attributes by default; pass keep_attrs=True to keep them.
keep_attrsbroadcast() and concat() now auto-align inputs using join=outer instead of raising ValueError for non-aligned inputs.
broadcast()concat()join=outerDataArray.values and .data now always return a NumPy array-like object, even for 0-dimensional object-dtype arrays.
DataArray.valuesDataArray.dataDataArray.item()Platform1
Drops support for Python 2.6.
API changes
Generated by DepDelta from published Python source. Not mixed with prose notes.
- added:
export MergeError - added:
export merge - added:
export register_dataarray_accessor - added:
export register_dataset_accessor
- removed:
property NetCDF4ArrayWrapper.dtype - changed:
class NetCDF4ArrayWrapper(NDArrayMixin) → class NetCDF4ArrayWrapper(BaseNetCDF4Array) - added:
class BaseNetCDF4Array(NDArrayMixin) - added:
constructor BaseNetCDF4Array(array, is_remote=…) - added:
property BaseNetCDF4Array.dtype
- added:
class BoolTypeArray(utils.NDArrayMixin) - added:
constructor BoolTypeArray(array) - added:
function maybe_encode_bools(var) - added:
property BoolTypeArray.dtype
- removed:
function align_variables(variables, join=…, copy=…) - removed:
function partial_align(*objects, **kwargs) - changed:
function broadcast(*args) → function broadcast(*args, **kwargs)
- changed:
class AbstractArray(ImplementsArrayReduce) → class AbstractArray(ImplementsArrayReduce, formatting.ReprMixin) - changed:
method BaseDataObject.resample(freq, dim, how=…, skipna=…, closed=…, label=…, base=…) → method BaseDataObject.resample(freq, dim, how=…, skipna=…, closed=…, label=…, base=…, keep_attrs=…) - changed:
method BaseDataObject.where(cond) → method BaseDataObject.where(cond, other=…, drop=…) - added:
method BaseDataObject.groupby_bins(group, bins, right=…, labels=…, precision=…, include_lowest=…, squeeze=…)
- removed:
method DataArrayCoordinates.update(other) - removed:
method DatasetCoordinates.update(other) - changed:
class AbstractCoordinates(Mapping) → class AbstractCoordinates(Mapping, formatting.ReprMixin) - changed:
class Indexes(Mapping) → class Indexes(Mapping, formatting.ReprMixin) - changed:
constructor Indexes(source) → constructor Indexes(variables, dims) - added:
method AbstractCoordinates.update(other) - added:
property AbstractCoordinates.indexes - added:
property AbstractCoordinates.variables - added:
property DataArrayCoordinates.variables - added:
property DatasetCoordinates.variables
- added:
method DataArray.to_dict() - added:
static method DataArray.from_dict(d)
- changed:
class DataVariables(Mapping) → class DataVariables(Mapping, formatting.ReprMixin) - changed:
class Dataset(Mapping, ImplementsDatasetReduce, BaseDataObject) → class Dataset(Mapping, ImplementsDatasetReduce, BaseDataObject, formatting.ReprMixin) - added:
function calculate_dimensions(variables) - added:
method Dataset.filter_by_attrs(**kwargs) - added:
method Dataset.to_dict() - added:
static method Dataset.from_dict(d)
- added:
class AccessorRegistrationError(Exception) - added:
function register_dataarray_accessor(name) - added:
function register_dataset_accessor(name)
- added:
class ReprMixin(object) - added:
function ensure_valid_repr(string) - added:
function maybe_truncate(obj, maxlen=…)
- changed:
constructor GroupBy(obj, group, squeeze=…, grouper=…) → constructor GroupBy(obj, group, squeeze=…, grouper=…, bins=…, cut_kwargs=…) - changed:
function unique_value_groups(ar) → function unique_value_groups(ar, sort=…)
- removed:
function expand_variables(raw_variables, old_variables=…, compat=…) - removed:
function merge_dataarray_coords(indexes, variables, other) - removed:
function merge_datasets(dataset, other, overwrite_vars=…, compat=…, join=…) - added:
class MergeError(ValueError) - added:
class OrderedDefaultDict(OrderedDict) - added:
constructor OrderedDefaultDict(default_factory) - added:
function broadcast_dimension_size(variables) - added:
function coerce_pandas_values(objects) - added:
function dataset_merge_method(dataset, other, overwrite_vars=…, compat=…, join=…) - added:
function dataset_update_method(dataset, other) - added:
function determine_coords(list_of_variable_dicts) - added:
function expand_variable_dicts(list_of_variable_dicts) - added:
function merge(objects, compat=…, join=…) - added:
function merge_coords(objs, compat=…, join=…, priority_arg=…, indexes=…) - added:
function merge_coords_without_align(objs, priority_vars=…) - added:
function merge_core(objs, compat=…, join=…, priority_arg=…, explicit_coords=…, indexes=…) - added:
function merge_data_and_coords(data, coords, compat=…, join=…) - added:
function merge_variables(list_of_variables_dicts, priority_vars=…, compat=…) - added:
function unique_variable(name, variables, compat=…) - added:
variable PANDAS_TYPES
- removed:
function interleaved_concat(arrays, indices, axis=…) - added:
function inverse_permutation(indices)
- removed:
function interleaved_concat(arrays, indices, axis=…)
- added:
variable PY2
- removed:
function tuple_to_0darray(value) - added:
function to_0d_array(value) - added:
function to_0d_object_array(value)
- changed:
function as_variable(obj, key=…, strict=…, copy=…) → function as_variable(obj, name=…, copy=…) - added:
function concat(variables, dim=…, positions=…, shortcut=…) - added:
static method Coordinate.concat(variables, dim=…, positions=…, shortcut=…)