Skip to content

Commit

Permalink
Silence sphinx warnings: Round 2 (#3592)
Browse files Browse the repository at this point in the history
* remove the sections from the quantile examples

sphinx' doctest extension does not work too well with them.

* remove the attributes section from DataArray's docstring

* fix author error issues

* remove the newline in the GroupBy.quantile examples

this will probably make doctest fail but it fixes the sphinx warnings.

* fix a few more links

* CI: disable nit-picky warnings and fail on new warnings
  • Loading branch information
keewis authored and dcherian committed Dec 6, 2019
1 parent 87a25b6 commit 4c51aa2
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 34 deletions.
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
14 changes: 7 additions & 7 deletions doc/whats-new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ New Features
By `Deepak Cherian <https://github.com/dcherian>`_.
- Added the :py:meth:`count` reduction method to both :py:class:`DatasetCoarsen`
and :py:class:`DataArrayCoarsen` objects. (:pull:`3500`)
By `Deepak Cherian <https://github.com/dcherian/>`_
By `Deepak Cherian <https://github.com/dcherian>`_

Bug fixes
~~~~~~~~~
Expand All @@ -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 <https://github.com/rabernat>`
By `Ryan Abernathey <https://github.com/rabernat>`_
- Added example notebook demonstrating use of xarray with Regional Ocean
Modeling System (ROMS) ocean hydrodynamic model output.
(:pull:`3116`).
By `Robert Hetland <https://github.com/hetland>`
By `Robert Hetland <https://github.com/hetland>`_
- Added example notebook demonstrating the visualization of ERA5 GRIB
data. (:pull:`3199`)
By `Zach Bruick <https://github.com/zbruick>` and
`Stephan Siemen <https://github.com/StephanSiemen>`
- Added examples for `DataArray.quantile`, `Dataset.quantile` and
`GroupBy.quantile`. (:pull:`3576`)
By `Zach Bruick <https://github.com/zbruick>`_ and
`Stephan Siemen <https://github.com/StephanSiemen>`_
- Added examples for :py:meth:`DataArray.quantile`, :py:meth:`Dataset.quantile` and
``GroupBy.quantile``. (:pull:`3576`)
By `Justus Magin <https://github.com/keewis>`_.

Internal Changes
Expand Down
17 changes: 0 additions & 17 deletions xarray/core/dataarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,19 +235,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]
Expand Down Expand Up @@ -3000,8 +2987,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=...)
<xarray.DataArray ()>
array(0.7)
Expand All @@ -3013,8 +2998,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])
<xarray.DataArray (quantile: 3)>
array([0.7, 3.4, 9.4])
Expand Down
4 changes: 0 additions & 4 deletions xarray/core/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -5167,8 +5167,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=...)
<xarray.Dataset>
Dimensions: ()
Expand All @@ -5184,8 +5182,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])
<xarray.Dataset>
Dimensions: (quantile: 3)
Expand Down
5 changes: 0 additions & 5 deletions xarray/core/groupby.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
<xarray.DataArray (x: 2, y: 4)>
array([[0.7, 4.2, 0.7, 1.5],
Expand All @@ -625,15 +623,12 @@ 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])
<xarray.DataArray (x: 2, y: 4, quantile: 3)>
array([[[0.7 , 1. , 1.3 ],
[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 ],
Expand Down

0 comments on commit 4c51aa2

Please sign in to comment.