Skip to content

Commit 50d97e9

Browse files
alexamiciaurghs
andauthored
Switch backend API to v2 (#4989)
* Switch backend API to v2 and drop v1 * Remove APIv1 functions now unused * Clean up imports * Fix code style * fix open_dataset documentation * fix open_dataarray doc * Remove stale test on removed functions * Fix entry point definition * Fix API documentation errors. * Add informative error message when using positional arguments * Add `*args` check to `open_dataarray` as well * Add whats-new entries Co-authored-by: Aureliana Barghini <[email protected]>
1 parent d2582c2 commit 50d97e9

File tree

9 files changed

+288
-623
lines changed

9 files changed

+288
-623
lines changed

.github/workflows/ci-additional.yaml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ jobs:
4242
"py37-min-all-deps",
4343
"py37-min-nep18",
4444
"py38-all-but-dask",
45-
"py38-backend-api-v2",
4645
"py38-flaky",
4746
]
4847
steps:
@@ -56,12 +55,7 @@ jobs:
5655

5756
- name: Set environment variables
5857
run: |
59-
if [[ ${{ matrix.env }} == "py38-backend-api-v2" ]] ;
60-
then
61-
echo "CONDA_ENV_FILE=ci/requirements/environment.yml" >> $GITHUB_ENV
62-
echo "XARRAY_BACKEND_API=v2" >> $GITHUB_ENV
63-
64-
elif [[ ${{ matrix.env }} == "py38-flaky" ]] ;
58+
if [[ ${{ matrix.env }} == "py38-flaky" ]] ;
6559
then
6660
echo "CONDA_ENV_FILE=ci/requirements/environment.yml" >> $GITHUB_ENV
6761
echo "PYTEST_EXTRA_FLAGS=--run-flaky --run-network-tests" >> $GITHUB_ENV

doc/internals.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,7 @@ re-open it directly with Zarr:
249249
print(zgroup.tree())
250250
dict(zgroup["Tair"].attrs)
251251
252+
.. _add_a_backend:
252253

253254
How to add a new backend
254255
------------------------

doc/whats-new.rst

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,22 +27,34 @@ New Features
2727
- Support for `dask.graph_manipulation
2828
<https://docs.dask.org/en/latest/graph_manipulation.html>`_ (requires dask >=2021.3)
2929
By `Guido Imperiale <https://github.com/crusaderky>`_
30+
- Thanks to the new pluggable backend infrastructure external packages may now
31+
use the ``xarray.backends`` entry point to register additional engines to be used in
32+
:py:func:`open_dataset`, see the documentation in :ref:`add_a_backend`
33+
(:issue:`4309`, :issue:`4803`, :pull:`4989`, :pull:`4810` and many others).
34+
The backend refactor has been sponsored with the "Essential Open Source Software for Science"
35+
grant from the `Chan Zuckerberg Initiative <https://chanzuckerberg.com>`_ and
36+
developed by `B-Open <https://www.bopen.eu>`_.
37+
By `Aureliana Barghini <https://github.com/aurghs>`_ and `Alessandro Amici <https://github.com/alexamici>`_.
3038

3139
Breaking changes
3240
~~~~~~~~~~~~~~~~
33-
41+
- :py:func:`open_dataset` and :py:func:`open_dataarray` now accept only the first argument
42+
as positional, all others need to be passed are keyword arguments. This is part of the
43+
refactor to support external backends (:issue:`4309`, :pull:`4989`).
44+
By `Alessandro Amici <https://github.com/alexamici>`_.
3445

3546
Deprecations
3647
~~~~~~~~~~~~
3748

38-
3949
Bug fixes
4050
~~~~~~~~~
4151
- Don't allow passing ``axis`` to :py:meth:`Dataset.reduce` methods (:issue:`3510`, :pull:`4940`).
4252
By `Justus Magin <https://github.com/keewis>`_.
4353

4454
Documentation
4555
~~~~~~~~~~~~~
56+
- New section on :ref:`add_a_backend` in the "Internals" chapter aimed to backend developers
57+
(:issue:`4803`, :pull:`4810`). By `Aureliana Barghini <https://github.com/aurghs>`_.
4658

4759

4860
Internal Changes

0 commit comments

Comments
 (0)