Skip to content

Commit

Permalink
Merge branch 'main' into backend-indexing
Browse files Browse the repository at this point in the history
* 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)
  ...
  • Loading branch information
dcherian committed Jun 24, 2024
2 parents 8d64f60 + 872c1c5 commit 46a902f
Show file tree
Hide file tree
Showing 57 changed files with 1,543 additions and 1,027 deletions.
15 changes: 4 additions & 11 deletions .github/workflows/ci-additional.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,6 @@ on:
branches:
- "main"
- "backend-indexing"
paths:
- 'ci/**'
- '.github/**'
- '/*' # covers files such as `pyproject.toml`
- 'properties/**'
- 'xarray/**'

workflow_dispatch: # allows you to trigger manually

concurrency:
Expand Down Expand Up @@ -139,7 +132,7 @@ jobs:
python -m mypy --install-types --non-interactive --cobertura-xml-report mypy_report xarray/
- name: Upload mypy coverage to Codecov
uses: codecov/codecov-action@v4.4.0
uses: codecov/codecov-action@v4.5.0
with:
file: mypy_report/cobertura.xml
flags: mypy
Expand Down Expand Up @@ -193,7 +186,7 @@ jobs:
python -m mypy --install-types --non-interactive --cobertura-xml-report mypy_report xarray/
- name: Upload mypy coverage to Codecov
uses: codecov/codecov-action@v4.4.0
uses: codecov/codecov-action@v4.5.0
with:
file: mypy_report/cobertura.xml
flags: mypy39
Expand Down Expand Up @@ -254,7 +247,7 @@ jobs:
python -m pyright xarray/
- name: Upload pyright coverage to Codecov
uses: codecov/codecov-action@v4.4.0
uses: codecov/codecov-action@v4.5.0
with:
file: pyright_report/cobertura.xml
flags: pyright
Expand Down Expand Up @@ -313,7 +306,7 @@ jobs:
python -m pyright xarray/
- name: Upload pyright coverage to Codecov
uses: codecov/codecov-action@v4.4.0
uses: codecov/codecov-action@v4.5.0
with:
file: pyright_report/cobertura.xml
flags: pyright39
Expand Down
8 changes: 1 addition & 7 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,6 @@ on:
branches:
- "main"
- "backend-indexing"
paths:
- 'ci/**'
- '.github/**'
- '/*' # covers files such as `pyproject.toml`
- 'properties/**'
- 'xarray/**'
workflow_dispatch: # allows you to trigger manually

concurrency:
Expand Down Expand Up @@ -167,7 +161,7 @@ jobs:
path: pytest.xml

