Skip to content

Commit 5572930

Browse files
committed
Merge branch 'main' into grouper-public-api
* main: promote floating-point numeric datetimes to 64-bit before decoding (pydata#9182) also pin `numpy` in the all-but-dask CI (pydata#9184) temporarily remove `pydap` from CI (pydata#9183) temporarily pin `numpy<2` (pydata#9181) Change np.core.defchararray to np.char (pydata#9165) (pydata#9166) Fix example code formatting for CachingFileManager (pydata#9178) Slightly improve DataTree repr (pydata#9064) switch to unit `"D"` (pydata#9170) Docs: Add page with figure for navigating help resources (pydata#9147) Add test for pydata#9155 (pydata#9161) Remove mypy exclusions for a couple more libraries (pydata#9160) Include numbagg in type checks (pydata#9159) Improve zarr chunks docs (pydata#9140)
2 parents e250895 + 42ed6d3 commit 5572930

25 files changed

+273
-81
lines changed

ci/requirements/all-but-dask.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ dependencies:
2222
- netcdf4
2323
- numba
2424
- numbagg
25-
- numpy
25+
- numpy<2
2626
- packaging
2727
- pandas
2828
- pint>=0.22
2929
- pip
30-
- pydap
30+
# - pydap
3131
- pytest
3232
- pytest-cov
3333
- pytest-env

ci/requirements/doc.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ dependencies:
2121
- nbsphinx
2222
- netcdf4>=1.5
2323
- numba
24-
- numpy>=1.21
24+
- numpy>=1.21,<2
2525
- packaging>=21.3
2626
- pandas>=1.4,!=2.1.0
2727
- pooch
@@ -42,5 +42,6 @@ dependencies:
4242
- sphinxext-rediraffe
4343
- zarr>=2.10
4444
- pip:
45+
- sphinxcontrib-mermaid
4546
# relative to this file. Needs to be editable to be accepted.
4647
- -e ../..

ci/requirements/environment-windows.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ dependencies:
2323
- netcdf4
2424
- numba
2525
- numbagg
26-
- numpy
26+
- numpy<2
2727
- packaging
2828
- pandas
2929
# - pint>=0.22
3030
- pip
3131
- pre-commit
32-
- pydap
32+
# - pydap
3333
- pytest
3434
- pytest-cov
3535
- pytest-env

ci/requirements/environment.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ dependencies:
2626
- numba
2727
- numbagg
2828
- numexpr
29-
- numpy
29+
- numpy<2
3030
- opt_einsum
3131
- packaging
3232
- pandas
@@ -35,7 +35,7 @@ dependencies:
3535
- pooch
3636
- pre-commit
3737
- pyarrow # pandas raises a deprecation warning without this, breaking doctests
38-
- pydap
38+
# - pydap
3939
- pytest
4040
- pytest-cov
4141
- pytest-env

doc/conf.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
)
6060

6161
nbsphinx_allow_errors = False
62+
nbsphinx_requirejs_path = ""
6263

6364
# -- General configuration ------------------------------------------------
6465

@@ -68,7 +69,9 @@
6869
# Add any Sphinx extension module names here, as strings. They can be
6970
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
7071
# ones.
72+
7173
extensions = [
74+
"sphinxcontrib.mermaid",
7275
"sphinx.ext.autodoc",
7376
"sphinx.ext.autosummary",
7477
"sphinx.ext.intersphinx",
@@ -176,6 +179,8 @@
176179
"pd.NaT": "~pandas.NaT",
177180
}
178181

182+
# mermaid config
183+
mermaid_version = "10.9.1"
179184

180185
# Add any paths that contain templates here, relative to this directory.
181186
templates_path = ["_templates", sphinx_autosummary_accessors.templates_path]

