From ca8b6d33742e5415ff74929a75c36f8fb887d27e Mon Sep 17 00:00:00 2001 From: Ewout ter Hoeven Date: Wed, 4 Sep 2024 10:37:45 +0200 Subject: [PATCH] Readthedocs: Don't let notebook failures pass silently Adds both to conf.py: nb_execution_allow_errors = False nb_execution_raise_on_error = True To make sure that when one of the (tutorial) notebooks fails, the Readthedocs also fails and doesn't continue silently. See https://myst-nb.readthedocs.io/en/latest/computation/execute.html#error-reporting-warning-vs-failure --- docs/conf.py | 2 ++ docs/tutorials/intro_tutorial.ipynb | 15 ++++++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 8eb7b46239a..ad23acab42f 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -113,6 +113,8 @@ nb_execution_timeout = 60 nb_execution_mode = "cache" +nb_execution_allow_errors = False +nb_execution_raise_on_error = True # -- Options for HTML output ---------------------------------------------- diff --git a/docs/tutorials/intro_tutorial.ipynb b/docs/tutorials/intro_tutorial.ipynb index 28b855b3f68..539a264d78a 100644 --- a/docs/tutorials/intro_tutorial.ipynb +++ b/docs/tutorials/intro_tutorial.ipynb @@ -90,15 +90,19 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], + "metadata": { + "jupyter": { + "is_executing": true + } + }, "source": [ "# SKIP THIS CELL unless running in colab\n", "\n", "%pip install --quiet mesa\n", "# The exclamation points tell jupyter to do the command via the command line" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -323,7 +327,8 @@ "outputs": [], "source": [ "starter_model = MoneyModel(10)\n", - "starter_model.step()" + "starter_model.step()\n", + "starter_model.method_doesnt_exist()" ] }, {