From d24f29232cefb4b7d87243cbc0d5ffd03e1cceb9 Mon Sep 17 00:00:00 2001 From: Maximilian Roos Date: Mon, 9 Sep 2019 04:42:09 -0400 Subject: [PATCH 1/3] push the removal of the compat and encoding arguments from Dataset/DataArray back to 0.14 --- xarray/core/dataarray.py | 2 +- xarray/core/dataset.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/xarray/core/dataarray.py b/xarray/core/dataarray.py index a3655e2c4b2..807baddedf9 100644 --- a/xarray/core/dataarray.py +++ b/xarray/core/dataarray.py @@ -315,7 +315,7 @@ def __init__( if encoding is not None: warnings.warn( "The `encoding` argument to `DataArray` is deprecated, and . " - "will be removed in 0.13. " + "will be removed in 0.14. " "Instead, specify the encoding when writing to disk or " "set the `encoding` attribute directly.", FutureWarning, diff --git a/xarray/core/dataset.py b/xarray/core/dataset.py index 1476c1ba646..d6f0da42722 100644 --- a/xarray/core/dataset.py +++ b/xarray/core/dataset.py @@ -489,7 +489,7 @@ def __init__( if compat is not None: warnings.warn( "The `compat` argument to Dataset is deprecated and will be " - "removed in 0.13." + "removed in 0.14." "Instead, use `merge` to control how variables are combined", FutureWarning, stacklevel=2, From 570198e43715990f4719e36ff814402d5cffed1e Mon Sep 17 00:00:00 2001 From: Maximilian Roos Date: Mon, 9 Sep 2019 04:50:01 -0400 Subject: [PATCH 2/3] require dim argument to concat --- doc/whats-new.rst | 6 ++++-- xarray/core/concat.py | 9 +-------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/doc/whats-new.rst b/doc/whats-new.rst index e65f052ca8c..2640cd1c916 100644 --- a/doc/whats-new.rst +++ b/doc/whats-new.rst @@ -45,8 +45,8 @@ Breaking changes - 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 a hard - crash in a later release. + Omitting ``__slots__`` will now cause a ``FutureWarning`` to be logged, and will raise an + error in a later release. (:issue:`3250`) by `Guido Imperiale `_. - :py:meth:`~Dataset.to_dataset` requires ``name`` to be passed as a kwarg (previously ambiguous @@ -56,6 +56,8 @@ Breaking changes :py:func:`~xarray.broadcast`) - :py:meth:`~Variable.expand_dims` is removed (previously deprecated in favor of :py:meth:`~Variable.set_dims`) +- :py:func:`~xarray.concat` now requries the ``dim`` argument (using ``'concat_dim'`` as a default + was previouly deprecated) New functions/methods ~~~~~~~~~~~~~~~~~~~~~ diff --git a/xarray/core/concat.py b/xarray/core/concat.py index 9c7c622a31c..9c78ac5b870 100644 --- a/xarray/core/concat.py +++ b/xarray/core/concat.py @@ -112,14 +112,7 @@ def concat( raise ValueError("must supply at least one object to concatenate") if dim is None: - warnings.warn( - "the `dim` argument to `concat` will be required " - "in a future version of xarray; for now, setting it to " - "the old default of 'concat_dim'", - FutureWarning, - stacklevel=2, - ) - dim = "concat_dims" + raise TypeError("the `dim` argument to `concat` is required") if indexers is not None: # pragma: no cover warnings.warn( From 89d65f5a53e71a07ea90a7652f8c475eb0bbcc75 Mon Sep 17 00:00:00 2001 From: Deepak Cherian Date: Mon, 9 Sep 2019 19:00:36 +0000 Subject: [PATCH 3/3] Update whats-new.rst --- doc/whats-new.rst | 2 -- 1 file changed, 2 deletions(-) diff --git a/doc/whats-new.rst b/doc/whats-new.rst index 185c71ef9cc..d81986cb948 100644 --- a/doc/whats-new.rst +++ b/doc/whats-new.rst @@ -59,8 +59,6 @@ Breaking changes :py:func:`~xarray.broadcast`) - :py:meth:`~Variable.expand_dims` is removed (previously deprecated in favor of :py:meth:`~Variable.set_dims`) -- :py:func:`~xarray.concat` now requries the ``dim`` argument (using ``'concat_dim'`` as a default - was previouly deprecated) New functions/methods ~~~~~~~~~~~~~~~~~~~~~