From 7d8c16d60ee36171ed13f2f93b5f09018e234f7f Mon Sep 17 00:00:00 2001 From: Remco de Boer <29308176+redeboer@users.noreply.github.com> Date: Tue, 30 Apr 2024 11:35:56 +0200 Subject: [PATCH] DOC: catch only `RuntimeWarning`s --- docs/comparison/d2kkk.ipynb | 2 +- docs/comparison/jpsi2phipipi.ipynb | 2 +- docs/comparison/jpsi2pipipi.ipynb | 2 +- docs/jpsi2ksp.ipynb | 2 +- docs/lc2pkpi.ipynb | 5 +---- docs/xib2pkk.ipynb | 2 +- 6 files changed, 6 insertions(+), 9 deletions(-) diff --git a/docs/comparison/d2kkk.ipynb b/docs/comparison/d2kkk.ipynb index c119cac1..548f3da1 100644 --- a/docs/comparison/d2kkk.ipynb +++ b/docs/comparison/d2kkk.ipynb @@ -84,7 +84,7 @@ "simplify_latex_rendering()\n", "logging.getLogger(\"jax\").setLevel(logging.ERROR) # mute JAX\n", "os.environ[\"TF_CPP_MIN_LOG_LEVEL\"] = \"3\" # mute TF\n", - "warnings.simplefilter(\"ignore\")\n", + "warnings.simplefilter(\"ignore\", category=RuntimeWarning)\n", "NO_TQDM = \"EXECUTE_NB\" in os.environ\n", "if NO_TQDM:\n", " logging.getLogger(\"ampform.sympy\").setLevel(logging.ERROR)\n", diff --git a/docs/comparison/jpsi2phipipi.ipynb b/docs/comparison/jpsi2phipipi.ipynb index b812df55..b0c5d3ba 100644 --- a/docs/comparison/jpsi2phipipi.ipynb +++ b/docs/comparison/jpsi2phipipi.ipynb @@ -84,7 +84,7 @@ "simplify_latex_rendering()\n", "logging.getLogger(\"jax\").setLevel(logging.ERROR) # mute JAX\n", "os.environ[\"TF_CPP_MIN_LOG_LEVEL\"] = \"3\" # mute TF\n", - "warnings.simplefilter(\"ignore\")\n", + "warnings.simplefilter(\"ignore\", category=RuntimeWarning)\n", "NO_TQDM = \"EXECUTE_NB\" in os.environ\n", "if NO_TQDM:\n", " logging.getLogger(\"ampform.sympy\").setLevel(logging.ERROR)\n", diff --git a/docs/comparison/jpsi2pipipi.ipynb b/docs/comparison/jpsi2pipipi.ipynb index b3a381b7..418c6e8d 100644 --- a/docs/comparison/jpsi2pipipi.ipynb +++ b/docs/comparison/jpsi2pipipi.ipynb @@ -84,7 +84,7 @@ "simplify_latex_rendering()\n", "logging.getLogger(\"jax\").setLevel(logging.ERROR) # mute JAX\n", "os.environ[\"TF_CPP_MIN_LOG_LEVEL\"] = \"3\" # mute TF\n", - "warnings.simplefilter(\"ignore\")\n", + "warnings.simplefilter(\"ignore\", category=RuntimeWarning)\n", "NO_TQDM = \"EXECUTE_NB\" in os.environ\n", "if NO_TQDM:\n", " logging.getLogger(\"ampform.sympy\").setLevel(logging.ERROR)\n", diff --git a/docs/jpsi2ksp.ipynb b/docs/jpsi2ksp.ipynb index 018da7fc..984f99e7 100644 --- a/docs/jpsi2ksp.ipynb +++ b/docs/jpsi2ksp.ipynb @@ -58,7 +58,7 @@ "\n", "simplify_latex_rendering()\n", "logging.getLogger(\"absl\").setLevel(logging.ERROR) # mute JAX\n", - "warnings.simplefilter(\"ignore\")\n", + "warnings.simplefilter(\"ignore\", category=RuntimeWarning)\n", "\n", "NO_TQDM = \"EXECUTE_NB\" in os.environ\n", "if NO_TQDM:\n", diff --git a/docs/lc2pkpi.ipynb b/docs/lc2pkpi.ipynb index 569bcde0..39e098ed 100644 --- a/docs/lc2pkpi.ipynb +++ b/docs/lc2pkpi.ipynb @@ -26,8 +26,6 @@ "source": [ "from __future__ import annotations\n", "\n", - "import warnings\n", - "\n", "import graphviz\n", "import qrules\n", "import sympy as sp\n", @@ -44,8 +42,7 @@ "from ampform_dpd.dynamics.builder import create_mass_symbol, get_mandelstam_s\n", "from ampform_dpd.io import as_markdown_table, aslatex, simplify_latex_rendering\n", "\n", - "simplify_latex_rendering()\n", - "warnings.simplefilter(\"ignore\")" + "simplify_latex_rendering()" ] }, { diff --git a/docs/xib2pkk.ipynb b/docs/xib2pkk.ipynb index 6324cb38..e25629ed 100644 --- a/docs/xib2pkk.ipynb +++ b/docs/xib2pkk.ipynb @@ -63,7 +63,7 @@ "\n", "simplify_latex_rendering()\n", "logging.getLogger(\"absl\").setLevel(logging.ERROR) # mute JAX\n", - "warnings.simplefilter(\"ignore\")\n", + "warnings.simplefilter(\"ignore\", category=RuntimeWarning)\n", "\n", "NO_TQDM = \"EXECUTE_NB\" in os.environ\n", "if NO_TQDM:\n",