From 8955d0599de65f69fcb373ff06014b3eb0cfe92d Mon Sep 17 00:00:00 2001 From: Remco de Boer <29308176+redeboer@users.noreply.github.com> Date: Sat, 2 Dec 2023 19:23:15 +0100 Subject: [PATCH 1/3] MAINT: sort and clean up `pip install` statements --- docs/report/002.ipynb | 2 +- docs/report/014.ipynb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/report/002.ipynb b/docs/report/002.ipynb index 7719baae..23f27c21 100644 --- a/docs/report/002.ipynb +++ b/docs/report/002.ipynb @@ -77,7 +77,7 @@ }, "outputs": [], "source": [ - "%pip install -q ampform==0.9.1 numpy==1.19.5 pandas==1.2.4 pandas==1.2.4 qrules==0.8.2 sympy==1.8 tensorwaves[jax]==0.2.9 git+https://github.com/zfit/phasespace@7131fbd" + "%pip install -q ampform==0.9.1 numpy==1.19.5 pandas==1.2.4 qrules==0.8.2 sympy==1.8 tensorwaves[jax]==0.2.9 git+https://github.com/zfit/phasespace@7131fbd" ] }, { diff --git a/docs/report/014.ipynb b/docs/report/014.ipynb index 537fcdaf..3a99ca76 100644 --- a/docs/report/014.ipynb +++ b/docs/report/014.ipynb @@ -69,7 +69,7 @@ }, "outputs": [], "source": [ - "%pip install -q git+https://github.com/ComPWA/ampform@3ed3ed5 qrules[viz]==0.9.7 sympy==1.9" + "%pip install -q qrules[viz]==0.9.7 sympy==1.9 git+https://github.com/ComPWA/ampform@3ed3ed5" ] }, { From 9c5d1ca0110b9a968dc34648a3ec8794030ec328 Mon Sep 17 00:00:00 2001 From: Remco de Boer <29308176+redeboer@users.noreply.github.com> Date: Sat, 2 Dec 2023 19:23:21 +0100 Subject: [PATCH 2/3] DX: remove `figure_formats = ["svg"]` statement --- .pre-commit-config.yaml | 2 +- docs/report/000.ipynb | 1 - docs/report/001.ipynb | 1 - docs/report/002.ipynb | 1 - docs/report/003.ipynb | 1 - docs/report/004.ipynb | 1 - docs/report/005.ipynb | 1 - docs/report/006.ipynb | 1 - docs/report/007.ipynb | 1 - docs/report/008.ipynb | 1 - docs/report/009.ipynb | 1 - docs/report/010.ipynb | 1 - docs/report/011.ipynb | 1 - docs/report/012.ipynb | 1 - docs/report/013.ipynb | 1 - docs/report/014.ipynb | 1 - docs/report/015.ipynb | 1 - docs/report/016.ipynb | 1 - docs/report/017.ipynb | 1 - docs/report/018.ipynb | 1 - docs/report/019.ipynb | 1 - docs/report/020.ipynb | 1 - docs/report/021.ipynb | 1 - docs/report/022.ipynb | 1 - docs/report/023.ipynb | 1 - 25 files changed, 1 insertion(+), 25 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9f6d15ca..43061442 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -39,7 +39,7 @@ repos: )$ - repo: https://github.com/ComPWA/repo-maintenance - rev: 0.1.4 + rev: 0.1.5 hooks: - id: check-dev-files args: diff --git a/docs/report/000.ipynb b/docs/report/000.ipynb index 0ac0cbe8..380f758d 100644 --- a/docs/report/000.ipynb +++ b/docs/report/000.ipynb @@ -19,7 +19,6 @@ }, "outputs": [], "source": [ - "%config InlineBackend.figure_formats = ['svg']\n", "import os\n", "\n", "STATIC_WEB_PAGE = {\"EXECUTE_NB\", \"READTHEDOCS\"}.intersection(os.environ)" diff --git a/docs/report/001.ipynb b/docs/report/001.ipynb index 01528e28..d9400e14 100644 --- a/docs/report/001.ipynb +++ b/docs/report/001.ipynb @@ -19,7 +19,6 @@ }, "outputs": [], "source": [ - "%config InlineBackend.figure_formats = ['svg']\n", "import os\n", "\n", "STATIC_WEB_PAGE = {\"EXECUTE_NB\", \"READTHEDOCS\"}.intersection(os.environ)" diff --git a/docs/report/002.ipynb b/docs/report/002.ipynb index 23f27c21..28eb5ec4 100644 --- a/docs/report/002.ipynb +++ b/docs/report/002.ipynb @@ -19,7 +19,6 @@ }, "outputs": [], "source": [ - "%config InlineBackend.figure_formats = ['svg']\n", "import os\n", "\n", "STATIC_WEB_PAGE = {\"EXECUTE_NB\", \"READTHEDOCS\"}.intersection(os.environ)" diff --git a/docs/report/003.ipynb b/docs/report/003.ipynb index 621f4ac0..e435c15b 100644 --- a/docs/report/003.ipynb +++ b/docs/report/003.ipynb @@ -19,7 +19,6 @@ }, "outputs": [], "source": [ - "%config InlineBackend.figure_formats = ['svg']\n", "import os\n", "\n", "STATIC_WEB_PAGE = {\"EXECUTE_NB\", \"READTHEDOCS\"}.intersection(os.environ)" diff --git a/docs/report/004.ipynb b/docs/report/004.ipynb index cdc37d88..16c0c7f9 100644 --- a/docs/report/004.ipynb +++ b/docs/report/004.ipynb @@ -19,7 +19,6 @@ }, "outputs": [], "source": [ - "%config InlineBackend.figure_formats = ['svg']\n", "import os\n", "\n", "STATIC_WEB_PAGE = {\"EXECUTE_NB\", \"READTHEDOCS\"}.intersection(os.environ)" diff --git a/docs/report/005.ipynb b/docs/report/005.ipynb index 7fac9528..2b1e60f6 100644 --- a/docs/report/005.ipynb +++ b/docs/report/005.ipynb @@ -19,7 +19,6 @@ }, "outputs": [], "source": [ - "%config InlineBackend.figure_formats = ['svg']\n", "import os\n", "\n", "STATIC_WEB_PAGE = {\"EXECUTE_NB\", \"READTHEDOCS\"}.intersection(os.environ)" diff --git a/docs/report/006.ipynb b/docs/report/006.ipynb index cbe54464..6bc30d7c 100644 --- a/docs/report/006.ipynb +++ b/docs/report/006.ipynb @@ -19,7 +19,6 @@ }, "outputs": [], "source": [ - "%config InlineBackend.figure_formats = ['svg']\n", "import os\n", "\n", "STATIC_WEB_PAGE = {\"EXECUTE_NB\", \"READTHEDOCS\"}.intersection(os.environ)" diff --git a/docs/report/007.ipynb b/docs/report/007.ipynb index eae210ab..98899a57 100644 --- a/docs/report/007.ipynb +++ b/docs/report/007.ipynb @@ -19,7 +19,6 @@ }, "outputs": [], "source": [ - "%config InlineBackend.figure_formats = ['svg']\n", "import os\n", "\n", "STATIC_WEB_PAGE = {\"EXECUTE_NB\", \"READTHEDOCS\"}.intersection(os.environ)" diff --git a/docs/report/008.ipynb b/docs/report/008.ipynb index e77b816c..f2aa4e8f 100644 --- a/docs/report/008.ipynb +++ b/docs/report/008.ipynb @@ -19,7 +19,6 @@ }, "outputs": [], "source": [ - "%config InlineBackend.figure_formats = ['svg']\n", "import os\n", "\n", "STATIC_WEB_PAGE = {\"EXECUTE_NB\", \"READTHEDOCS\"}.intersection(os.environ)" diff --git a/docs/report/009.ipynb b/docs/report/009.ipynb index 6363c3a6..6515d994 100644 --- a/docs/report/009.ipynb +++ b/docs/report/009.ipynb @@ -19,7 +19,6 @@ }, "outputs": [], "source": [ - "%config InlineBackend.figure_formats = ['svg']\n", "import os\n", "\n", "STATIC_WEB_PAGE = {\"EXECUTE_NB\", \"READTHEDOCS\"}.intersection(os.environ)" diff --git a/docs/report/010.ipynb b/docs/report/010.ipynb index 2c1f8fdb..b948204a 100644 --- a/docs/report/010.ipynb +++ b/docs/report/010.ipynb @@ -19,7 +19,6 @@ }, "outputs": [], "source": [ - "%config InlineBackend.figure_formats = ['svg']\n", "import os\n", "\n", "STATIC_WEB_PAGE = {\"EXECUTE_NB\", \"READTHEDOCS\"}.intersection(os.environ)" diff --git a/docs/report/011.ipynb b/docs/report/011.ipynb index df75705e..eda9f4f1 100644 --- a/docs/report/011.ipynb +++ b/docs/report/011.ipynb @@ -19,7 +19,6 @@ }, "outputs": [], "source": [ - "%config InlineBackend.figure_formats = ['svg']\n", "import os\n", "\n", "STATIC_WEB_PAGE = {\"EXECUTE_NB\", \"READTHEDOCS\"}.intersection(os.environ)" diff --git a/docs/report/012.ipynb b/docs/report/012.ipynb index 943d8bf4..9bb6eca0 100644 --- a/docs/report/012.ipynb +++ b/docs/report/012.ipynb @@ -19,7 +19,6 @@ }, "outputs": [], "source": [ - "%config InlineBackend.figure_formats = ['svg']\n", "import os\n", "\n", "STATIC_WEB_PAGE = {\"EXECUTE_NB\", \"READTHEDOCS\"}.intersection(os.environ)" diff --git a/docs/report/013.ipynb b/docs/report/013.ipynb index 92d11309..52b65805 100644 --- a/docs/report/013.ipynb +++ b/docs/report/013.ipynb @@ -19,7 +19,6 @@ }, "outputs": [], "source": [ - "%config InlineBackend.figure_formats = ['svg']\n", "import os\n", "\n", "STATIC_WEB_PAGE = {\"EXECUTE_NB\", \"READTHEDOCS\"}.intersection(os.environ)" diff --git a/docs/report/014.ipynb b/docs/report/014.ipynb index 3a99ca76..105348af 100644 --- a/docs/report/014.ipynb +++ b/docs/report/014.ipynb @@ -19,7 +19,6 @@ }, "outputs": [], "source": [ - "%config InlineBackend.figure_formats = ['svg']\n", "import os\n", "\n", "STATIC_WEB_PAGE = {\"EXECUTE_NB\", \"READTHEDOCS\"}.intersection(os.environ)" diff --git a/docs/report/015.ipynb b/docs/report/015.ipynb index a9c985c0..dfac7207 100644 --- a/docs/report/015.ipynb +++ b/docs/report/015.ipynb @@ -19,7 +19,6 @@ }, "outputs": [], "source": [ - "%config InlineBackend.figure_formats = ['svg']\n", "import os\n", "\n", "STATIC_WEB_PAGE = {\"EXECUTE_NB\", \"READTHEDOCS\"}.intersection(os.environ)" diff --git a/docs/report/016.ipynb b/docs/report/016.ipynb index fa1404f1..59793e7d 100644 --- a/docs/report/016.ipynb +++ b/docs/report/016.ipynb @@ -19,7 +19,6 @@ }, "outputs": [], "source": [ - "%config InlineBackend.figure_formats = ['svg']\n", "import os\n", "\n", "STATIC_WEB_PAGE = {\"EXECUTE_NB\", \"READTHEDOCS\"}.intersection(os.environ)" diff --git a/docs/report/017.ipynb b/docs/report/017.ipynb index 83abe557..3b0f2f0b 100644 --- a/docs/report/017.ipynb +++ b/docs/report/017.ipynb @@ -19,7 +19,6 @@ }, "outputs": [], "source": [ - "%config InlineBackend.figure_formats = ['svg']\n", "import os\n", "\n", "STATIC_WEB_PAGE = {\"EXECUTE_NB\", \"READTHEDOCS\"}.intersection(os.environ)" diff --git a/docs/report/018.ipynb b/docs/report/018.ipynb index 96c3e010..0900aa54 100644 --- a/docs/report/018.ipynb +++ b/docs/report/018.ipynb @@ -19,7 +19,6 @@ }, "outputs": [], "source": [ - "%config InlineBackend.figure_formats = ['svg']\n", "import os\n", "\n", "STATIC_WEB_PAGE = {\"EXECUTE_NB\", \"READTHEDOCS\"}.intersection(os.environ)" diff --git a/docs/report/019.ipynb b/docs/report/019.ipynb index ae1fc7c9..3d87df86 100644 --- a/docs/report/019.ipynb +++ b/docs/report/019.ipynb @@ -19,7 +19,6 @@ }, "outputs": [], "source": [ - "%config InlineBackend.figure_formats = ['svg']\n", "import os\n", "\n", "STATIC_WEB_PAGE = {\"EXECUTE_NB\", \"READTHEDOCS\"}.intersection(os.environ)" diff --git a/docs/report/020.ipynb b/docs/report/020.ipynb index 8abaecca..33189d4d 100644 --- a/docs/report/020.ipynb +++ b/docs/report/020.ipynb @@ -19,7 +19,6 @@ }, "outputs": [], "source": [ - "%config InlineBackend.figure_formats = ['svg']\n", "import os\n", "\n", "STATIC_WEB_PAGE = {\"EXECUTE_NB\", \"READTHEDOCS\"}.intersection(os.environ)" diff --git a/docs/report/021.ipynb b/docs/report/021.ipynb index 5c27519f..b2468af0 100644 --- a/docs/report/021.ipynb +++ b/docs/report/021.ipynb @@ -19,7 +19,6 @@ }, "outputs": [], "source": [ - "%config InlineBackend.figure_formats = ['svg']\n", "import os\n", "\n", "STATIC_WEB_PAGE = {\"EXECUTE_NB\", \"READTHEDOCS\"}.intersection(os.environ)" diff --git a/docs/report/022.ipynb b/docs/report/022.ipynb index 31ad2293..1d66c6fb 100644 --- a/docs/report/022.ipynb +++ b/docs/report/022.ipynb @@ -19,7 +19,6 @@ }, "outputs": [], "source": [ - "%config InlineBackend.figure_formats = ['svg']\n", "import os\n", "\n", "STATIC_WEB_PAGE = {\"EXECUTE_NB\", \"READTHEDOCS\"}.intersection(os.environ)" diff --git a/docs/report/023.ipynb b/docs/report/023.ipynb index f2961cd8..696a81a6 100644 --- a/docs/report/023.ipynb +++ b/docs/report/023.ipynb @@ -19,7 +19,6 @@ }, "outputs": [], "source": [ - "%config InlineBackend.figure_formats = ['svg']\n", "import os\n", "\n", "STATIC_WEB_PAGE = {\"EXECUTE_NB\", \"READTHEDOCS\"}.intersection(os.environ)" From 9423eca37d1141bb81f3b67d2fe08d6dffc689a2 Mon Sep 17 00:00:00 2001 From: Remco de Boer <29308176+redeboer@users.noreply.github.com> Date: Sat, 2 Dec 2023 21:01:25 +0100 Subject: [PATCH 3/3] DOC: plot with SVG where needed --- docs/report/001.ipynb | 1 + docs/report/002.ipynb | 1 + docs/report/003.ipynb | 2 ++ docs/report/006.ipynb | 21 +++++++++----------- docs/report/013.ipynb | 1 + docs/report/017.ipynb | 1 + docs/report/020.ipynb | 1 + docs/report/021.ipynb | 46 ++++++------------------------------------- 8 files changed, 22 insertions(+), 52 deletions(-) diff --git a/docs/report/001.ipynb b/docs/report/001.ipynb index d9400e14..c7f981cc 100644 --- a/docs/report/001.ipynb +++ b/docs/report/001.ipynb @@ -254,6 +254,7 @@ }, "outputs": [], "source": [ + "%config InlineBackend.figure_formats = ['svg']\n", "x = sp.Symbol(\"x\")\n", "expr = ComplexSqrt(x)\n", "p1 = sp.plot(sp.re(expr), (x, -1, 2), show=False, line_color=\"red\")\n", diff --git a/docs/report/002.ipynb b/docs/report/002.ipynb index 28eb5ec4..ee1dfce7 100644 --- a/docs/report/002.ipynb +++ b/docs/report/002.ipynb @@ -92,6 +92,7 @@ }, "outputs": [], "source": [ + "%config InlineBackend.figure_formats = ['svg']\n", "from __future__ import annotations\n", "\n", "import inspect\n", diff --git a/docs/report/003.ipynb b/docs/report/003.ipynb index e435c15b..a6f6df96 100644 --- a/docs/report/003.ipynb +++ b/docs/report/003.ipynb @@ -113,6 +113,7 @@ }, "outputs": [], "source": [ + "%config InlineBackend.figure_formats = ['svg']\n", "import inspect\n", "import warnings\n", "from functools import partial\n", @@ -390,6 +391,7 @@ "source_hidden": true }, "tags": [ + "full-width", "remove-output", "hide-cell" ] diff --git a/docs/report/006.ipynb b/docs/report/006.ipynb index 6bc30d7c..b3d0a840 100644 --- a/docs/report/006.ipynb +++ b/docs/report/006.ipynb @@ -238,7 +238,9 @@ "cell_type": "code", "execution_count": null, "metadata": { - "tags": [] + "tags": [ + "remove-output" + ] }, "outputs": [], "source": [ @@ -332,7 +334,9 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "Simplest option is to use the [`ipywidgets.interact()`](https://ipywidgets.readthedocs.io/en/stable/examples/Using%20Interact.html) function:" + "Simplest option is to use the [`ipywidgets.interact()`](https://ipywidgets.readthedocs.io/en/stable/examples/Using%20Interact.html) function:\n", + "\n", + "{{ run_interactive }}" ] }, { @@ -369,15 +373,6 @@ " fig2.canvas.draw_idle()" ] }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "{{ run_interactive }}\n", - "\n", - "![ipywidgets interactive output with interact()](https://user-images.githubusercontent.com/29308176/164993432-3003e5b4-e49f-4e24-b4ee-dbcfdd0805b5.svg)" - ] - }, { "cell_type": "markdown", "metadata": {}, @@ -396,7 +391,9 @@ "cell_type": "code", "execution_count": null, "metadata": { - "tags": [] + "tags": [ + "remove-output" + ] }, "outputs": [], "source": [ diff --git a/docs/report/013.ipynb b/docs/report/013.ipynb index 52b65805..1031fad3 100644 --- a/docs/report/013.ipynb +++ b/docs/report/013.ipynb @@ -86,6 +86,7 @@ }, "outputs": [], "source": [ + "%config InlineBackend.figure_formats = ['svg']\n", "import logging\n", "import warnings\n", "\n", diff --git a/docs/report/017.ipynb b/docs/report/017.ipynb index 3b0f2f0b..4c52a9f6 100644 --- a/docs/report/017.ipynb +++ b/docs/report/017.ipynb @@ -85,6 +85,7 @@ }, "outputs": [], "source": [ + "%config InlineBackend.figure_formats = ['svg']\n", "from __future__ import annotations\n", "\n", "import warnings\n", diff --git a/docs/report/020.ipynb b/docs/report/020.ipynb index 33189d4d..80bfd878 100644 --- a/docs/report/020.ipynb +++ b/docs/report/020.ipynb @@ -87,6 +87,7 @@ }, "outputs": [], "source": [ + "%config InlineBackend.figure_formats = ['svg']\n", "import logging\n", "import os\n", "import warnings\n", diff --git a/docs/report/021.ipynb b/docs/report/021.ipynb index b2468af0..93fabd5c 100644 --- a/docs/report/021.ipynb +++ b/docs/report/021.ipynb @@ -101,6 +101,7 @@ }, "outputs": [], "source": [ + "%matplotlib widget\n", "from __future__ import annotations\n", "\n", "import itertools\n", @@ -1857,19 +1858,6 @@ "Finally, all intensities can be computed as follows:" ] }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "tags": [ - "remove-input" - ] - }, - "outputs": [], - "source": [ - "%config InlineBackend.figure_formats = ['png']" - ] - }, { "cell_type": "code", "execution_count": null, @@ -1884,6 +1872,7 @@ }, "outputs": [], "source": [ + "%config InlineBackend.figure_formats = ['png']\n", "s1_label = R\"$\\sigma_1=m^2\\left(K\\pi\\right)$\"\n", "s2_label = R\"$\\sigma_2=m^2\\left(pK\\right)$\"\n", "s3_label = R\"$\\sigma_3=m^2\\left(p\\pi\\right)$\"\n", @@ -1914,19 +1903,6 @@ ":::" ] }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "tags": [ - "hide-input" - ] - }, - "outputs": [], - "source": [ - "%config InlineBackend.figure_formats = ['svg']" - ] - }, { "cell_type": "code", "execution_count": null, @@ -1943,6 +1919,9 @@ }, "outputs": [], "source": [ + "%config InlineBackend.figure_formats = ['svg']\n", + "\n", + "\n", "def compute_sub_function(\n", " func: ParametrizedFunction, phsp: DataSample, non_zero_couplings: str\n", ") -> jnp.ndarray:\n", @@ -2261,20 +2240,6 @@ "Math(latex)" ] }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "tags": [ - "remove-input" - ] - }, - "outputs": [], - "source": [ - "%config InlineBackend.figure_formats = ['png']\n", - "%matplotlib widget" - ] - }, { "cell_type": "code", "execution_count": null, @@ -2434,6 +2399,7 @@ }, "outputs": [], "source": [ + "%config InlineBackend.figure_formats = ['png']\n", "fig, axes = plt.subplots(\n", " figsize=(12, 6.2),\n", " ncols=2,\n",