Skip to content

Commit 16e29e2

Browse files
authored
Merge branch 'main' into fix-6220-use-fast-path-when-grouping-unique-monotonic-variable
2 parents 939b9b8 + ec1d328 commit 16e29e2

Some content is hidden

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

73 files changed

+1116
-418
lines changed

.pre-commit-config.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ repos:
1616
files: ^xarray/
1717
- repo: https://github.com/charliermarsh/ruff-pre-commit
1818
# Ruff version.
19-
rev: 'v0.0.237'
19+
rev: 'v0.0.248'
2020
hooks:
2121
- id: ruff
2222
args: ["--fix"]
2323
# https://github.com/python/black#version-control-integration
2424
- repo: https://github.com/psf/black
25-
rev: 22.12.0
25+
rev: 23.1.0
2626
hooks:
2727
- id: black
2828
- id: black-jupyter
@@ -31,10 +31,10 @@ repos:
3131
hooks:
3232
- id: blackdoc
3333
exclude: "generate_aggregations.py"
34-
additional_dependencies: ["black==22.12.0"]
34+
additional_dependencies: ["black==23.1.0"]
3535
- id: blackdoc-autoupdate-black
3636
- repo: https://github.com/pre-commit/mirrors-mypy
37-
rev: v0.991
37+
rev: v1.0.1
3838
hooks:
3939
- id: mypy
4040
# Copied from setup.cfg

HOW_TO_RELEASE.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ upstream https://github.com/pydata/xarray (push)
5959
.. _whats-new.YYYY.MM.X+1:
6060
6161
vYYYY.MM.X+1 (unreleased)
62-
---------------------
62+
-----------------------
6363
6464
New Features
6565
~~~~~~~~~~~~
@@ -94,8 +94,8 @@ upstream https://github.com/pydata/xarray (push)
9494

