Skip to content

Commit bc952dc

Browse files
authored
documentation cleanup (#11179)
* don't document deprecated and removed pandas methods * rst syntax error * empty lines before lists or doctests * pandas deprecation of a timedelta unit name * restore a lot of the tags used by RTD for reference, these mean: * `-T`: show traceback * `-W`: fail on warnings * `--keep-going`: don't abort on the first warning * `-j auto`: use as many processes as CPU cores available * deduplicate `cubed-xarray` links (not sure why this one fails but `pint-xarray` or `cupy-xarray` don't)
1 parent 58de6d2 commit bc952dc

6 files changed

Lines changed: 10 additions & 14 deletions

File tree

doc/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33

44
# You can set these variables from the command line.
5-
SPHINXOPTS =
5+
SPHINXOPTS = -T -W --keep-going -j auto
66
SPHINXBUILD = sphinx-build
77
SPHINXATUOBUILD = sphinx-autobuild
88
PAPER =

doc/api-hidden.rst

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,6 @@
421421
CFTimeIndex.factorize
422422
CFTimeIndex.fillna
423423
CFTimeIndex.floor
424-
CFTimeIndex.format
425424
CFTimeIndex.get_indexer
426425
CFTimeIndex.get_indexer_for
427426
CFTimeIndex.get_indexer_non_unique
@@ -430,18 +429,10 @@
430429
CFTimeIndex.get_slice_bound
431430
CFTimeIndex.get_value
432431
CFTimeIndex.groupby
433-
CFTimeIndex.holds_integer
434432
CFTimeIndex.identical
435433
CFTimeIndex.insert
436434
CFTimeIndex.intersection
437435
CFTimeIndex.is_
438-
CFTimeIndex.is_boolean
439-
CFTimeIndex.is_categorical
440-
CFTimeIndex.is_floating
441-
CFTimeIndex.is_integer
442-
CFTimeIndex.is_interval
443-
CFTimeIndex.is_numeric
444-
CFTimeIndex.is_object
445436
CFTimeIndex.isin
446437
CFTimeIndex.isna
447438
CFTimeIndex.isnull
@@ -465,7 +456,6 @@
465456
CFTimeIndex.shift
466457
CFTimeIndex.slice_indexer
467458
CFTimeIndex.slice_locs
468-
CFTimeIndex.sort
469459
CFTimeIndex.sort_values
470460
CFTimeIndex.sortlevel
471461
CFTimeIndex.strftime

doc/contribute/contributing.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@ You can either run pre-commit manually via Pixi as described above, or set up gi
245245
This is done by:
246246

247247
.. code-block:: sh
248+
248249
pixi shell -e pre-commit # enter the pre-commit environment
249250
pre-commit install # install the git hooks
250251

doc/user-guide/duckarrays.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Some numpy-like array types that xarray already has some support for:
1616
* `Sparse <https://sparse.pydata.org/en/stable/>`_ - for performant arrays with many zero elements,
1717
* `Pint <https://pint.readthedocs.io/en/latest/>`_ - for tracking the physical units of your data (see `pint-xarray <https://pint-xarray.readthedocs.io>`_),
1818
* `Dask <https://docs.dask.org/en/stable/>`_ - parallel computing on larger-than-memory arrays (see :ref:`using dask with xarray <dask>`),
19-
* `Cubed <https://github.com/cubed-dev/cubed/tree/main/cubed>`_ - another parallel computing framework that emphasises reliability (see `cubed-xarray <https://github.com/cubed-dev/cubed-xarray>`_).
19+
* `Cubed <https://github.com/cubed-dev/cubed/tree/main/cubed>`_ - another parallel computing framework that emphasises reliability (see `cubed-xarray`_).
2020

2121
.. warning::
2222

@@ -231,4 +231,6 @@ easier. If you know of more that aren't on this list please raise an issue to ad
231231

232232
- `pint-xarray <https://pint-xarray.readthedocs.io>`_
233233
- `cupy-xarray <https://cupy-xarray.readthedocs.io>`_
234-
- `cubed-xarray <https://github.com/cubed-xarray>`_
234+
- `cubed-xarray`_
235+
236+
.. _cubed-xarray: https://github.com/cubed-dev/cubed-xarray

doc/user-guide/plotting.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ from the time and assign it as a non-dimension coordinate:
212212

213213
.. jupyter-execute::
214214

215-
decimal_day = (air1d.time - air1d.time[0]) / pd.Timedelta("1d")
215+
decimal_day = (air1d.time - air1d.time[0]) / pd.Timedelta("1D")
216216
air1d_multi = air1d.assign_coords(decimal_day=("time", decimal_day.data))
217217
air1d_multi
218218

xarray/computation/computation.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -696,6 +696,7 @@ def where(cond, x, y, keep_attrs=None):
696696
y : scalar, array, Variable, DataArray or Dataset
697697
values to choose from where `cond` is False
698698
keep_attrs : bool or {"drop", "identical", "no_conflicts", "drop_conflicts", "override"} or callable, optional
699+
699700
- 'override' or True (default): skip comparing and copy attrs from `x` to the result.
700701
- 'drop' or False: empty attrs on returned xarray object.
701702
- 'identical': all attrs must be the same on every object.
@@ -734,6 +735,7 @@ def where(cond, x, y, keep_attrs=None):
734735
standard_name: sea_surface_temperature
735736
736737
If `x` is a scalar then by default there are no attrs on the result
738+
737739
>>> xr.where(x < 0.5, 1, 0)
738740
<xarray.DataArray 'sst' (lat: 10)> Size: 80B
739741
array([1, 1, 1, 1, 1, 0, 0, 0, 0, 0])
@@ -742,6 +744,7 @@ def where(cond, x, y, keep_attrs=None):
742744
743745
If `x` is a scalar (and therefore has no attrs), preserve the
744746
attrs on `cond` by using `keep_attrs="drop_conflicts"`
747+
745748
>>> xr.where(x < 0.5, 1, 0, keep_attrs="drop_conflicts")
746749
<xarray.DataArray 'sst' (lat: 10)> Size: 80B
747750
array([1, 1, 1, 1, 1, 0, 0, 0, 0, 0])

0 commit comments

Comments
 (0)