- name: Upload code coverage to Codecov
uses: codecov/codecov-action@v4.4.0
uses: codecov/codecov-action@v4.5.0
with:
file: ./coverage.xml
flags: unittests
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/hypothesis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ jobs:
if: |
always()
&& (
(github.event_name == 'schedule' || github.event_name == 'workflow_dispatch')
|| needs.detect-ci-trigger.outputs.triggered == 'true'
|| contains( github.event.pull_request.labels.*.name, 'run-slow-hypothesis')
needs.detect-ci-trigger.outputs.triggered == 'false'
&& ( (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch')
|| contains( github.event.pull_request.labels.*.name, 'run-slow-hypothesis'))
)
defaults:
run:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pypi-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ jobs:
path: dist
- name: Publish package to TestPyPI
if: github.event_name == 'push'
uses: pypa/gh-action-pypi-publish@v1.8.14
uses: pypa/gh-action-pypi-publish@v1.9.0
with:
repository_url: https://test.pypi.org/legacy/
verbose: true
Expand All @@ -111,6 +111,6 @@ jobs:
name: releases
path: dist
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@v1.8.14
uses: pypa/gh-action-pypi-publish@v1.9.0
with:
verbose: true
2 changes: 1 addition & 1 deletion .github/workflows/upstream-dev-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ jobs:
run: |
python -m mypy --install-types --non-interactive --cobertura-xml-report mypy_report
- name: Upload mypy coverage to Codecov
uses: codecov/codecov-action@v4.4.0
uses: codecov/codecov-action@v4.5.0
with:
file: mypy_report/cobertura.xml
flags: mypy
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ repos:
- id: mixed-line-ending
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: 'v0.4.3'
rev: 'v0.4.7'
hooks:
- id: ruff
args: ["--fix", "--show-fixes"]
Expand Down
14 changes: 14 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ authors:
orcid: "https://orcid.org/0000-0001-7479-8439"
- family-names: "Magin"
given-names: "Justus"
orcid: "https://orcid.org/0000-0002-4254-8002"
- family-names: "Cherian"
given-names: "Deepak"
orcid: "https://orcid.org/0000-0002-6861-8734"
Expand Down Expand Up @@ -75,6 +76,19 @@ authors:
- family-names: "Wolfram"
given-names: "Phillip J."
orcid: "https://orcid.org/0000-0001-5971-4241"
- family-names: "Henderson"
given-names: "Scott"
orcid: "https://orcid.org/0000-0003-0624-4965"
- family-names: "Awowale"
given-names: "Eniola Olufunke"
- family-names: "Scheick"
given-names: "Jessica"
orcid: "https://orcid.org/0000-0002-3421-4459"
- family-names: "Savoie"
given-names: "Matthew"
orcid: "https://orcid.org/0000-0002-8881-2550"
- family-names: "Littlejohns"
given-names: "Owen"
title: "xarray"
abstract: "N-D labeled arrays and datasets in Python."
license: Apache-2.0
Expand Down
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
[![Available on pypi](https://img.shields.io/pypi/v/xarray.svg)](https://pypi.python.org/pypi/xarray/)
[![Formatted with black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/python/black)
[![Checked with mypy](http://www.mypy-lang.org/static/mypy_badge.svg)](http://mypy-lang.org/)
[![Mirror on zendoo](https://zenodo.org/badge/DOI/10.5281/zenodo.598201.svg)](https://doi.org/10.5281/zenodo.598201)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.11183201.svg)](https://doi.org/10.5281/zenodo.11183201)
[![Examples on binder](https://img.shields.io/badge/launch-binder-579ACA.svg?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFkAAABZCAMAAABi1XidAAAB8lBMVEX///9XmsrmZYH1olJXmsr1olJXmsrmZYH1olJXmsr1olJXmsrmZYH1olL1olJXmsr1olJXmsrmZYH1olL1olJXmsrmZYH1olJXmsr1olL1olJXmsrmZYH1olL1olJXmsrmZYH1olL1olL0nFf1olJXmsrmZYH1olJXmsq8dZb1olJXmsrmZYH1olJXmspXmspXmsr1olL1olJXmsrmZYH1olJXmsr1olL1olJXmsrmZYH1olL1olLeaIVXmsrmZYH1olL1olL1olJXmsrmZYH1olLna31Xmsr1olJXmsr1olJXmsrmZYH1olLqoVr1olJXmsr1olJXmsrmZYH1olL1olKkfaPobXvviGabgadXmsqThKuofKHmZ4Dobnr1olJXmsr1olJXmspXmsr1olJXmsrfZ4TuhWn1olL1olJXmsqBi7X1olJXmspZmslbmMhbmsdemsVfl8ZgmsNim8Jpk8F0m7R4m7F5nLB6jbh7jbiDirOEibOGnKaMhq+PnaCVg6qWg6qegKaff6WhnpKofKGtnomxeZy3noG6dZi+n3vCcpPDcpPGn3bLb4/Mb47UbIrVa4rYoGjdaIbeaIXhoWHmZYHobXvpcHjqdH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cVNuUDIndpDbdsfrqsOppeXl5Y+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)
[![Twitter](https://img.shields.io/twitter/follow/xarray_dev?style=social)](https://twitter.com/xarray_dev)

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

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

## Documentation

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

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

## NumFOCUS

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

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

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
Expand Down
2 changes: 1 addition & 1 deletion asv_bench/benchmarks/dataarray_missing.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def time_ffill(self, shape, chunks, limit):
),
)
def time_bfill(self, shape, chunks, limit):
actual = self.da.ffill(dim="time", limit=limit)
actual = self.da.bfill(dim="time", limit=limit)

if chunks is not None:
actual = actual.compute()
21 changes: 16 additions & 5 deletions ci/install-upstream-wheels.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
#!/usr/bin/env bash

if which micromamba >/dev/null; then
conda=micromamba
elif which mamba >/dev/null; then
conda=mamba
else
conda=conda
fi

# temporarily (?) remove numbagg and numba
micromamba remove -y numba numbagg sparse
$conda remove -y numba numbagg sparse
# temporarily remove numexpr
micromamba remove -y numexpr
$conda remove -y numexpr
# temporarily remove backends
micromamba remove -y cf_units hdf5 h5py netcdf4 pydap
$conda remove -y cf_units hdf5 h5py netcdf4 pydap
# forcibly remove packages to avoid artifacts
micromamba remove -y --force \
$conda remove -y --force \
numpy \
scipy \
pandas \
Expand All @@ -19,6 +27,7 @@ micromamba remove -y --force \
bottleneck \
flox
# pint

# to limit the runtime of Upstream CI
python -m pip install \
-i https://pypi.anaconda.org/scientific-python-nightly-wheels/simple \
Expand All @@ -39,13 +48,15 @@ python -m pip install \
--pre \
--upgrade \
pyarrow
# manually install `pint` to pull in new dependencies
python -m pip install --upgrade pint
python -m pip install \
--no-deps \
--upgrade \
git+https://github.com/dask/dask \
git+https://github.com/dask/dask-expr \
git+https://github.com/dask/distributed \
git+https://github.com/zarr-developers/zarr \
git+https://github.com/zarr-developers/zarr.git@main \
git+https://github.com/Unidata/cftime \
git+https://github.com/pypa/packaging \
git+https://github.com/hgrecco/pint \
Expand Down
7 changes: 2 additions & 5 deletions doc/_static/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ table.docutils td {
word-wrap: break-word;
}

div.bd-header-announcement {
background-color: unset;
color: #000;
.bd-header-announcement {
background-color: var(--pst-color-info-bg);
}

/* Reduce left and right margins */
Expand Down Expand Up @@ -222,8 +221,6 @@ main *:target::before {
}

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

Expand Down
2 changes: 1 addition & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@
Theme by the <a href="https://ebp.jupyterbook.org">Executable Book Project</a></p>""",
twitter_url="https://twitter.com/xarray_dev",
icon_links=[], # workaround for pydata/pydata-sphinx-theme#1220
announcement="🍾 <a href='https://github.com/pydata/xarray/discussions/8462'>Xarray is now 10 years old!</a> 🎉",
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>",
)


Expand Down
1 change: 1 addition & 0 deletions doc/ecosystem.rst
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ Extend xarray capabilities
- `Collocate <https://github.com/cistools/collocate>`_: Collocate xarray trajectories in arbitrary physical dimensions
- `eofs <https://ajdawson.github.io/eofs/>`_: EOF analysis in Python.
- `hypothesis-gufunc <https://hypothesis-gufunc.readthedocs.io/en/latest/>`_: Extension to hypothesis. Makes it easy to write unit tests with xarray objects as input.
- `ntv-pandas <https://github.com/loco-philippe/ntv-pandas>`_ : A tabular analyzer and a semantic, compact and reversible converter for multidimensional and tabular data
- `nxarray <https://github.com/nxarray/nxarray>`_: NeXus input/output capability for xarray.
- `xarray-compare <https://github.com/astropenguin/xarray-compare>`_: xarray extension for data comparison.
- `xarray-dataclasses <https://github.com/astropenguin/xarray-dataclasses>`_: xarray extension for typed DataArray and Dataset creation.
Expand Down
7 changes: 0 additions & 7 deletions doc/examples/multidimensional-coords.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -190,13 +190,6 @@
"\n",
"**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."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down
2 changes: 1 addition & 1 deletion doc/user-guide/computation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Use :py:func:`~xarray.where` to conditionally switch between values:
xr.where(arr > 0, "positive", "negative")
Use `@` to perform matrix multiplication:
Use `@` to compute the :py:func:`~xarray.dot` product:

.. ipython:: python
Expand Down
Loading

0 comments on commit 46a902f

Please sign in to comment.