Skip to content

Commit e792681

Browse files
authored
Docs and other minor updates for v0.10.2. (#1984)
* Docs and other minor udpates for v0.10.2. * Update build deps * Misc doc fixes * Removal failure on warning in doc build
1 parent b430524 commit e792681

13 files changed

+53
-28
lines changed

.travis.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ script:
102102
- flake8 -j auto xarray
103103
- python -OO -c "import xarray"
104104
- if [[ "$CONDA_ENV" == "docs" ]]; then
105-
conda install -c conda-forge sphinx_rtd_theme;
106-
sphinx-build -n -b html -d _build/doctrees doc _build/html;
105+
conda install -c conda-forge sphinx sphinx_rtd_theme sphinx-gallery numpydoc;
106+
sphinx-build -n -j auto -b html -d _build/doctrees doc _build/html;
107107
else
108108
py.test xarray --cov=xarray --cov-config ci/.coveragerc --cov-report term-missing --verbose $EXTRA_FLAGS;
109109
fi

README.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ xarray: N-D labeled arrays and datasets
1414
.. image:: https://zenodo.org/badge/13221727.svg
1515
:target: https://zenodo.org/badge/latestdoi/13221727
1616
.. image:: http://img.shields.io/badge/benchmarked%20by-asv-green.svg?style=flat
17-
:target: https://tomaugspurger.github.io/asv-collection/xarray/
17+
:target: http://pandas.pydata.org/speed/xarray/
1818

1919
**xarray** (formerly **xray**) is an open source project and Python package that aims to bring the
2020
labeled data power of pandas_ to the physical sciences, by providing

doc/_static/ci.png

196 KB
Loading

doc/api-hidden.rst

+7
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99

1010
auto_combine
1111

12+
Dataset.nbytes
13+
Dataset.chunks
14+
1215
Dataset.all
1316
Dataset.any
1417
Dataset.argmax
@@ -42,9 +45,13 @@
4245
Dataset.rank
4346

4447
DataArray.ndim
48+
DataArray.nbytes
4549
DataArray.shape
4650
DataArray.size
4751
DataArray.dtype
52+
DataArray.nbytes
53+
DataArray.chunks
54+
4855
DataArray.astype
4956
DataArray.item
5057

doc/api.rst

+12
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ Attributes
5252
Dataset.encoding
5353
Dataset.indexes
5454
Dataset.get_index
55+
Dataset.chunks
56+
Dataset.nbytes
5557

5658
Dictionary interface
5759
--------------------
@@ -122,6 +124,7 @@ Missing value handling
122124

123125
Dataset.isnull
124126
Dataset.notnull
127+
Dataset.combine_first
125128
Dataset.count
126129
Dataset.dropna
127130
Dataset.fillna
@@ -160,6 +163,7 @@ Computation
160163
:py:attr:`~Dataset.var`
161164

162165
**ndarray methods**:
166+
:py:attr:`~Dataset.astype`
163167
:py:attr:`~Dataset.argsort`
164168
:py:attr:`~Dataset.clip`
165169
:py:attr:`~Dataset.conj`
@@ -222,6 +226,8 @@ Attributes
222226
:py:attr:`~DataArray.shape`
223227
:py:attr:`~DataArray.size`
224228
:py:attr:`~DataArray.dtype`
229+
:py:attr:`~DataArray.nbytes`
230+
:py:attr:`~DataArray.chunks`
225231

226232
DataArray contents
227233
------------------
@@ -270,6 +276,7 @@ Missing value handling
270276

271277
DataArray.isnull
272278
DataArray.notnull
279+
DataArray.combine_first
273280
DataArray.count
274281
DataArray.dropna
275282
DataArray.fillna
@@ -298,6 +305,7 @@ Computation
298305
DataArray.groupby
299306
DataArray.groupby_bins
300307
DataArray.rolling
308+
DataArray.dt
301309
DataArray.resample
302310
DataArray.get_axis_num
303311
DataArray.diff
@@ -480,6 +488,7 @@ DataArray methods
480488
DataArray.from_series
481489
DataArray.from_cdms2
482490
DataArray.from_dict
491+
DataArray.close
483492
DataArray.compute
484493
DataArray.persist
485494
DataArray.load
@@ -517,6 +526,7 @@ Plotting
517526
.. autosummary::
518527
:toctree: generated/
519528

529+
DataArray.plot
520530
plot.plot
521531
plot.contourf
522532
plot.contour
@@ -551,6 +561,8 @@ Advanced API
551561
.. autosummary::
552562
:toctree: generated/
553563

564+
Dataset.variables
565+
DataArray.variable
554566
Variable
555567
IndexVariable
556568
as_variable

doc/contributing.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -662,7 +662,7 @@ Information on how to write a benchmark and how to use asv can be found in the
662662
`asv documentation <https://asv.readthedocs.io/en/latest/writing_benchmarks.html>`_.
663663
664664
The ``xarray`` benchmarking suite is run remotely and the results are
665-
available `here <http://pandas.pydata.org/speed/xarray/`_.
665+
available `here <http://pandas.pydata.org/speed/xarray/>`_.
666666
667667
Documenting your code
668668
---------------------

doc/whats-new.rst

+4-6
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,11 @@ What's New
2727

2828
.. _whats-new.0.10.2:
2929

30-
v0.10.2 (unreleased)
31-
--------------------
30+
v0.10.2 (12 March 2018)
31+
-----------------------
3232

33-
The minor release includes a number of bug-fixes and backwards compatible enhancements.
33+
The minor release includes a number of bug-fixes and enhancements, along with
34+
one possibly **backwards incompatible change**.
3435

3536
Backwards incompatible changes
3637
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -44,9 +45,6 @@ Backwards incompatible changes
4445

4546
.. _ufunc methods: https://docs.scipy.org/doc/numpy/reference/ufuncs.html#methods
4647

47-
Documentation
48-
~~~~~~~~~~~~~
49-
5048
Enhancements
5149
~~~~~~~~~~~~
5250

xarray/core/arithmetic.py

+9-3
Original file line numberDiff line numberDiff line change
@@ -36,22 +36,28 @@ def __array_ufunc__(self, ufunc, method, *inputs, **kwargs):
3636
if ufunc.signature is not None:
3737
raise NotImplementedError(
3838
'{} not supported: xarray objects do not directly implement '
39-
'generalized ufuncs. Instead, use xarray.apply_ufunc.'
39+
'generalized ufuncs. Instead, use xarray.apply_ufunc or '
40+
'explicitly convert to xarray objects to NumPy arrays '
41+
'(e.g., with `.values`).'
4042
.format(ufunc))
4143

4244
if method != '__call__':
4345
# TODO: support other methods, e.g., reduce and accumulate.
4446
raise NotImplementedError(
4547
'{} method for ufunc {} is not implemented on xarray objects, '
46-
'which currently only support the __call__ method.'
48+
'which currently only support the __call__ method. As an '
49+
'alternative, consider explicitly converting xarray objects '
50+
'to NumPy arrays (e.g., with `.values`).'
4751
.format(method, ufunc))
4852

4953
if any(isinstance(o, SupportsArithmetic) for o in out):
5054
# TODO: implement this with logic like _inplace_binary_op. This
5155
# will be necessary to use NDArrayOperatorsMixin.
5256
raise NotImplementedError(
5357
'xarray objects are not yet supported in the `out` argument '
54-
'for ufuncs.')
58+
'for ufuncs. As an alternative, consider explicitly '
59+
'converting xarray objects to NumPy arrays (e.g., with '
60+
'`.values`).')
5561

