From 88726fd343bc69327b7920c7c5b262dc6496ed96 Mon Sep 17 00:00:00 2001 From: Keewis Date: Wed, 4 Dec 2019 01:51:07 +0100 Subject: [PATCH 1/6] remove the sections from the quantile examples sphinx' doctest extension does not work too well with them. --- xarray/core/dataarray.py | 4 ---- xarray/core/dataset.py | 4 ---- xarray/core/groupby.py | 4 ---- 3 files changed, 12 deletions(-) diff --git a/xarray/core/dataarray.py b/xarray/core/dataarray.py index 64f21b0eb01..da92c8d3805 100644 --- a/xarray/core/dataarray.py +++ b/xarray/core/dataarray.py @@ -2980,8 +2980,6 @@ def quantile( ... coords={"x": [7, 9], "y": [1, 1.5, 2, 2.5]}, ... dims=("x", "y"), ... ) - - Single quantile >>> da.quantile(0) # or da.quantile(0, dim=...) array(0.7) @@ -2993,8 +2991,6 @@ def quantile( Coordinates: * y (y) float64 1.0 1.5 2.0 2.5 quantile float64 0.0 - - Multiple quantiles >>> da.quantile([0, 0.5, 1]) array([0.7, 3.4, 9.4]) diff --git a/xarray/core/dataset.py b/xarray/core/dataset.py index 61dde6a393b..2db76ce123f 100644 --- a/xarray/core/dataset.py +++ b/xarray/core/dataset.py @@ -5124,8 +5124,6 @@ def quantile( ... {"a": (("x", "y"), [[0.7, 4.2, 9.4, 1.5], [6.5, 7.3, 2.6, 1.9]])}, ... coords={"x": [7, 9], "y": [1, 1.5, 2, 2.5]}, ... ) - - Single quantile >>> ds.quantile(0) # or ds.quantile(0, dim=...) Dimensions: () @@ -5141,8 +5139,6 @@ def quantile( quantile float64 0.0 Data variables: a (y) float64 0.7 4.2 2.6 1.5 - - Multiple quantiles >>> ds.quantile([0, 0.5, 1]) Dimensions: (quantile: 3) diff --git a/xarray/core/groupby.py b/xarray/core/groupby.py index cb8f6538820..fde1aafcfc4 100644 --- a/xarray/core/groupby.py +++ b/xarray/core/groupby.py @@ -607,8 +607,6 @@ def quantile(self, q, dim=None, interpolation="linear", keep_attrs=None): ... dims=("y", "y"), ... ) >>> ds = xr.Dataset({"a": da}) - - Single quantile >>> da.groupby("x").quantile(0) array([[0.7, 4.2, 0.7, 1.5], @@ -625,8 +623,6 @@ def quantile(self, q, dim=None, interpolation="linear", keep_attrs=None): * y (y) int64 1 2 Data variables: a (y) float64 0.7 0.7 - - Multiple quantiles >>> da.groupby("x").quantile([0, 0.5, 1]) array([[[0.7 , 1. , 1.3 ], From f787ebecf70c0d34a3698dcea79a4c3655daedd0 Mon Sep 17 00:00:00 2001 From: Keewis Date: Wed, 4 Dec 2019 01:52:38 +0100 Subject: [PATCH 2/6] remove the attributes section from DataArray's docstring --- xarray/core/dataarray.py | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/xarray/core/dataarray.py b/xarray/core/dataarray.py index da92c8d3805..1634feff415 100644 --- a/xarray/core/dataarray.py +++ b/xarray/core/dataarray.py @@ -234,19 +234,6 @@ class DataArray(AbstractArray, DataWithCoords): Getting items from or doing mathematical operations with a DataArray always returns another DataArray. - - Attributes - ---------- - dims : tuple - Dimension names associated with this array. - values : numpy.ndarray - Access or modify DataArray values as a numpy array. - coords : dict-like - Dictionary of DataArray objects that label values along each dimension. - name : str or None - Name of this array. - attrs : dict - Dictionary for holding arbitrary metadata. """ _cache: Dict[str, Any] From 4f8a8d80acf7816fda468bf63bba15663e24d279 Mon Sep 17 00:00:00 2001 From: Keewis Date: Thu, 5 Dec 2019 19:08:41 +0100 Subject: [PATCH 3/6] fix author error issues --- doc/whats-new.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/whats-new.rst b/doc/whats-new.rst index d4d8ab8f3e5..749339c262a 100644 --- a/doc/whats-new.rst +++ b/doc/whats-new.rst @@ -30,7 +30,7 @@ New Features By `Deepak Cherian `_. - Added the :py:meth:`count` reduction method to both :py:class:`DatasetCoarsen` and :py:class:`DataArrayCoarsen` objects. (:pull:`3500`) - By `Deepak Cherian `_ + By `Deepak Cherian `_ Bug fixes ~~~~~~~~~ From 24ff48ecec3fd3cf0422ffbd0ba71cb8ce56d1ee Mon Sep 17 00:00:00 2001 From: Keewis Date: Thu, 5 Dec 2019 19:13:53 +0100 Subject: [PATCH 4/6] remove the newline in the GroupBy.quantile examples this will probably make doctest fail but it fixes the sphinx warnings. --- xarray/core/groupby.py | 1 - 1 file changed, 1 deletion(-) diff --git a/xarray/core/groupby.py b/xarray/core/groupby.py index fde1aafcfc4..5b52f48413d 100644 --- a/xarray/core/groupby.py +++ b/xarray/core/groupby.py @@ -629,7 +629,6 @@ def quantile(self, q, dim=None, interpolation="linear", keep_attrs=None): [4.2 , 6.3 , 8.4 ], [0.7 , 5.05, 9.4 ], [1.5 , 4.2 , 6.9 ]], - [[6.5 , 6.5 , 6.5 ], [7.3 , 7.3 , 7.3 ], [2.6 , 2.6 , 2.6 ], From 643ff0d636f5a052a925242f2f89bdc56319a536 Mon Sep 17 00:00:00 2001 From: Keewis Date: Thu, 5 Dec 2019 19:35:28 +0100 Subject: [PATCH 5/6] fix a few more links --- doc/whats-new.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/whats-new.rst b/doc/whats-new.rst index 749339c262a..96e5eeacf95 100644 --- a/doc/whats-new.rst +++ b/doc/whats-new.rst @@ -42,17 +42,17 @@ Documentation - Switch doc examples to use nbsphinx and replace sphinx_gallery with notebook. (:pull:`3105`, :pull:`3106`, :pull:`3121`) - By `Ryan Abernathey ` + By `Ryan Abernathey `_ - Added example notebook demonstrating use of xarray with Regional Ocean Modeling System (ROMS) ocean hydrodynamic model output. (:pull:`3116`). - By `Robert Hetland ` + By `Robert Hetland `_ - Added example notebook demonstrating the visualization of ERA5 GRIB data. (:pull:`3199`) - By `Zach Bruick ` and - `Stephan Siemen ` -- Added examples for `DataArray.quantile`, `Dataset.quantile` and - `GroupBy.quantile`. (:pull:`3576`) + By `Zach Bruick `_ and + `Stephan Siemen `_ +- Added examples for :py:meth:`DataArray.quantile`, :py:meth:`Dataset.quantile` and + ``GroupBy.quantile``. (:pull:`3576`) By `Justus Magin `_. Internal Changes From 4114febcfe8872d901735bccf1e5d28755befaf3 Mon Sep 17 00:00:00 2001 From: Keewis Date: Thu, 5 Dec 2019 19:50:09 +0100 Subject: [PATCH 6/6] CI: disable nit-picky warnings and fail on new warnings --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 90de0705a27..d6ee76c7d3f 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -110,5 +110,5 @@ jobs: - bash: | source activate xarray-tests cd doc - sphinx-build -n -j auto -b html -d _build/doctrees . _build/html + sphinx-build -W --keep-going -j auto -b html -d _build/doctrees . _build/html displayName: Build HTML docs