From 822226539506aa97078708ad4de54ec79ca2db8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kai=20M=C3=BChlbauer?= Date: Wed, 28 Oct 2026 14:41:16 +0100 Subject: [PATCH 1/2] promote xarray's FutureWarning to error in notebooks test suite --- docs/history.md | 3 ++- docs/notebooks/conftest.py | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/history.md b/docs/history.md index 4e438ed9..f3a5cae6 100644 --- a/docs/history.md +++ b/docs/history.md @@ -15,7 +15,8 @@ * FIX: IRIS ``range`` attributes ``meters_between_gates`` (was half the gate spacing in centimetres, 50x too large) and ``meters_to_center_of_first_gate`` (was the header's first bin in centimetres) are in metres and match the ``range`` coordinate, also in CfRadial exports; with variable bin spacing in the header there is no ``meters_between_gates``; ``range`` is computed in float64 and rounded to float32 once, which removes a centimetre-level error on gates beyond about 168 km ({issue}`525`, {pull}`529`) by [@aladinor](https://github.com/aladinor) * FIX: enable subprocess coverage for code coverage in ``pyproject.toml``, adapt ``docs/notebooks/conftest.py`` to enable code coverage for jupyter notebook kernel, pin pytest-cov to 7.1.0 {issue}`556` ({pull}`557`) by [@kmuehlbauer](https://github.com/kmuehlbauer) * FIX: tighten scope of tests for FutureWarning to prevent checking for Warnings issued by other sources ({issue}`558`, {pull}`559`) by [@kmuehlbauer](https://github.com/kmuehlbauer)) -* MNT: use ``xarray.DataTree.dataset`` instead of deprecated ``xarray.DataTree.ds``, promote xarray's FutureWarning to error in test suite {issue}`560` ({pull}`561`) by [@kmuehlbauer](https://github.com/kmuehlbauer) +* MNT: use ``xarray.DataTree.dataset`` instead of deprecated ``xarray.DataTree.ds``, promote xarray's FutureWarning to error in test suite ({issue}`560`, {pull}`561`) by [@kmuehlbauer](https://github.com/kmuehlbauer) +* MNT: promote xarray's FutureWarning to error in notebooks test suite ({issue}`562`, {pull}`563`) by [@kmuehlbauer](https://github.com/kmuehlbauer) * FIX: HPL and Metek readers fill the mandatory FM301 sweep metadata (Table 301-7a): ``follow_mode`` and ``prt_mode`` are ``not_set`` as for the other readers (not in the files), and Metek gets ``sweep_mode`` (``vertical_pointing``), ``sweep_number`` and ``sweep_fixed_angle`` for its single vertically pointing sweep; lazily opened Metek scalars and strings report their stored dtype instead of ``float64`` ({issue}`451`, {pull}`452`) by [@syedhamidali](https://github.com/syedhamidali) * ENH: ``to_cfradial1(..., range_geometry="per_sweep")`` (also ``xradar.transform.to_cfradial1`` and the accessor) writes volumes whose sweeps have different first gate or gate spacing (e.g. GAMIC with 100 m and 150 m gates) with a 2-D ``range(sweep, range)`` and ``meters_to_center_of_first_gate``/``meters_between_gates`` per sweep (CfRadial 1.4 Section 2.5); the default ``"common"`` still raises for them ({issue}`518`, {pull}`521`) by [@syedhamidali](https://github.com/syedhamidali) * FIX: IMD ``open_imd_datatree`` (and ``open_imd_volumes``) with several files no longer drop the ``/radar_parameters``, ``/georeferencing_correction`` and ``/radar_calibration`` groups requested with ``optional_groups=True``; ``create_volume`` only copied the sweeps. The values the files disagree about are left out of the groups, with a ``UserWarning`` naming them ({issue}`468`, {pull}`469`) by [@syedhamidali](https://github.com/syedhamidali) diff --git a/docs/notebooks/conftest.py b/docs/notebooks/conftest.py index d2ea9b90..003d8895 100644 --- a/docs/notebooks/conftest.py +++ b/docs/notebooks/conftest.py @@ -14,6 +14,13 @@ from nbclient.exceptions import CellExecutionError +def pytest_configure(config): + # prevent adding DataTree.ds by accident, turn warning into error + config.addinivalue_line( + "filterwarnings", + "error:DataTree.ds is deprecated, use DataTree.dataset instead.:FutureWarning", + ) + def pytest_collect_file(parent, file_path): if file_path.suffix == ".md" and "-Copy" not in file_path.name: return NotebookFile.from_parent(parent=parent, path=file_path) From 51bc99930806ec49b71f97646387af2c78430600 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kai=20M=C3=BChlbauer?= Date: Wed, 28 Oct 2026 14:44:37 +0100 Subject: [PATCH 2/2] lint --- docs/notebooks/conftest.py | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/notebooks/conftest.py b/docs/notebooks/conftest.py index 003d8895..8248368f 100644 --- a/docs/notebooks/conftest.py +++ b/docs/notebooks/conftest.py @@ -21,6 +21,7 @@ def pytest_configure(config): "error:DataTree.ds is deprecated, use DataTree.dataset instead.:FutureWarning", ) + def pytest_collect_file(parent, file_path): if file_path.suffix == ".md" and "-Copy" not in file_path.name: return NotebookFile.from_parent(parent=parent, path=file_path)