diff --git a/.github/workflows/xskillscore_testing.yml b/.github/workflows/xskillscore_testing.yml index 9aa81fa0..04fcf9d4 100644 --- a/.github/workflows/xskillscore_testing.yml +++ b/.github/workflows/xskillscore_testing.yml @@ -119,6 +119,13 @@ jobs: run: | python -m pip install --no-deps -e . - name: Test notebooks in docs + # Route HTTP(S) to a dead proxy so notebooks that download data at build + # time fail here, not only intermittently on Read the Docs. + # intersphinx inventories then fail too, which only emits warnings. + env: + HTTP_PROXY: http://127.0.0.1:9 + HTTPS_PROXY: http://127.0.0.1:9 + NO_PROXY: "" run: | pushd docs nbstripout source/*.ipynb diff --git a/docs/source/conf.py b/docs/source/conf.py index 5e06f03b..2c843d8e 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -63,7 +63,8 @@ autodoc_typehints = "none" -nbsphinx_timeout = 60 +# per cell; Read the Docs builders are slower than GitHub Actions runners +nbsphinx_timeout = 300 nbsphinx_execute = "always" autosummary_generate = True diff --git a/docs/source/quick-start.ipynb b/docs/source/quick-start.ipynb index aeba73aa..72dbeebe 100644 --- a/docs/source/quick-start.ipynb +++ b/docs/source/quick-start.ipynb @@ -1336,9 +1336,9 @@ "source": [ "# resample with replacement in that one dimension\n", "iterations = 100\n", - "%timeit f_r = xs.resampling.resample_iterations(f, iterations, 'member', replace=True)\n", + "%timeit -n 1 -r 3 f_r = xs.resampling.resample_iterations(f, iterations, 'member', replace=True)\n", "# resample_iterations_idx is much (50x) faster because it involves no loops\n", - "%timeit f_r = xs.resampling.resample_iterations_idx(f, iterations, 'member', replace=True)\n", + "%timeit -n 1 -r 3 f_r = xs.resampling.resample_iterations_idx(f, iterations, 'member', replace=True)\n", "# but both do the same resampling" ] }, diff --git a/docs/source/tabular-data.ipynb b/docs/source/tabular-data.ipynb index 83645923..d1d3da52 100644 --- a/docs/source/tabular-data.ipynb +++ b/docs/source/tabular-data.ipynb @@ -29,7 +29,6 @@ "import numpy as np\n", "import pandas as pd\n", "import xskillscore as xs\n", - "from sklearn.datasets import fetch_california_housing\n", "from sklearn.metrics import mean_squared_error\n", "\n", "np.random.seed(seed=42)" @@ -39,7 +38,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## California house prices dataset" + "## House prices dataset" ] }, { @@ -48,224 +47,20 @@ "source": [ "A small example is to take a dataset and evaluate the model according to a field (column).\n", "\n", - "Load the California house prices dataset:" + "Create a synthetic house prices dataset, where the price `y` increases with the\n", + "average number of rooms `AveRooms`. The data is generated locally so the\n", + "documentation builds without downloading anything:" ] }, { "cell_type": "code", - "execution_count": 3, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "
| \n", - " | MedInc | \n", - "HouseAge | \n", - "AveRooms | \n", - "AveBedrms | \n", - "Population | \n", - "AveOccup | \n", - "Latitude | \n", - "Longitude | \n", - "y | \n", - "
|---|---|---|---|---|---|---|---|---|---|
| 0 | \n", - "8.3252 | \n", - "41.0 | \n", - "7.0 | \n", - "1.023810 | \n", - "322.0 | \n", - "2.555556 | \n", - "37.88 | \n", - "-122.23 | \n", - "4.526 | \n", - "
| 1 | \n", - "8.3014 | \n", - "21.0 | \n", - "6.0 | \n", - "0.971880 | \n", - "2401.0 | \n", - "2.109842 | \n", - "37.86 | \n", - "-122.22 | \n", - "3.585 | \n", - "
| 2 | \n", - "7.2574 | \n", - "52.0 | \n", - "8.0 | \n", - "1.073446 | \n", - "496.0 | \n", - "2.802260 | \n", - "37.85 | \n", - "-122.24 | \n", - "3.521 | \n", - "
| 3 | \n", - "5.6431 | \n", - "52.0 | \n", - "6.0 | \n", - "1.073059 | \n", - "558.0 | \n", - "2.547945 | \n", - "37.85 | \n", - "-122.25 | \n", - "3.413 | \n", - "
| 4 | \n", - "3.8462 | \n", - "52.0 | \n", - "6.0 | \n", - "1.081081 | \n", - "565.0 | \n", - "2.181467 | \n", - "37.85 | \n", - "-122.25 | \n", - "3.422 | \n", - "
| ... | \n", - "... | \n", - "... | \n", - "... | \n", - "... | \n", - "... | \n", - "... | \n", - "... | \n", - "... | \n", - "... | \n", - "
| 20635 | \n", - "1.5603 | \n", - "25.0 | \n", - "5.0 | \n", - "1.133333 | \n", - "845.0 | \n", - "2.560606 | \n", - "39.48 | \n", - "-121.09 | \n", - "0.781 | \n", - "
| 20636 | \n", - "2.5568 | \n", - "18.0 | \n", - "6.0 | \n", - "1.315789 | \n", - "356.0 | \n", - "3.122807 | \n", - "39.49 | \n", - "-121.21 | \n", - "0.771 | \n", - "
| 20637 | \n", - "1.7000 | \n", - "17.0 | \n", - "5.0 | \n", - "1.120092 | \n", - "1007.0 | \n", - "2.325635 | \n", - "39.43 | \n", - "-121.22 | \n", - "0.923 | \n", - "
| 20638 | \n", - "1.8672 | \n", - "18.0 | \n", - "5.0 | \n", - "1.171920 | \n", - "741.0 | \n", - "2.123209 | \n", - "39.43 | \n", - "-121.32 | \n", - "0.847 | \n", - "
| 20639 | \n", - "2.3886 | \n", - "16.0 | \n", - "5.0 | \n", - "1.162264 | \n", - "1387.0 | \n", - "2.616981 | \n", - "39.37 | \n", - "-121.24 | \n", - "0.894 | \n", - "
20640 rows × 9 columns
\n", - "