From 8bb939129b1d40cc3fe2c14222047e0700e78434 Mon Sep 17 00:00:00 2001 From: Maxime Liquet <35924738+maximlt@users.noreply.github.com> Date: Tue, 30 Jul 2024 15:22:30 +0200 Subject: [PATCH] Conditionally skip testing the Gridded data user guide (#1383) --- doc/conftest.py | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/doc/conftest.py b/doc/conftest.py index 3c1ab302d..5c0ebefb8 100644 --- a/doc/conftest.py +++ b/doc/conftest.py @@ -1,7 +1,11 @@ -import dask from importlib.util import find_spec + +import dask + +from packaging.version import Version from bokeh.io.webdriver import webdriver_control + collect_ignore_glob = [ 'user_guide/Streaming.ipynb', ] @@ -45,3 +49,19 @@ # From Dask 2024.3.0 they now use `dask_expr` by default # https://github.com/dask/dask/issues/10995 dask.config.set({'dataframe.query-planning': False}) + + +# https://github.com/pydata/xarray/pull/9182 +try: + import xarray as xr +except ImportError: + pass +else: + import numpy as np + + if Version(np.__version__) >= Version('2.0.0') and Version(xr.__version__) <= Version( + '2024.6.0' + ): + collect_ignore_glob += [ + 'user_guide/Gridded_Data.ipynb', + ]