9595
13. Update the version available on pyodide:
9696
- 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
97+
- Edit [`pyodide/packages/xarray/meta.yaml`](https://github.com/pyodide/pyodide/blob/main/packages/xarray/meta.yaml) to update the
98+
- version number
9999
- link to the wheel (under "Built Distribution" on the PyPI page)
100100
- SHA256 hash (Click "Show Hashes" next to the link to the wheel)
101101
- Open a pull request to pyodide

doc/_static/dataset-diagram-logo.pdf

13 KB
Binary file not shown.

doc/_static/dataset-diagram-logo.svg

+484
Loading

doc/_static/dataset-diagram-logo.tex

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1-
\documentclass[class=minimal,border=0pt,convert={size=600,outext=.png}]{standalone}
1+
% For svg output:
2+
% 1. Use second \documentclass line.
3+
% 2. Install potrace : mamba install -c bioconda potrace
4+
% As of Feb 14, 2023: svg does not work. PDF does work
5+
% \documentclass[class=minimal,border=0pt,convert={size=600,outext=.png}]{standalone}
6+
\documentclass[class=minimal,border=0pt,convert={size=600,outext=.svg}]{standalone}
27
% \documentclass[class=minimal,border=0pt]{standalone}
38
\usepackage[scaled]{helvet}
9+
\usepackage[T1]{fontenc}
410
\renewcommand*\familydefault{\sfdefault}
511

612
% ===========================================================================

doc/conf.py

-1
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,6 @@ def update_videos(app: Sphinx):
436436

437437
items = []
438438
for video in videos:
439-
440439
authors = " | ".join(video["authors"])
441440
item = f"""
442441
.. grid-item-card:: {" ".join(video["title"].split())}

doc/examples/apply_ufunc_vectorize_1d.ipynb

-1
Original file line numberDiff line numberDiff line change
@@ -663,7 +663,6 @@
663663
"\n",
664664
"\n",
665665
"def xr_interp(data, dim, newdim):\n",
666-
"\n",
667666
" interped = xr.apply_ufunc(\n",
668667
" interp1d_np_gufunc, # first the function\n",
669668
" data, # now arguments in the order expected by 'interp1_np'\n",

doc/whats-new.rst

+48-8
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,51 @@ What's New
1515
np.random.seed(123456)
1616
1717
18-
.. _whats-new.2023.01.1:
18+
.. _whats-new.2023.03.0:
1919

20-
v2023.01.1 (unreleased)
20+
v2023.03.0 (unreleased)
2121
-----------------------
2222

2323
New Features
2424
~~~~~~~~~~~~
2525

26+
- Fix :py:meth:`xr.cov` and :py:meth:`xr.corr` now support complex valued arrays (:issue:`7340`, :pull:`7392`).
27+
By `Michael Niklas <https://github.com/headtr1ck>`_.
28+
29+
Breaking changes
30+
~~~~~~~~~~~~~~~~
31+
32+
33+
Deprecations
34+
~~~~~~~~~~~~
35+
36+
37+
Bug fixes
38+
~~~~~~~~~
39+
- Require to explicitly defining optional dimensions such as hue
40+
and markersize for scatter plots. (:issue:`7314`, :pull:`7277`).
41+
By `Jimmy Westling <https://github.com/illviljan>`_.
42+
- Fix matplotlib raising a UserWarning when plotting a scatter plot
43+
with an unfilled marker (:issue:`7313`, :pull:`7318`).
44+
By `Jimmy Westling <https://github.com/illviljan>`_.
45+
46+
Documentation
47+
~~~~~~~~~~~~~
48+
49+
50+
Internal Changes
51+
~~~~~~~~~~~~~~~~
52+
53+
54+
.. _whats-new.2023.02.0:
55+
56+
v2023.02.0 (Feb 7, 2023)
57+
------------------------
58+
59+
This release brings a major upgrade to :py:func:`xarray.concat`, many bug fixes,
60+
and a bump in supported dependency versions. Thanks to our 11 contributors:
61+
Aron Gergely, Deepak Cherian, Illviljan, James Bourbeau, Joe Hamman,
62+
Justus Magin, Hauke Schulz, Kai Mühlbauer, Ken Mankoff, Spencer Clark, Tom Nicholas.
2663

2764
Breaking changes
2865
~~~~~~~~~~~~~~~~
@@ -45,7 +82,10 @@ Breaking changes
4582

4683
Deprecations
4784
~~~~~~~~~~~~
48-
85+
- Following pandas, the `closed` parameters of :py:func:`cftime_range` and
86+
:py:func:`date_range` are deprecated in favor of the `inclusive` parameters,
87+
and will be removed in a future version of xarray (:issue:`6985`:,
88+
:pull:`7373`). By `Spencer Clark <https://github.com/spencerkclark>`_.
4989

5090
Enhancements
5191
~~~~~~~~~~~
@@ -55,22 +95,22 @@ Enhancements
5595

5696
Bug fixes
5797
~~~~~~~~~
58-
5998
- :py:func:`xarray.concat` can now concatenate variables present in some datasets but
6099
not others (:issue:`508`, :pull:`7400`).
61100
By `Kai Mühlbauer <https://github.com/kmuehlbauer>`_ and `Scott Chamberlin <https://github.com/scottcha>`_.
62101
- Handle ``keep_attrs`` option in binary operators of :py:meth:`Dataset` (:issue:`7390`, :pull:`7391`).
63102
By `Aron Gergely <https://github.com/arongergely>`_.
103+
- Improve error message when using dask in :py:func:`apply_ufunc` with ``output_sizes`` not supplied. (:pull:`7509`)
104+
By `Tom Nicholas <https://github.com/TomNicholas>`_.
105+
- :py:func:`xarray.Dataset.to_zarr` now drops variable encodings that have been added by xarray during reading
106+
a dataset. (:issue:`7129`, :pull:`7500`).
107+
By `Hauke Schulz <https://github.com/observingClouds>`_.
64108

65109
Documentation
66110
~~~~~~~~~~~~~
67-
68111
- Mention the `flox package <https://flox.readthedocs.io>`_ in GroupBy documentation and docstrings.
69112
By `Deepak Cherian <https://github.com/dcherian>`_.
70113

71-
Internal Changes
72-
~~~~~~~~~~~~~~~~
73-
74114

75115
.. _whats-new.2023.01.0:
76116

xarray/backends/cfgrib_.py

-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ def open_dataset(
119119
squeeze=True,
120120
time_dims=("time", "step"),
121121
):
122-
123122
filename_or_obj = _normalize_path(filename_or_obj)
124123
store = CfGribDataStore(
125124
filename_or_obj,

xarray/backends/h5netcdf_.py

-1
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,6 @@ def open_dataset(
401401
phony_dims=None,
402402
decode_vlen_strings=True,
403403
):
404-
405404
filename_or_obj = _normalize_path(filename_or_obj)
406405
store = H5NetCDFStore.open(
407406
filename_or_obj,

xarray/backends/netCDF4_.py

-1
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,6 @@ def open_dataset(
573573
lock=None,
574574
autoclose=False,
575575
):
576-
577576
filename_or_obj = _normalize_path(filename_or_obj)
578577
store = NetCDF4DataStore.open(
579578
filename_or_obj,

xarray/backends/pseudonetcdf_.py

-1
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,6 @@ def open_dataset(
156156
lock=None,
157157
**format_kwargs,
158158
):
159-
160159
filename_or_obj = _normalize_path(filename_or_obj)
161160
store = PseudoNetCDFDataStore.open(
162161
filename_or_obj, lock=lock, mode=mode, **format_kwargs

xarray/backends/pydap_.py

-1
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,6 @@ def open_dataset(
178178
verify=None,
179179
user_charset=None,
180180
):
181-
182181
store = PydapDataStore.open(
183182
url=filename_or_obj,
184183
application=application,

xarray/backends/scipy_.py

-2
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,6 @@ class ScipyBackendEntrypoint(BackendEntrypoint):
266266
url = "https://docs.xarray.dev/en/stable/generated/xarray.backends.ScipyBackendEntrypoint.html"
267267

268268
def guess_can_open(self, filename_or_obj):
269-
270269
magic_number = try_read_magic_number_from_file_or_path(filename_or_obj)
271270
if magic_number is not None and magic_number.startswith(b"\x1f\x8b"):
272271
with gzip.open(filename_or_obj) as f:
@@ -296,7 +295,6 @@ def open_dataset(
296295
mmap=None,
297296
lock=None,
298297
):
299-
300298
filename_or_obj = _normalize_path(filename_or_obj)
301299
store = ScipyDataStore(
302300
filename_or_obj, mode=mode, format=format, group=group, mmap=mmap, lock=lock

xarray/backends/zarr.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ def extract_zarr_variable_encoding(
230230
"""
231231
encoding = variable.encoding.copy()
232232

233+
safe_to_drop = {"source", "original_shape"}
233234
valid_encodings = {
234235
"chunks",
235236
"compressor",
@@ -238,6 +239,10 @@ def extract_zarr_variable_encoding(
238239
"write_empty_chunks",
239240
}
240241

242+
for k in safe_to_drop:
243+
if k in encoding:
244+
del encoding[k]
245+
241246
if raise_on_invalid:
242247
invalid = [k for k in encoding if k not in valid_encodings]
243248
if invalid:
@@ -882,7 +887,6 @@ def open_dataset(
882887
stacklevel=3,
883888
zarr_version=None,
884889
):
885-
886890
filename_or_obj = _normalize_path(filename_or_obj)
887891
store = ZarrStore.open_group(
888892
filename_or_obj,

0 commit comments

Comments
 (0)