From 3b0d8d489eb7453c1b024d07dec98ca218a754cc Mon Sep 17 00:00:00 2001 From: Stephan Hoyer Date: Thu, 8 Jun 2017 22:19:17 -0700 Subject: [PATCH] Clean-up docs for v0.9.6 (#1446) --- doc/reshaping.rst | 25 +++++++++++++---------- doc/whats-new.rst | 52 +++++++++++++++++++++++++++-------------------- 2 files changed, 44 insertions(+), 33 deletions(-) diff --git a/doc/reshaping.rst b/doc/reshaping.rst index b8b660805b7..4a24dc474b7 100644 --- a/doc/reshaping.rst +++ b/doc/reshaping.rst @@ -209,20 +209,23 @@ To adjust coordinate labels, you can use the :py:meth:`~xarray.Dataset.shift` an Sort ---- -One may sort a dataarray/dataset via :py:meth:`~xarray.DataArray.sortby` and -:py:meth:`~xarray.DataArray.sortby`. The input could either be existing -dimensions, or 1-D dataarrays that share dimensions (and have correct dimension -lengths) as the calling object. +One may sort a DataArray/Dataset via :py:meth:`~xarray.DataArray.sortby` and +:py:meth:`~xarray.DataArray.sortby`. The input can be an individual or list of +1D ``DataArray`` objects: + +.. ipython:: python + + ds = xr.Dataset({'A': (('x', 'y'), [[1, 2], [3, 4]]), + 'B': (('x', 'y'), [[5, 6], [7, 8]])}, + coords={'x': ['b', 'a'], 'y': [1, 0]}) + dax = xr.DataArray([100, 99], [('x', [0, 1])]) + day = xr.DataArray([90, 80], [('y', [0, 1])]) + ds.sortby([day, dax]) + +As a shortcut, you can refer to existing coordinates by name: .. ipython:: python - ds = Dataset({'A': DataArray([[1, 2], [3, 4]], - [('x', ['b', 'a']), - ('y', [1, 0])]), - 'B': DataArray([[5, 6], [7, 8]], dims=['x', 'y'])}) ds.sortby('x') ds.sortby(['y', 'x']) ds.sortby(['y', 'x'], ascending=False) - dax = DataArray([100, 99], [('x', [0, 1])]) - day = DataArray([90, 80], [('y', [0, 1])]) - actual = ds.sortby([day, dax]) diff --git a/doc/whats-new.rst b/doc/whats-new.rst index dd3ceb54715..183762b6b9f 100644 --- a/doc/whats-new.rst +++ b/doc/whats-new.rst @@ -15,39 +15,39 @@ What's New .. _whats-new.0.9.6: -v0.9.6 (unreleased) -------------------- +v0.9.6 (8 June 2017) +-------------------- -- Add ``.dt`` accessor to DataArrays for computing datetime-like properties -for the values they contain, similar to ``pandas.Series`` (:issue:`358`). -By `Daniel Rothenberg `_. +This release includes a number of backwards compatible enhancements and bug +fixes. Enhancements ~~~~~~~~~~~~ + - New :py:meth:`~xarray.Dataset.sortby` method to ``Dataset`` and ``DataArray`` that enable sorting along dimensions (:issue:`967`). - (see :ref:`reshape.sort`). + See :ref:`the docs ` for examples. By `Chun-Wei Yuan `_ and - `Kyle Heuton `_. + `Kyle Heuton `_. -- Rename the dask arrays created by `open_dataset` to match new dask conventions - (:issue:`1343`). By `Ryan Abernathey `_. +- Add ``.dt`` accessor to DataArrays for computing datetime-like properties + for the values they contain, similar to ``pandas.Series`` (:issue:`358`). + By `Daniel Rothenberg `_. -- Enhanced tests suite by use of ``@network`` decorator, which is - controlled via ``--run-network-tests`` command line argument - to ``py.test`` (:issue:`1393`). - By `Matthew Gidden `_. +- Renamed internal dask arrays created by ``open_dataset`` to match new dask + conventions (:issue:`1343`). + By `Ryan Abernathey `_. -- ``xarray.core.variable.as_variable`` is now part of the public API and - can be accessed using :py:meth:`~xarray.as_variable` (:issue:`1303`). +- :py:meth:`~xarray.as_variable` is now part of the public API (:issue:`1303`). By `Benoit Bovy `_. - :py:func:`~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 backend to open raster files with the - `rasterio `_ library. +- New function :py:func:`~xarray.open_rasterio` for opening raster files with + the `rasterio `_ library. + See :ref:`the docs ` for details. By `Joe Hamman `_, `Nic Wayand `_ and `Fabien Maussion `_ @@ -55,15 +55,12 @@ Enhancements Bug fixes ~~~~~~~~~ -- Fix test suite failure caused by changes to ``pandas.cut`` function (:issue:`1386`). -By `Ryan Abernathey `_. - - Fix error from repeated indexing of datasets loaded from disk (:issue:`1374`). By `Stephan Hoyer `_. - Fix a bug where ``.isel_points`` wrongly assigns unselected coordinate to -``data_vars``. -By `Keisuke Fujii `_. + ``data_vars``. + By `Keisuke Fujii `_. - Tutorial datasets are now checked against a reference MD5 sum to confirm successful download (:issue:`1392`). By `Matthew Gidden @@ -82,6 +79,17 @@ Documentation allows to add interactive examples to the documentation. By `Fabien Maussion `_. +Testing +~~~~~~~ + +- Fix test suite failure caused by changes to ``pandas.cut`` function + (:issue:`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`` (:issue:`1393`). + By `Matthew Gidden `_. .. _whats-new.0.9.5: