Skip to content

Commit 46a902f

Browse files
committed
Merge branch 'main' into backend-indexing
* main: (48 commits) Add test for #9155 (#9161) Remove mypy exclusions for a couple more libraries (#9160) Include numbagg in type checks (#9159) Improve zarr chunks docs (#9140) groupby: remove some internal use of IndexVariable (#9123) Improve `to_zarr` docs (#9139) Split out distributed writes in zarr docs (#9132) Update zendoo badge link (#9133) Support duplicate dimensions in `.chunk` (#9099) Bump the actions group with 2 updates (#9130) adjust repr tests to account for different platforms (#9127) (#9128) Grouper refactor (#9122) Update docstring in api.py for open_mfdataset(), clarifying "chunks" argument (#9121) Add test for rechunking to a size string (#9117) Move Sphinx directives out of `See also` (#8466) new whats-new section (#9115) release v2024.06.0 (#9113) release notes for 2024.06.0 (#9092) [skip-ci] Try fixing hypothesis CI trigger (#9112) Undo custom padding-top. (#9107) ...
2 parents 8d64f60 + 872c1c5 commit 46a902f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+1543
-1027
lines changed

.github/workflows/ci-additional.yaml

+4-11
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,6 @@ on:
88
branches:
99
- "main"
1010
- "backend-indexing"
11-
paths:
12-
- 'ci/**'
13-
- '.github/**'
14-
- '/*' # covers files such as `pyproject.toml`
15-
- 'properties/**'
16-
- 'xarray/**'
17-
1811
workflow_dispatch: # allows you to trigger manually
1912

2013
concurrency:
@@ -139,7 +132,7 @@ jobs:
139132
python -m mypy --install-types --non-interactive --cobertura-xml-report mypy_report xarray/
140133
141134
- name: Upload mypy coverage to Codecov
142-
uses: codecov/codecov-action@v4.4.0
135+
uses: codecov/codecov-action@v4.5.0
143136
with:
144137
file: mypy_report/cobertura.xml
145138
flags: mypy
@@ -193,7 +186,7 @@ jobs:
193186
python -m mypy --install-types --non-interactive --cobertura-xml-report mypy_report xarray/
194187
195188
- name: Upload mypy coverage to Codecov
196-
uses: codecov/codecov-action@v4.4.0
189+
uses: codecov/codecov-action@v4.5.0
197190
with:
198191
file: mypy_report/cobertura.xml
199192
flags: mypy39
@@ -254,7 +247,7 @@ jobs:
254247
python -m pyright xarray/
255248
256249
- name: Upload pyright coverage to Codecov
257-
uses: codecov/codecov-action@v4.4.0
250+
uses: codecov/codecov-action@v4.5.0
258251
with:
259252
file: pyright_report/cobertura.xml
260253
flags: pyright
@@ -313,7 +306,7 @@ jobs:
313306
python -m pyright xarray/
314307
315308
- name: Upload pyright coverage to Codecov
316-
uses: codecov/codecov-action@v4.4.0
309+
uses: codecov/codecov-action@v4.5.0
317310
with:
318311
file: pyright_report/cobertura.xml
319312
flags: pyright39

.github/workflows/ci.yaml

+1-7
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,6 @@ on:
88
branches:
99
- "main"
1010
- "backend-indexing"
11-
paths:
12-
- 'ci/**'
13-
- '.github/**'
14-
- '/*' # covers files such as `pyproject.toml`
15-
- 'properties/**'
16-
- 'xarray/**'
1711
workflow_dispatch: # allows you to trigger manually
1812

1913
concurrency:
@@ -167,7 +161,7 @@ jobs:
167161
path: pytest.xml
168162

169163
- name: Upload code coverage to Codecov
170-
uses: codecov/codecov-action@v4.4.0
164+
uses: codecov/codecov-action@v4.5.0
171165
with:
172166
file: ./coverage.xml
173167
flags: unittests