doc/help-diagram.rst

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
Getting Help
2+
============
3+
4+
Navigating the wealth of resources available for Xarray can be overwhelming.
5+
We've created this flow chart to help guide you towards the best way to get help, depending on what you're working towards.
6+
The links to each resource are provided below the diagram.
7+
Regardless of how you interact with us, we're always thrilled to hear from you!
8+
9+
.. mermaid::
10+
:alt: Flowchart illustrating the different ways to access help using or contributing to Xarray.
11+
12+
flowchart TD
13+
intro[Welcome to Xarray! How can we help?]:::quesNodefmt
14+
usage(["fa:fa-chalkboard-user Xarray Tutorials
15+
fab:fa-readme Xarray Docs
16+
fab:fa-google Google/fab:fa-stack-overflow Stack Exchange
17+
fa:fa-robot Ask AI/a Language Learning Model (LLM)"]):::ansNodefmt
18+
API([fab:fa-readme Xarray Docs
19+
fab:fa-readme extension's docs]):::ansNodefmt
20+
help([fab:fa-github Xarray Discussions
21+
fab:fa-discord Xarray Discord
22+
fa:fa-users Xarray Office Hours
23+
fa:fa-globe Pangeo Discourse]):::ansNodefmt
24+
bug([Report and Propose here:
25+
fab:fa-github Xarray Issues]):::ansNodefmt
26+
contrib([fa:fa-book-open Xarray Contributor's Guide]):::ansNodefmt
27+
pr(["fab:fa-github Pull Request (PR)"]):::ansNodefmt
28+
dev([fab:fa-github Comment on your PR
29+
fa:fa-users Developer's Meeting]):::ansNodefmt
30+
report[Thanks for letting us know!]:::quesNodefmt
31+
merged[fa:fa-hands-clapping Your PR was merged.
32+
Thanks for contributing to Xarray!]:::quesNodefmt
33+
34+
35+
intro -->|How do I use Xarray?| usage
36+
usage -->|"with extensions (like Dask)"| API
37+
38+
usage -->|I'd like some more help| help
39+
intro -->|I found a bug| bug
40+
intro -->|I'd like to make a small change| contrib
41+
subgraph bugcontrib[Bugs and Contributions]
42+
bug
43+
contrib
44+
bug -->|I just wanted to tell you| report
45+
bug<-->|I'd like to fix the bug!| contrib
46+
pr -->|my PR was approved| merged
47+
end
48+
49+
50+
intro -->|I wish Xarray could...| bug
51+
52+
53+
pr <-->|my PR is quiet| dev
54+
contrib -->pr
55+
56+
classDef quesNodefmt fill:#9DEEF4,stroke:#206C89
57+
58+
classDef ansNodefmt fill:#FFAA05,stroke:#E37F17
59+
60+
classDef boxfmt fill:#FFF5ED,stroke:#E37F17
61+
class bugcontrib boxfmt
62+
63+
linkStyle default font-size:20pt,color:#206C89
64+
65+
66+
- `Xarray Tutorials <https://tutorial.xarray.dev/>`__
67+
- `Xarray Docs <https://docs.xarray.dev/en/stable/>`__
68+
- `Google/Stack Exchange <https://stackoverflow.com/questions/tagged/python-xarray>`__
69+
- `Xarray Discussions <https://github.com/pydata/xarray/discussions>`__
70+
- `Xarray Discord <https://discord.com/invite/wEKPCt4PDu>`__
71+
- `Xarray Office Hours <https://github.com/pydata/xarray/discussions/categories/office-hours>`__
72+
- `Pangeo Discourse <https://discourse.pangeo.io/>`__
73+
- `Xarray Issues <https://github.com/pydata/xarray/issues>`__
74+
- `Xarray Contributors Guide <https://docs.xarray.dev/en/stable/contributing.html>`__
75+
- `Developer's Meeting <https://docs.xarray.dev/en/stable/developers-meeting.html>`__

doc/index.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ efficient, and fun!
1414
`Releases <https://github.com/pydata/xarray/releases>`__ |
1515
`Stack Overflow <https://stackoverflow.com/questions/tagged/python-xarray>`__ |
1616
`Mailing List <https://groups.google.com/g/xarray>`__ |
17-
`Blog <https://xarray.dev/blog>`__
17+
`Blog <https://xarray.dev/blog>`__ |
18+
`Tutorials <https://tutorial.xarray.dev/>`__
1819

1920

2021
.. grid:: 1 1 2 2
@@ -65,6 +66,7 @@ efficient, and fun!
6566
Tutorials & Videos <tutorials-and-videos>
6667
API Reference <api>
6768
How do I ... <howdoi>
69+
Getting Help <help-diagram>
6870
Ecosystem <ecosystem>
6971

7072
.. toctree::

doc/whats-new.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,20 @@ Deprecations
3535

3636
Bug fixes
3737
~~~~~~~~~
38+
- Make :py:func:`testing.assert_allclose` work with numpy 2.0 (:issue:`9165`, :pull:`9166`).
39+
By `Pontus Lurcock <https://github.com/pont-us>`_.
40+
- Promote floating-point numeric datetimes before decoding (:issue:`9179`, :pull:`9182`).
41+
By `Justus Magin <https://github.com/keewis>`_.
3842

3943

4044
Documentation
4145
~~~~~~~~~~~~~
4246

47+
- Adds a flow-chart diagram to help users navigate help resources (`Discussion #8990 <https://github.com/pydata/xarray/discussions/8990>`_).
48+
By `Jessica Scheick <https://github.com/jessicas11>`_.
49+
- Improvements to Zarr & chunking docs (:pull:`9139`, :pull:`9140`, :pull:`9132`)
50+
By `Maximilian Roos <https://github.com/max-sixty>`_
51+
4352

4453
Internal Changes
4554
~~~~~~~~~~~~~~~~

pyproject.toml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -110,15 +110,12 @@ module = [
110110
"cloudpickle.*",
111111
"cubed.*",
112112
"cupy.*",
113-
"dask.types.*",
114113
"fsspec.*",
115114
"h5netcdf.*",
116115
"h5py.*",
117116
"iris.*",
118-
"matplotlib.*",
119117
"mpl_toolkits.*",
120118
"nc_time_axis.*",
121-
"numbagg.*",
122119
"netCDF4.*",
123120
"netcdftime.*",
124121
"opt_einsum.*",
@@ -127,7 +124,6 @@ module = [
127124
"pooch.*",
128125
"pyarrow.*",
129126
"pydap.*",
130-
"pytest.*",
131127
"scipy.*",
132128
"seaborn.*",
133129
"setuptools",
@@ -329,8 +325,7 @@ filterwarnings = [
329325
"default:the `pandas.MultiIndex` object:FutureWarning:xarray.tests.test_variable",
330326
"default:Using a non-tuple sequence for multidimensional indexing is deprecated:FutureWarning",
331327
"default:Duplicate dimension names present:UserWarning:xarray.namedarray.core",
332-
"default:::xarray.tests.test_strategies",
333-
# TODO: remove once we know how to deal with a changed signature in protocols
328+
"default:::xarray.tests.test_strategies", # TODO: remove once we know how to deal with a changed signature in protocols
334329
"ignore:__array__ implementation doesn't accept a copy keyword, so passing copy=False failed.",
335330
]
336331

xarray/backends/api.py

Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -425,15 +425,19 @@ def open_dataset(
425425
is chosen based on available dependencies, with a preference for
426426
"netcdf4". A custom backend class (a subclass of ``BackendEntrypoint``)
427427
can also be used.
428-
chunks : int, dict, 'auto' or None, optional
429-
If chunks is provided, it is used to load the new dataset into dask
430-
arrays. ``chunks=-1`` loads the dataset with dask using a single
431-
chunk for all arrays. ``chunks={}`` loads the dataset with dask using
432-
engine preferred chunks if exposed by the backend, otherwise with
433-
a single chunk for all arrays. In order to reproduce the default behavior
434-
of ``xr.open_zarr(...)`` use ``xr.open_dataset(..., engine='zarr', chunks={})``.
435-
``chunks='auto'`` will use dask ``auto`` chunking taking into account the
436-
engine preferred chunks. See dask chunking for more details.
428+
chunks : int, dict, 'auto' or None, default: None
429+
If provided, used to load the data into dask arrays.
430+
431+
- ``chunks="auto"`` will use dask ``auto`` chunking taking into account the
432+
engine preferred chunks.
433+
- ``chunks=None`` skips using dask, which is generally faster for
434+
small arrays.
435+
- ``chunks=-1`` loads the data with dask using a single chunk for all arrays.
436+
- ``chunks={}`` loads the data with dask using the engine's preferred chunk
437+
size, generally identical to the format's chunk size. If not available, a
438+
single chunk for all arrays.
439+
440+
See dask chunking for more details.
437441
cache : bool, optional
438442
If True, cache data loaded from the underlying datastore in memory as
439443
NumPy arrays when accessed to avoid reading from the underlying data-
@@ -631,14 +635,19 @@ def open_dataarray(
631635
Engine to use when reading files. If not provided, the default engine
632636
is chosen based on available dependencies, with a preference for
633637
"netcdf4".
634-
chunks : int, dict, 'auto' or None, optional
635-
If chunks is provided, it is used to load the new dataset into dask
636-
arrays. ``chunks=-1`` loads the dataset with dask using a single
637-
chunk for all arrays. `chunks={}`` loads the dataset with dask using
638-
engine preferred chunks if exposed by the backend, otherwise with
639-
a single chunk for all arrays.
640-
``chunks='auto'`` will use dask ``auto`` chunking taking into account the
641-
engine preferred chunks. See dask chunking for more details.
638+
chunks : int, dict, 'auto' or None, default: None
639+
If provided, used to load the data into dask arrays.
640+
641+
- ``chunks='auto'`` will use dask ``auto`` chunking taking into account the
642+
engine preferred chunks.
643+
- ``chunks=None`` skips using dask, which is generally faster for
644+
small arrays.
645+
- ``chunks=-1`` loads the data with dask using a single chunk for all arrays.
646+
- ``chunks={}`` loads the data with dask using engine preferred chunks if
647+
exposed by the backend, otherwise with a single chunk for all arrays.
648+
649+
See dask chunking for more details.
650+
642651
cache : bool, optional
643652
If True, cache data loaded from the underlying datastore in memory as
644653
NumPy arrays when accessed to avoid reading from the underlying data-

0 commit comments

Comments
 (0)