Skip to content

Commit f4ff04c

Browse files
committed
Merge remote-tracking branch 'upstream/main' into flox-doc
* upstream/main: RTD maintenance (pydata#7477) fix the RTD build skipping feature (pydata#7476) Add benchmarks for to_dataframe and to_dask_dataframe (pydata#7474) allow skipping RTD builds (pydata#7470) create separate environment files for `python=3.11` (pydata#7469) Bump mamba-org/provision-with-micromamba from 14 to 15 (pydata#7466) install `numbagg` from `conda-forge` (pydata#7415) Fill missing data_vars during concat by reindexing (pydata#7400) [skip-cii] Add pyodide update instructions to HOW_TO_RELEASE (pydata#7449) [skip-ci] whats-new for next release (pydata#7455) v2023.01.0 whats-new (pydata#7440)
2 parents 230eac9 + f128f24 commit f4ff04c

17 files changed

+662
-55
lines changed

.github/workflows/benchmarks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
fetch-depth: 0
2323

2424
- name: Set up conda environment
25-
uses: mamba-org/provision-with-micromamba@v14
25+
uses: mamba-org/provision-with-micromamba@v15
2626
with:
2727
environment-file: ${{env.CONDA_ENV_FILE}}
2828
environment-name: xarray-tests

.github/workflows/ci-additional.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
echo "TODAY=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
5454
5555
- name: Setup micromamba
56-
uses: mamba-org/provision-with-micromamba@v14
56+
uses: mamba-org/provision-with-micromamba@v15
5757
with:
5858
environment-file: ${{env.CONDA_ENV_FILE}}
5959
environment-name: xarray-tests
@@ -100,7 +100,7 @@ jobs:
100100
run: |
101101
echo "TODAY=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
102102
- name: Setup micromamba
103-
uses: mamba-org/provision-with-micromamba@v14
103+
uses: mamba-org/provision-with-micromamba@v15
104104
with:
105105
environment-file: ${{env.CONDA_ENV_FILE}}
106106
environment-name: xarray-tests
@@ -156,7 +156,7 @@ jobs:
156156
run: |
157157
echo "TODAY=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
158158
- name: Setup micromamba
159-
uses: mamba-org/provision-with-micromamba@v14
159+
uses: mamba-org/provision-with-micromamba@v15
160160
with:
161161
environment-file: ${{env.CONDA_ENV_FILE}}
162162
environment-name: xarray-tests
@@ -212,7 +212,7 @@ jobs:
212212
fetch-depth: 0 # Fetch all history for all branches and tags.
213213

214214
- name: Setup micromamba
215-
uses: mamba-org/provision-with-micromamba@v14
215+
uses: mamba-org/provision-with-micromamba@v15
216216
with:
217217
environment-name: xarray-tests
218218
environment-file: false

.github/workflows/ci.yaml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
matrix:
4343
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
4444
# Bookend python versions
45-
python-version: ["3.8", "3.10"]
45+
python-version: ["3.8", "3.10", "3.11"]
4646
env: [""]
4747
include:
4848
# Minimum python version:
@@ -67,7 +67,13 @@ jobs:
6767
run: |
6868
echo "TODAY=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
6969
70-
if [[ ${{ matrix.os }} == windows* ]] ;
70+
if [[ "${{matrix.python-version}}" == "3.11" ]]; then
71+
if [[ ${{matrix.os}} == windows* ]]; then
72+
echo "CONDA_ENV_FILE=ci/requirements/environment-windows-py311.yml" >> $GITHUB_ENV
73+
else
74+
echo "CONDA_ENV_FILE=ci/requirements/environment-py311.yml" >> $GITHUB_ENV
75+
fi
76+
elif [[ ${{ matrix.os }} == windows* ]] ;
7177
then
7278
echo "CONDA_ENV_FILE=ci/requirements/environment-windows.yml" >> $GITHUB_ENV
7379
elif [[ "${{ matrix.env }}" != "" ]] ;
@@ -86,7 +92,7 @@ jobs:
8692
echo "PYTHON_VERSION=${{ matrix.python-version }}" >> $GITHUB_ENV
8793
8894
- name: Setup micromamba
89-
uses: mamba-org/provision-with-micromamba@v14
95+
uses: mamba-org/provision-with-micromamba@v15
9096
with:
9197
environment-file: ${{ env.CONDA_ENV_FILE }}
9298
environment-name: xarray-tests

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454
with:
5555
fetch-depth: 0 # Fetch all history for all branches and tags.
5656
- name: Set up conda environment
57-
uses: mamba-org/provision-with-micromamba@v14
57+
uses: mamba-org/provision-with-micromamba@v15
5858
with:
5959
environment-file: ci/requirements/environment.yml
6060
environment-name: xarray-tests

.readthedocs.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
version: 2
22

33
build:
4-
os: ubuntu-20.04
4+
os: ubuntu-22.04
55
tools:
66
python: mambaforge-4.10
7+
jobs:
8+
post_checkout:
9+
- (git --no-pager log --pretty="tformat:%s" -1 | grep -vqF "[skip-rtd]") || exit 183
10+
pre_install:
11+
- git update-index --assume-unchanged doc/conf.py ci/requirements/doc.yml
712

813
conda:
914
environment: ci/requirements/doc.yml

HOW_TO_RELEASE.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,15 @@ upstream https://github.com/pydata/xarray (push)
9292
```
9393
You're done pushing to main!
9494

95-
13. Issue the release announcement to mailing lists & Twitter. For bug fix releases, I
95+
13. Update the version available on pyodide:
96+
- Open the PyPI page for [Xarray downloads](https://pypi.org/project/xarray/#files)
97+
- Clone the [pyodide repository](https://github.com/pyodide/pyodide).
98+
- Edit `packages/xarray/meta.yaml` to update the
99+
- link to the wheel (under "Built Distribution" on the PyPI page)
100+
- SHA256 hash (Click "Show Hashes" next to the link to the wheel)
101+
- Open a pull request to pyodide
102+
103+
14. Issue the release announcement to mailing lists & Twitter. For bug fix releases, I
96104
usually only email [email protected]. For major/feature releases, I will email a broader
97105
list (no more than once every 3-6 months):
98106

asv_bench/benchmarks/pandas.py

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
import xarray as xr
55

6-
from . import parameterized
6+
from . import parameterized, requires_dask
77

88

99
class MultiIndexSeries:
@@ -24,3 +24,38 @@ def setup(self, dtype, subset):
2424
@parameterized(["dtype", "subset"], ([int, float], [True, False]))
2525
def time_from_series(self, dtype, subset):
2626
xr.DataArray.from_series(self.series)
27+
28+
29+
class ToDataFrame:
30+
def setup(self, *args, **kwargs):
31+
xp = kwargs.get("xp", np)
32+
random_kws = kwargs.get("random_kws", {})
33+
method = kwargs.get("method", "to_dataframe")
34+
35+
dim1 = 10_000
36+
dim2 = 10_000
37+
ds = xr.Dataset(
38+
{
39+
"x": xr.DataArray(
40+
data=xp.random.random((dim1, dim2), **random_kws),
41+
dims=["dim1", "dim2"],
42+
coords={"dim1": np.arange(0, dim1), "dim2": np.arange(0, dim2)},
43+
)
44+
}
45+
)
46+
self.to_frame = getattr(ds, method)
47+
48+
def time_to_dataframe(self):
49+
self.to_frame()
50+
51+
def peakmem_to_dataframe(self):
52+
self.to_frame()
53+
54+
55+
class ToDataFrameDask(ToDataFrame):
56+
def setup(self, *args, **kwargs):
57+
requires_dask()
58+
59+
import dask.array as da
60+
61+
super().setup(xp=da, random_kws=dict(chunks=5000), method="to_dask_dataframe")

ci/requirements/all-but-dask.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ dependencies:
2323
- nc-time-axis
2424
- netcdf4
2525
- numba
26-
- numpy
26+
- numbagg
27+
- numpy<1.24
2728
- packaging
2829
- pandas
2930
- pint
@@ -41,5 +42,3 @@ dependencies:
4142
- toolz
4243
- typing_extensions
4344
- zarr
44-
- pip:
45-
- numbagg

ci/requirements/doc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ dependencies:
1818
- nbsphinx
1919
- netcdf4>=1.5
2020
- numba
21-
- numpy>=1.20
21+
- numpy>=1.20,<1.24
2222
- packaging>=21.0
2323
- pandas>=1.3
2424
- pooch

ci/requirements/environment-py311.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: xarray-tests
2+
channels:
3+
- conda-forge
4+
- nodefaults
5+
dependencies:
6+
- aiobotocore
7+
- boto3
8+
- bottleneck
9+
- cartopy
10+
# - cdms2
11+
- cfgrib
12+
- cftime
13+
- dask-core
14+
- distributed
15+
- flox
16+
- fsspec!=2021.7.0
17+
- h5netcdf
18+
- h5py
19+
- hdf5
20+
- hypothesis
21+
- iris
22+
- lxml # Optional dep of pydap
23+
- matplotlib-base
24+
- nc-time-axis
25+
- netcdf4
26+
# - numba
27+
# - numbagg
28+
- numexpr
29+
- numpy
30+
- packaging
31+
- pandas
32+
- pint
33+
- pip
34+
- pooch
35+
- pre-commit
36+
- pseudonetcdf
37+
- pydap
38+
- pytest
39+
- pytest-cov
40+
- pytest-env
41+
- pytest-xdist
42+
- rasterio
43+
- scipy
44+
- seaborn
45+
# - sparse
46+
- toolz
47+
- typing_extensions
48+
- zarr
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: xarray-tests
2+
channels:
3+
- conda-forge
4+
dependencies:
5+
- boto3
6+
- bottleneck
7+
- cartopy
8+
# - cdms2 # Not available on Windows
9+
# - cfgrib # Causes Python interpreter crash on Windows: https://github.com/pydata/xarray/pull/3340
10+
- cftime
11+
- dask-core
12+
- distributed
13+
- flox
14+
- fsspec!=2021.7.0
15+
- h5netcdf
16+
- h5py
17+
- hdf5
18+
- hypothesis
19+
- iris
20+
- lxml # Optional dep of pydap
21+
- matplotlib-base
22+
- nc-time-axis
23+
- netcdf4
24+
# - numba
25+
# - numbagg
26+
- numpy
27+
- packaging
28+
- pandas
29+
- pint
30+
- pip
31+
- pre-commit
32+
- pseudonetcdf
33+
- pydap
34+
- pytest
35+
- pytest-cov
36+
- pytest-env
37+
- pytest-xdist
38+
- rasterio
39+
- scipy
40+
- seaborn
41+
# - sparse
42+
- toolz
43+
- typing_extensions
44+
- zarr

ci/requirements/environment-windows.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ dependencies:
2222
- nc-time-axis
2323
- netcdf4
2424
- numba
25-
- numpy
25+
- numbagg
26+
- numpy<1.24
2627
- packaging
2728
- pandas
2829
- pint
@@ -41,5 +42,3 @@ dependencies:
4142
- toolz
4243
- typing_extensions
4344
- zarr
44-
- pip:
45-
- numbagg

ci/requirements/environment.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@ dependencies:
2424
- nc-time-axis
2525
- netcdf4
2626
- numba
27+
- numbagg
2728
- numexpr
28-
- numpy
29+
- numpy<1.24
2930
- packaging
3031
- pandas
3132
- pint
@@ -45,5 +46,3 @@ dependencies:
4546
- toolz
4647
- typing_extensions
4748
- zarr
48-
- pip:
49-
- numbagg

doc/whats-new.rst

Lines changed: 33 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ What's New
1515
np.random.seed(123456)
1616
1717
18-
.. _whats-new.2022.12.1:
18+
.. _whats-new.2023.01.1:
1919

20-
v2022.12.1 (unreleased)
20+
v2023.01.1 (unreleased)
2121
-----------------------
2222

2323
New Features
@@ -27,14 +27,42 @@ New Features
2727
Breaking changes
2828
~~~~~~~~~~~~~~~~
2929

30-
- :py:meth:`CFTimeIndex.get_loc` has removed the ``method`` and ``tolerance`` keyword arguments.
31-
Use ``.get_indexer([key], method=..., tolerance=...)`` instead (:pull:`7361`).
32-
By `Matthew Roeschke <https://github.com/mroeschke>`_.
3330

3431
Deprecations
3532
~~~~~~~~~~~~
3633

3734

35+
Bug fixes
36+
~~~~~~~~~
37+
38+
- :py:func:`xarray.concat` can now concatenate variables present in some datasets but
39+
not others (:issue:`508`, :pull:`7400`).
40+
By `Kai Mühlbauer <https://github.com/kmuehlbauer>`_ and `Scott Chamberlin <https://github.com/scottcha>`_.
41+
42+
Documentation
43+
~~~~~~~~~~~~~
44+
45+
46+
Internal Changes
47+
~~~~~~~~~~~~~~~~
48+
49+
50+
.. _whats-new.2023.01.0:
51+
52+
v2023.01.0 (Jan 17, 2023)
53+
-------------------------
54+
55+
This release includes a number of bug fixes. Thanks to the 14 contributors to this release:
56+
Aron Gergely, Benoit Bovy, Deepak Cherian, Ian Carroll, Illviljan, Joe Hamman, Justus Magin, Mark Harfouche,
57+
Matthew Roeschke, Paige Martin, Pierre, Sam Levang, Tom White, stefank0.
58+
59+
Breaking changes
60+
~~~~~~~~~~~~~~~~
61+
62+
- :py:meth:`CFTimeIndex.get_loc` has removed the ``method`` and ``tolerance`` keyword arguments.
63+
Use ``.get_indexer([key], method=..., tolerance=...)`` instead (:pull:`7361`).
64+
By `Matthew Roeschke <https://github.com/mroeschke>`_.
65+
3866
Bug fixes
3967
~~~~~~~~~
4068

@@ -51,10 +79,6 @@ Bug fixes
5179
- Preserve original dtype on accessing MultiIndex levels (:issue:`7250`,
5280
:pull:`7393`). By `Ian Carroll <https://github.com/itcarroll>`_.
5381

54-
Documentation
55-
~~~~~~~~~~~~~
56-
57-
5882
Internal Changes
5983
~~~~~~~~~~~~~~~~
6084
- Add the pre-commit hook `absolufy-imports` to convert relative xarray imports to

setup.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ classifiers =
6767
Programming Language :: Python :: 3.8
6868
Programming Language :: Python :: 3.9
6969
Programming Language :: Python :: 3.10
70+
Programming Language :: Python :: 3.11
7071
Topic :: Scientific/Engineering
7172

7273
[options]

0 commit comments

Comments
 (0)