Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXOPTS = -T -W --keep-going -j auto
SPHINXBUILD = sphinx-build
SPHINXATUOBUILD = sphinx-autobuild
PAPER =
Expand Down
10 changes: 0 additions & 10 deletions doc/api-hidden.rst
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,6 @@
CFTimeIndex.factorize
CFTimeIndex.fillna
CFTimeIndex.floor
CFTimeIndex.format
CFTimeIndex.get_indexer
CFTimeIndex.get_indexer_for
CFTimeIndex.get_indexer_non_unique
Expand All @@ -430,18 +429,10 @@
CFTimeIndex.get_slice_bound
CFTimeIndex.get_value
CFTimeIndex.groupby
CFTimeIndex.holds_integer
CFTimeIndex.identical
CFTimeIndex.insert
CFTimeIndex.intersection
CFTimeIndex.is_
CFTimeIndex.is_boolean
CFTimeIndex.is_categorical
CFTimeIndex.is_floating
CFTimeIndex.is_integer
CFTimeIndex.is_interval
CFTimeIndex.is_numeric
CFTimeIndex.is_object
CFTimeIndex.isin
CFTimeIndex.isna
CFTimeIndex.isnull
Expand All @@ -465,7 +456,6 @@
CFTimeIndex.shift
CFTimeIndex.slice_indexer
CFTimeIndex.slice_locs
CFTimeIndex.sort
CFTimeIndex.sort_values
CFTimeIndex.sortlevel
CFTimeIndex.strftime
Expand Down
1 change: 1 addition & 0 deletions doc/contribute/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ You can either run pre-commit manually via Pixi as described above, or set up gi
This is done by:

.. code-block:: sh

pixi shell -e pre-commit # enter the pre-commit environment
pre-commit install # install the git hooks

Expand Down
6 changes: 4 additions & 2 deletions doc/user-guide/duckarrays.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Some numpy-like array types that xarray already has some support for:
* `Sparse <https://sparse.pydata.org/en/stable/>`_ - for performant arrays with many zero elements,
* `Pint <https://pint.readthedocs.io/en/latest/>`_ - for tracking the physical units of your data (see `pint-xarray <https://pint-xarray.readthedocs.io>`_),
* `Dask <https://docs.dask.org/en/stable/>`_ - parallel computing on larger-than-memory arrays (see :ref:`using dask with xarray <dask>`),
* `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>`_).
* `Cubed <https://github.com/cubed-dev/cubed/tree/main/cubed>`_ - another parallel computing framework that emphasises reliability (see `cubed-xarray`_).

.. warning::

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

- `pint-xarray <https://pint-xarray.readthedocs.io>`_
- `cupy-xarray <https://cupy-xarray.readthedocs.io>`_
- `cubed-xarray <https://github.com/cubed-xarray>`_
- `cubed-xarray`_

.. _cubed-xarray: https://github.com/cubed-dev/cubed-xarray
2 changes: 1 addition & 1 deletion doc/user-guide/plotting.rst
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ from the time and assign it as a non-dimension coordinate:

.. jupyter-execute::

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

Expand Down
3 changes: 3 additions & 0 deletions xarray/computation/computation.py
Original file line number Diff line number Diff line change
Expand Up @@ -696,6 +696,7 @@ def where(cond, x, y, keep_attrs=None):
y : scalar, array, Variable, DataArray or Dataset
values to choose from where `cond` is False
keep_attrs : bool or {"drop", "identical", "no_conflicts", "drop_conflicts", "override"} or callable, optional

- 'override' or True (default): skip comparing and copy attrs from `x` to the result.
- 'drop' or False: empty attrs on returned xarray object.
- 'identical': all attrs must be the same on every object.
Expand Down Expand Up @@ -734,6 +735,7 @@ def where(cond, x, y, keep_attrs=None):
standard_name: sea_surface_temperature

If `x` is a scalar then by default there are no attrs on the result

>>> xr.where(x < 0.5, 1, 0)
<xarray.DataArray 'sst' (lat: 10)> Size: 80B
array([1, 1, 1, 1, 1, 0, 0, 0, 0, 0])
Expand All @@ -742,6 +744,7 @@ def where(cond, x, y, keep_attrs=None):

If `x` is a scalar (and therefore has no attrs), preserve the
attrs on `cond` by using `keep_attrs="drop_conflicts"`

>>> xr.where(x < 0.5, 1, 0, keep_attrs="drop_conflicts")
<xarray.DataArray 'sst' (lat: 10)> Size: 80B
array([1, 1, 1, 1, 1, 0, 0, 0, 0, 0])
Expand Down