5662
join = dataset_join = OPTIONS['arithmetic_join']
5763

xarray/core/coordinates.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -277,8 +277,8 @@ class Indexes(Mapping, formatting.ReprMixin):
277277
def __init__(self, variables, sizes):
278278
"""Not for public consumption.
279279
280-
Arguments
281-
---------
280+
Parameters
281+
----------
282282
variables : OrderedDict[Any, Variable]
283283
Reference to OrderedDict holding variable objects. Should be the
284284
same dictionary used by the source object.

xarray/core/dataarray.py

+1
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,7 @@ def name(self, value):
363363

364364
@property
365365
def variable(self):
366+
"""Low level interface to the Variable object for this DataArray."""
366367
return self._variable
367368

368369
@property

xarray/core/dataset.py

+8-4
Original file line numberDiff line numberDiff line change
@@ -399,8 +399,12 @@ def load_store(cls, store, decoder=None):
399399

400400
@property
401401
def variables(self):
402-
"""Frozen dictionary of xarray.Variable objects constituting this
403-
dataset's data
402+
"""Low level interface to Dataset contents as dict of Variable objects.
403+
404+
This ordered dictionary is frozen to prevent mutation that could
405+
violate Dataset invariants. It contains all variable objects
406+
constituting the Dataset, including both data variables and
407+
coordinates.
404408
"""
405409
return Frozen(self._variables)
406410

@@ -2775,8 +2779,8 @@ def to_dask_dataframe(self, dim_order=None, set_index=False):
27752779
The dimensions, coordinates and data variables in this dataset form
27762780
the columns of the DataFrame.
27772781
2778-
Arguments
2779-
---------
2782+
Parameters
2783+
----------
27802784
dim_order : list, optional
27812785
Hierarchical dimension order for the resulting dataframe. All
27822786
arrays are transposed to this order and then written out as flat

xarray/core/indexing.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -775,8 +775,8 @@ def _decompose_vectorized_indexer(indexer, shape, indexing_support):
775775
backend_indexer: OuterIndexer or BasicIndexer
776776
np_indexers: an ExplicitIndexer (VectorizedIndexer / BasicIndexer)
777777
778-
Note
779-
----
778+
Notes
779+
-----
780780
This function is used to realize the vectorized indexing for the backend
781781
arrays that only support basic or outer indexing.
782782
@@ -846,8 +846,8 @@ def _decompose_outer_indexer(indexer, shape, indexing_support):
846846
backend_indexer: OuterIndexer or BasicIndexer
847847
np_indexers: an ExplicitIndexer (OuterIndexer / BasicIndexer)
848848
849-
Note
850-
----
849+
Notes
850+
-----
851851
This function is used to realize the vectorized indexing for the backend
852852
arrays that only support basic or outer indexing.
853853

xarray/core/rolling.py

+2-5
Original file line numberDiff line numberDiff line change
@@ -195,11 +195,8 @@ def construct(self, window_dim, stride=1, fill_value=dtypes.NA):
195195
196196
Returns
197197
-------
198-
DataArray that is a view of the original array.
199-
200-
Note
201-
----
202-
The return array is not writeable.
198+
DataArray that is a view of the original array. The returned array is
199+
not writeable.
203200
204201
Examples
205202
--------

0 commit comments

Comments
 (0)