.github/workflows/hypothesis.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ jobs:
3939
if: |
4040
always()
4141
&& (
42-
(github.event_name == 'schedule' || github.event_name == 'workflow_dispatch')
43-
|| needs.detect-ci-trigger.outputs.triggered == 'true'
44-
|| contains( github.event.pull_request.labels.*.name, 'run-slow-hypothesis')
42+
needs.detect-ci-trigger.outputs.triggered == 'false'
43+
&& ( (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch')
44+
|| contains( github.event.pull_request.labels.*.name, 'run-slow-hypothesis'))
4545
)
4646
defaults:
4747
run:

.github/workflows/pypi-release.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ jobs:
8888
path: dist
8989
- name: Publish package to TestPyPI
9090
if: github.event_name == 'push'
91-
uses: pypa/gh-action-pypi-publish@v1.8.14
91+
uses: pypa/gh-action-pypi-publish@v1.9.0
9292
with:
9393
repository_url: https://test.pypi.org/legacy/
9494
verbose: true
@@ -111,6 +111,6 @@ jobs:
111111
name: releases
112112
path: dist
113113
- name: Publish package to PyPI
114-
uses: pypa/gh-action-pypi-publish@v1.8.14
114+
uses: pypa/gh-action-pypi-publish@v1.9.0
115115
with:
116116
verbose: true

.github/workflows/upstream-dev-ci.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ jobs:
146146
run: |
147147
python -m mypy --install-types --non-interactive --cobertura-xml-report mypy_report
148148
- name: Upload mypy coverage to Codecov
149-
uses: codecov/codecov-action@v4.4.0
149+
uses: codecov/codecov-action@v4.5.0
150150
with:
151151
file: mypy_report/cobertura.xml
152152
flags: mypy

.pre-commit-config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ repos:
1313
- id: mixed-line-ending
1414
- repo: https://github.com/astral-sh/ruff-pre-commit
1515
# Ruff version.
16-
rev: 'v0.4.3'
16+
rev: 'v0.4.7'
1717
hooks:
1818
- id: ruff
1919
args: ["--fix", "--show-fixes"]

CITATION.cff

+14
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ authors:
1111
orcid: "https://orcid.org/0000-0001-7479-8439"
1212
- family-names: "Magin"
1313
given-names: "Justus"
14+
orcid: "https://orcid.org/0000-0002-4254-8002"
1415
- family-names: "Cherian"
1516
given-names: "Deepak"
1617
orcid: "https://orcid.org/0000-0002-6861-8734"
@@ -75,6 +76,19 @@ authors:
7576
- family-names: "Wolfram"
7677
given-names: "Phillip J."
7778
orcid: "https://orcid.org/0000-0001-5971-4241"
79+
- family-names: "Henderson"
80+
given-names: "Scott"
81+
orcid: "https://orcid.org/0000-0003-0624-4965"
82+
- family-names: "Awowale"
83+
given-names: "Eniola Olufunke"
84+
- family-names: "Scheick"
85+
given-names: "Jessica"
86+
orcid: "https://orcid.org/0000-0002-3421-4459"
87+
- family-names: "Savoie"
88+
given-names: "Matthew"
89+
orcid: "https://orcid.org/0000-0002-8881-2550"
90+
- family-names: "Littlejohns"
91+
given-names: "Owen"
7892
title: "xarray"
7993
abstract: "N-D labeled arrays and datasets in Python."
8094
license: Apache-2.0

README.md

+11-11
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
[![Available on pypi](https://img.shields.io/pypi/v/xarray.svg)](https://pypi.python.org/pypi/xarray/)
88
[![Formatted with black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/python/black)
99
[![Checked with mypy](http://www.mypy-lang.org/static/mypy_badge.svg)](http://mypy-lang.org/)
10-
[![Mirror on zendoo](https://zenodo.org/badge/DOI/10.5281/zenodo.598201.svg)](https://doi.org/10.5281/zenodo.598201)
10+
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.11183201.svg)](https://doi.org/10.5281/zenodo.11183201)
1111
[![Examples on binder](https://img.shields.io/badge/launch-binder-579ACA.svg?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFkAAABZCAMAAABi1XidAAAB8lBMVEX///9XmsrmZYH1olJXmsr1olJXmsrmZYH1olJXmsr1olJXmsrmZYH1olL1olJXmsr1olJXmsrmZYH1olL1olJXmsrmZYH1olJXmsr1olL1olJXmsrmZYH1olL1olJXmsrmZYH1olL1olL0nFf1olJXmsrmZYH1olJXmsq8dZb1olJXmsrmZYH1olJXmspXmspXmsr1olL1olJXmsrmZYH1olJXmsr1olL1olJXmsrmZYH1olL1olLeaIVXmsrmZYH1olL1olL1olJXmsrmZYH1olLna31Xmsr1olJXmsr1olJXmsrmZYH1olLqoVr1olJXmsr1olJXmsrmZYH1olL1olKkfaPobXvviGabgadXmsqThKuofKHmZ4Dobnr1olJXmsr1olJXmspXmsr1olJXmsrfZ4TuhWn1olL1olJXmsqBi7X1olJXmspZmslbmMhbmsdemsVfl8ZgmsNim8Jpk8F0m7R4m7F5nLB6j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yx0eoy9uPzN5SPd86aXggOsEKW2Prz7du3VID3/tzs/sSRs2w7ovVHKtjrX2pd7ZMlTxAYfBAL9jiDwfLkq55Tm7ifhMlTGPyCAs7RFRhn47JnlcB9RM5T97ASuZXIcVNuUDIndpDbdsfrqsOppeXl5Y+XVKdjFCTh+zGaVuj0d9zy05PPK3QzBamxdwtTCrzyg/2Rvf2EstUjordGwa/kx9mSJLr8mLLtCW8HHGJc2R5hS219IiF6PnTusOqcMl57gm0Z8kanKMAQg0qSyuZfn7zItsbGyO9QlnxY0eCuD1XL2ys/MsrQhltE7Ug0uFOzufJFE2PxBo/YAx8XPPdDwWN0MrDRYIZF0mSMKCNHgaIVFoBbNoLJ7tEQDKxGF0kcLQimojCZopv0OkNOyWCCg9XMVAi7ARJzQdM2QUh0gmBozjc3Skg6dSBRqDGYSUOu66Zg+I2fNZs/M3/f/Grl/XnyF1Gw3VKCez0PN5IUfFLqvgUN4C0qNqYs5YhPL+aVZYDE4IpUk57oSFnJm4FyCqqOE0jhY2SMyLFoo56zyo6becOS5UVDdj7Vih0zp+tcMhwRpBeLyqtIjlJKAIZSbI8SGSF3k0pA3mR5tHuwPFoa7N7reoq2bqCsAk1HqCu5uvI1n6JuRXI+S1Mco54YmYTwcn6Aeic+kssXi8XpXC4V3t7/ADuTNKaQJdScAAAAAElFTkSuQmCC)](https://mybinder.org/v2/gh/pydata/xarray/main?urlpath=lab/tree/doc/examples/weather-data.ipynb)
1212
[![Twitter](https://img.shields.io/twitter/follow/xarray_dev?style=social)](https://twitter.com/xarray_dev)
1313

@@ -46,15 +46,15 @@ provide a powerful and concise interface. For example:
4646

4747
- Apply operations over dimensions by name: `x.sum('time')`.
4848
- Select values by label instead of integer location:
49-
`x.loc['2014-01-01']` or `x.sel(time='2014-01-01')`.
49+
`x.loc['2014-01-01']` or `x.sel(time='2014-01-01')`.
5050
- Mathematical operations (e.g., `x - y`) vectorize across multiple
51-
dimensions (array broadcasting) based on dimension names, not shape.
51+
dimensions (array broadcasting) based on dimension names, not shape.
5252
- Flexible split-apply-combine operations with groupby:
53-
`x.groupby('time.dayofyear').mean()`.
53+
`x.groupby('time.dayofyear').mean()`.
5454
- Database like alignment based on coordinate labels that smoothly
55-
handles missing values: `x, y = xr.align(x, y, join='outer')`.
55+
handles missing values: `x, y = xr.align(x, y, join='outer')`.
5656
- Keep track of arbitrary metadata in the form of a Python dictionary:
57-
`x.attrs`.
57+
`x.attrs`.
5858

5959
## Documentation
6060

@@ -73,12 +73,12 @@ page](https://docs.xarray.dev/en/stable/contributing.html).
7373
## Get in touch
7474

7575
- Ask usage questions ("How do I?") on
76-
[GitHub Discussions](https://github.com/pydata/xarray/discussions).
76+
[GitHub Discussions](https://github.com/pydata/xarray/discussions).
7777
- Report bugs, suggest features or view the source code [on
78-
GitHub](https://github.com/pydata/xarray).
78+
GitHub](https://github.com/pydata/xarray).
7979
- For less well defined questions or ideas, or to announce other
80-
projects of interest to xarray users, use the [mailing
81-
list](https://groups.google.com/forum/#!forum/xarray).
80+
projects of interest to xarray users, use the [mailing
81+
list](https://groups.google.com/forum/#!forum/xarray).
8282

8383
## NumFOCUS
8484

@@ -114,7 +114,7 @@ Licensed under the Apache License, Version 2.0 (the "License"); you
114114
may not use this file except in compliance with the License. You may
115115
obtain a copy of the License at
116116

117-
<https://www.apache.org/licenses/LICENSE-2.0>
117+
<https://www.apache.org/licenses/LICENSE-2.0>
118118

119119
Unless required by applicable law or agreed to in writing, software
120120
distributed under the License is distributed on an "AS IS" BASIS,

asv_bench/benchmarks/dataarray_missing.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def time_ffill(self, shape, chunks, limit):
6666
),
6767
)
6868
def time_bfill(self, shape, chunks, limit):
69-
actual = self.da.ffill(dim="time", limit=limit)
69+
actual = self.da.bfill(dim="time", limit=limit)
7070

7171
if chunks is not None:
7272
actual = actual.compute()

ci/install-upstream-wheels.sh

+16-5
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,21 @@
11
#!/usr/bin/env bash
22

3+
if which micromamba >/dev/null; then
4+
conda=micromamba
5+
elif which mamba >/dev/null; then
6+
conda=mamba
7+
else
8+
conda=conda
9+
fi
10+
311
# temporarily (?) remove numbagg and numba
4-
micromamba remove -y numba numbagg sparse
12+
$conda remove -y numba numbagg sparse
513
# temporarily remove numexpr
6-
micromamba remove -y numexpr
14+
$conda remove -y numexpr
715
# temporarily remove backends
8-
micromamba remove -y cf_units hdf5 h5py netcdf4 pydap
16+
$conda remove -y cf_units hdf5 h5py netcdf4 pydap
917
# forcibly remove packages to avoid artifacts
10-
micromamba remove -y --force \
18+
$conda remove -y --force \
1119
numpy \
1220
scipy \
1321
pandas \
@@ -19,6 +27,7 @@ micromamba remove -y --force \
1927
bottleneck \
2028
flox
2129
# pint
30+
2231
# to limit the runtime of Upstream CI
2332
python -m pip install \
2433
-i https://pypi.anaconda.org/scientific-python-nightly-wheels/simple \
@@ -39,13 +48,15 @@ python -m pip install \
3948
--pre \
4049
--upgrade \
4150
pyarrow
51+
# manually install `pint` to pull in new dependencies
52+
python -m pip install --upgrade pint
4253
python -m pip install \
4354
--no-deps \
4455
--upgrade \
4556
git+https://github.com/dask/dask \
4657
git+https://github.com/dask/dask-expr \
4758
git+https://github.com/dask/distributed \
48-
git+https://github.com/zarr-developers/zarr \
59+
git+https://github.com/zarr-developers/zarr.git@main \
4960
git+https://github.com/Unidata/cftime \
5061
git+https://github.com/pypa/packaging \
5162
git+https://github.com/hgrecco/pint \

doc/_static/style.css

+2-5
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@ table.docutils td {
77
word-wrap: break-word;
88
}
99

10-
div.bd-header-announcement {
11-
background-color: unset;
12-
color: #000;
10+
.bd-header-announcement {
11+
background-color: var(--pst-color-info-bg);
1312
}
1413

1514
/* Reduce left and right margins */
@@ -222,8 +221,6 @@ main *:target::before {
222221
}
223222

224223
body {
225-
/* Add padding to body to avoid overlap with navbar. */
226-
padding-top: var(--navbar-height);
227224
width: 100%;
228225
}
229226

doc/conf.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@
242242
Theme by the <a href="https://ebp.jupyterbook.org">Executable Book Project</a></p>""",
243243
twitter_url="https://twitter.com/xarray_dev",
244244
icon_links=[], # workaround for pydata/pydata-sphinx-theme#1220
245-
announcement="🍾 <a href='https://github.com/pydata/xarray/discussions/8462'>Xarray is now 10 years old!</a> 🎉",
245+
announcement="<a href='https://forms.gle/KEq7WviCdz9xTaJX6'>Xarray's 2024 User Survey is live now. Please take ~5 minutes to fill it out and help us improve Xarray.</a>",
246246
)
247247

248248

doc/ecosystem.rst

+1
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ Extend xarray capabilities
7474
- `Collocate <https://github.com/cistools/collocate>`_: Collocate xarray trajectories in arbitrary physical dimensions
7575
- `eofs <https://ajdawson.github.io/eofs/>`_: EOF analysis in Python.
7676
- `hypothesis-gufunc <https://hypothesis-gufunc.readthedocs.io/en/latest/>`_: Extension to hypothesis. Makes it easy to write unit tests with xarray objects as input.
77+
- `ntv-pandas <https://github.com/loco-philippe/ntv-pandas>`_ : A tabular analyzer and a semantic, compact and reversible converter for multidimensional and tabular data
7778
- `nxarray <https://github.com/nxarray/nxarray>`_: NeXus input/output capability for xarray.
7879
- `xarray-compare <https://github.com/astropenguin/xarray-compare>`_: xarray extension for data comparison.
7980
- `xarray-dataclasses <https://github.com/astropenguin/xarray-dataclasses>`_: xarray extension for typed DataArray and Dataset creation.

doc/examples/multidimensional-coords.ipynb

-7
Original file line numberDiff line numberDiff line change
@@ -190,13 +190,6 @@
190190
"\n",
191191
"**Note**: This group-by-latitude approach does not take into account the finite-size geometry of grid cells. It simply bins each value according to the coordinates at the cell center. Xarray has no understanding of grid cells and their geometry. More precise geographic regridding for xarray data is available via the [xesmf](https://xesmf.readthedocs.io) package."
192192
]
193-
},
194-
{
195-
"cell_type": "code",
196-
"execution_count": null,
197-
"metadata": {},
198-
"outputs": [],
199-
"source": []
200193
}
201194
],
202195
"metadata": {

doc/user-guide/computation.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Use :py:func:`~xarray.where` to conditionally switch between values:
5050
5151
xr.where(arr > 0, "positive", "negative")
5252
53-
Use `@` to perform matrix multiplication:
53+
Use `@` to compute the :py:func:`~xarray.dot` product:
5454

5555
.. ipython:: python
5656

0 commit comments

Comments
 (0)