diff --git a/.constraints/py3.6.txt b/.constraints/py3.6.txt index 85670343..03f111a5 100644 --- a/.constraints/py3.6.txt +++ b/.constraints/py3.6.txt @@ -182,9 +182,9 @@ smmap==5.0.0 sniffio==1.2.0 snowballstemmer==2.2.0 soupsieve==2.3.1 -sphinx==4.3.2 +sphinx==4.3.2 ; python_version < "3.8.0" sphinx-autobuild==2021.3.14 -sphinx-book-theme==0.1.10 +sphinx-book-theme==0.2.0 sphinx-copybutton==0.4.0 sphinx-panels==0.6.0 sphinx-thebe==0.0.10 diff --git a/.constraints/py3.7.txt b/.constraints/py3.7.txt index c7dcc2c0..7433aab5 100644 --- a/.constraints/py3.7.txt +++ b/.constraints/py3.7.txt @@ -188,9 +188,9 @@ smmap==5.0.0 sniffio==1.2.0 snowballstemmer==2.2.0 soupsieve==2.3.1 -sphinx==4.3.2 +sphinx==4.3.2 ; python_version < "3.8.0" sphinx-autobuild==2021.3.14 -sphinx-book-theme==0.1.10 +sphinx-book-theme==0.2.0 sphinx-copybutton==0.4.0 sphinx-panels==0.6.0 sphinx-thebe==0.0.10 diff --git a/.constraints/py3.8.txt b/.constraints/py3.8.txt index 0361f29e..9b42b07d 100644 --- a/.constraints/py3.8.txt +++ b/.constraints/py3.8.txt @@ -188,9 +188,9 @@ smmap==5.0.0 sniffio==1.2.0 snowballstemmer==2.2.0 soupsieve==2.3.1 -sphinx==4.3.2 +sphinx==4.4.0 sphinx-autobuild==2021.3.14 -sphinx-book-theme==0.1.10 +sphinx-book-theme==0.2.0 sphinx-copybutton==0.4.0 sphinx-panels==0.6.0 sphinx-thebe==0.0.10 diff --git a/.constraints/py3.9.txt b/.constraints/py3.9.txt index f3da90fc..dc33193c 100644 --- a/.constraints/py3.9.txt +++ b/.constraints/py3.9.txt @@ -187,9 +187,9 @@ smmap==5.0.0 sniffio==1.2.0 snowballstemmer==2.2.0 soupsieve==2.3.1 -sphinx==4.3.2 +sphinx==4.4.0 sphinx-autobuild==2021.3.14 -sphinx-book-theme==0.1.10 +sphinx-book-theme==0.2.0 sphinx-copybutton==0.4.0 sphinx-panels==0.6.0 sphinx-thebe==0.0.10 diff --git a/.github/workflows/ci-docs.yml b/.github/workflows/ci-docs.yml index 3bb3f085..38c1e94b 100644 --- a/.github/workflows/ci-docs.yml +++ b/.github/workflows/ci-docs.yml @@ -16,14 +16,14 @@ jobs: runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v2 - - name: Set up Python 3.7 + - name: Set up Python 3.8 uses: actions/setup-python@v2 with: - python-version: "3.7" + python-version: "3.8" - name: Install dependencies run: | python -m pip install --upgrade pip - pip install -c .constraints/py3.7.txt .[doc] + pip install -c .constraints/py3.8.txt .[doc] sudo apt-get -y install graphviz pandoc - name: Build documentation and run notebooks working-directory: docs diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 59b22edf..947c76fe 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -44,15 +44,16 @@ repos: - id: trailing-whitespace - repo: https://github.com/ComPWA/repo-maintenance - rev: 0.0.98 + rev: 0.0.99 hooks: - id: check-dev-files args: - --pin-requirements - id: fix-first-nbcell args: - - --colab - - --replace + - --add-install-cell + - --additional-packages=IPython + - --extras-require=doc,viz - id: fix-nbformat-version - id: format-setup-cfg @@ -125,6 +126,7 @@ repos: metadata.toc-showmarkdowntxt metadata.toc-showtags metadata.varInspector + - repo: https://github.com/pre-commit/mirrors-prettier rev: v2.5.1 hooks: diff --git a/docs/amplitude-analysis.ipynb b/docs/amplitude-analysis.ipynb index 27bd1951..b358394c 100644 --- a/docs/amplitude-analysis.ipynb +++ b/docs/amplitude-analysis.ipynb @@ -19,25 +19,34 @@ }, "outputs": [], "source": [ - "%%capture\n", - "%config Completer.use_jedi = False\n", "%config InlineBackend.figure_formats = ['svg']\n", "import os\n", "\n", - "STATIC_WEB_PAGE = {\"EXECUTE_NB\", \"READTHEDOCS\"}.intersection(os.environ)\n", - "\n", - "# Install on Google Colab\n", - "import subprocess\n", - "import sys\n", - "\n", - "from IPython import get_ipython\n", - "\n", - "install_packages = \"google.colab\" in str(get_ipython())\n", - "if install_packages:\n", - " for package in [\"tensorwaves[doc]\", \"graphviz\"]:\n", - " subprocess.check_call(\n", - " [sys.executable, \"-m\", \"pip\", \"install\", package]\n", - " )" + "STATIC_WEB_PAGE = {\"EXECUTE_NB\", \"READTHEDOCS\"}.intersection(os.environ)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "hideCode": true, + "hideOutput": true, + "hidePrompt": true, + "jupyter": { + "source_hidden": true + }, + "slideshow": { + "slide_type": "skip" + }, + "tags": [ + "remove-cell", + "skip-execution" + ] + }, + "outputs": [], + "source": [ + "# WARNING: advised to install a specific version, e.g. tensorwaves==0.1.2\n", + "%pip install -q tensorwaves[doc,viz] IPython" ] }, { diff --git a/docs/amplitude-analysis/analytic-continuation.ipynb b/docs/amplitude-analysis/analytic-continuation.ipynb index 045aedf9..45183c6b 100644 --- a/docs/amplitude-analysis/analytic-continuation.ipynb +++ b/docs/amplitude-analysis/analytic-continuation.ipynb @@ -19,25 +19,34 @@ }, "outputs": [], "source": [ - "%%capture\n", - "%config Completer.use_jedi = False\n", "%config InlineBackend.figure_formats = ['svg']\n", "import os\n", "\n", - "STATIC_WEB_PAGE = {\"EXECUTE_NB\", \"READTHEDOCS\"}.intersection(os.environ)\n", - "\n", - "# Install on Google Colab\n", - "import subprocess\n", - "import sys\n", - "\n", - "from IPython import get_ipython\n", - "\n", - "install_packages = \"google.colab\" in str(get_ipython())\n", - "if install_packages:\n", - " for package in [\"tensorwaves[doc]\", \"graphviz\"]:\n", - " subprocess.check_call(\n", - " [sys.executable, \"-m\", \"pip\", \"install\", package]\n", - " )" + "STATIC_WEB_PAGE = {\"EXECUTE_NB\", \"READTHEDOCS\"}.intersection(os.environ)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "hideCode": true, + "hideOutput": true, + "hidePrompt": true, + "jupyter": { + "source_hidden": true + }, + "slideshow": { + "slide_type": "skip" + }, + "tags": [ + "remove-cell", + "skip-execution" + ] + }, + "outputs": [], + "source": [ + "# WARNING: advised to install a specific version, e.g. tensorwaves==0.1.2\n", + "%pip install -q tensorwaves[doc,viz] IPython" ] }, { diff --git a/docs/conf.py b/docs/conf.py index 7963bb6c..0592de95 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -152,6 +152,7 @@ def fetch_logo(url: str, output_path: str) -> None: "launch_buttons": { "binderhub_url": "https://mybinder.org", "colab_url": "https://colab.research.google.com", + "deepnote_url": "https://deepnote.com", "notebook_interface": "jupyterlab", "thebe": True, "thebelab": True, diff --git a/docs/usage.ipynb b/docs/usage.ipynb index dd2b5f2e..5ca83142 100644 --- a/docs/usage.ipynb +++ b/docs/usage.ipynb @@ -19,25 +19,34 @@ }, "outputs": [], "source": [ - "%%capture\n", - "%config Completer.use_jedi = False\n", "%config InlineBackend.figure_formats = ['svg']\n", "import os\n", "\n", - "STATIC_WEB_PAGE = {\"EXECUTE_NB\", \"READTHEDOCS\"}.intersection(os.environ)\n", - "\n", - "# Install on Google Colab\n", - "import subprocess\n", - "import sys\n", - "\n", - "from IPython import get_ipython\n", - "\n", - "install_packages = \"google.colab\" in str(get_ipython())\n", - "if install_packages:\n", - " for package in [\"tensorwaves[doc]\", \"graphviz\"]:\n", - " subprocess.check_call(\n", - " [sys.executable, \"-m\", \"pip\", \"install\", package]\n", - " )" + "STATIC_WEB_PAGE = {\"EXECUTE_NB\", \"READTHEDOCS\"}.intersection(os.environ)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "hideCode": true, + "hideOutput": true, + "hidePrompt": true, + "jupyter": { + "source_hidden": true + }, + "slideshow": { + "slide_type": "skip" + }, + "tags": [ + "remove-cell", + "skip-execution" + ] + }, + "outputs": [], + "source": [ + "# WARNING: advised to install a specific version, e.g. tensorwaves==0.1.2\n", + "%pip install -q tensorwaves[doc,viz] IPython" ] }, { diff --git a/docs/usage/basics.ipynb b/docs/usage/basics.ipynb index 8244a877..b31e334e 100644 --- a/docs/usage/basics.ipynb +++ b/docs/usage/basics.ipynb @@ -19,25 +19,34 @@ }, "outputs": [], "source": [ - "%%capture\n", - "%config Completer.use_jedi = False\n", "%config InlineBackend.figure_formats = ['svg']\n", "import os\n", "\n", - "STATIC_WEB_PAGE = {\"EXECUTE_NB\", \"READTHEDOCS\"}.intersection(os.environ)\n", - "\n", - "# Install on Google Colab\n", - "import subprocess\n", - "import sys\n", - "\n", - "from IPython import get_ipython\n", - "\n", - "install_packages = \"google.colab\" in str(get_ipython())\n", - "if install_packages:\n", - " for package in [\"tensorwaves[doc]\", \"graphviz\"]:\n", - " subprocess.check_call(\n", - " [sys.executable, \"-m\", \"pip\", \"install\", package]\n", - " )" + "STATIC_WEB_PAGE = {\"EXECUTE_NB\", \"READTHEDOCS\"}.intersection(os.environ)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "hideCode": true, + "hideOutput": true, + "hidePrompt": true, + "jupyter": { + "source_hidden": true + }, + "slideshow": { + "slide_type": "skip" + }, + "tags": [ + "remove-cell", + "skip-execution" + ] + }, + "outputs": [], + "source": [ + "# WARNING: advised to install a specific version, e.g. tensorwaves==0.1.2\n", + "%pip install -q tensorwaves[doc,viz] IPython" ] }, { diff --git a/docs/usage/binned-fit.ipynb b/docs/usage/binned-fit.ipynb index 401d0db5..0c4a3873 100644 --- a/docs/usage/binned-fit.ipynb +++ b/docs/usage/binned-fit.ipynb @@ -19,25 +19,34 @@ }, "outputs": [], "source": [ - "%%capture\n", - "%config Completer.use_jedi = False\n", "%config InlineBackend.figure_formats = ['svg']\n", "import os\n", "\n", - "STATIC_WEB_PAGE = {\"EXECUTE_NB\", \"READTHEDOCS\"}.intersection(os.environ)\n", - "\n", - "# Install on Google Colab\n", - "import subprocess\n", - "import sys\n", - "\n", - "from IPython import get_ipython\n", - "\n", - "install_packages = \"google.colab\" in str(get_ipython())\n", - "if install_packages:\n", - " for package in [\"tensorwaves[doc]\", \"graphviz\"]:\n", - " subprocess.check_call(\n", - " [sys.executable, \"-m\", \"pip\", \"install\", package]\n", - " )" + "STATIC_WEB_PAGE = {\"EXECUTE_NB\", \"READTHEDOCS\"}.intersection(os.environ)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "hideCode": true, + "hideOutput": true, + "hidePrompt": true, + "jupyter": { + "source_hidden": true + }, + "slideshow": { + "slide_type": "skip" + }, + "tags": [ + "remove-cell", + "skip-execution" + ] + }, + "outputs": [], + "source": [ + "# WARNING: advised to install a specific version, e.g. tensorwaves==0.1.2\n", + "%pip install -q tensorwaves[doc,viz] IPython" ] }, { diff --git a/docs/usage/caching.ipynb b/docs/usage/caching.ipynb index 00d44eb0..ed05b6f8 100644 --- a/docs/usage/caching.ipynb +++ b/docs/usage/caching.ipynb @@ -19,25 +19,34 @@ }, "outputs": [], "source": [ - "%%capture\n", - "%config Completer.use_jedi = False\n", "%config InlineBackend.figure_formats = ['svg']\n", "import os\n", "\n", - "STATIC_WEB_PAGE = {\"EXECUTE_NB\", \"READTHEDOCS\"}.intersection(os.environ)\n", - "\n", - "# Install on Google Colab\n", - "import subprocess\n", - "import sys\n", - "\n", - "from IPython import get_ipython\n", - "\n", - "install_packages = \"google.colab\" in str(get_ipython())\n", - "if install_packages:\n", - " for package in [\"tensorwaves[doc]\", \"graphviz\"]:\n", - " subprocess.check_call(\n", - " [sys.executable, \"-m\", \"pip\", \"install\", package]\n", - " )" + "STATIC_WEB_PAGE = {\"EXECUTE_NB\", \"READTHEDOCS\"}.intersection(os.environ)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "hideCode": true, + "hideOutput": true, + "hidePrompt": true, + "jupyter": { + "source_hidden": true + }, + "slideshow": { + "slide_type": "skip" + }, + "tags": [ + "remove-cell", + "skip-execution" + ] + }, + "outputs": [], + "source": [ + "# WARNING: advised to install a specific version, e.g. tensorwaves==0.1.2\n", + "%pip install -q tensorwaves[doc,viz] IPython" ] }, { diff --git a/docs/usage/chi-squared.ipynb b/docs/usage/chi-squared.ipynb index d9bbdd17..b6760c87 100644 --- a/docs/usage/chi-squared.ipynb +++ b/docs/usage/chi-squared.ipynb @@ -19,25 +19,34 @@ }, "outputs": [], "source": [ - "%%capture\n", - "%config Completer.use_jedi = False\n", "%config InlineBackend.figure_formats = ['svg']\n", "import os\n", "\n", - "STATIC_WEB_PAGE = {\"EXECUTE_NB\", \"READTHEDOCS\"}.intersection(os.environ)\n", - "\n", - "# Install on Google Colab\n", - "import subprocess\n", - "import sys\n", - "\n", - "from IPython import get_ipython\n", - "\n", - "install_packages = \"google.colab\" in str(get_ipython())\n", - "if install_packages:\n", - " for package in [\"tensorwaves[doc]\", \"graphviz\"]:\n", - " subprocess.check_call(\n", - " [sys.executable, \"-m\", \"pip\", \"install\", package]\n", - " )" + "STATIC_WEB_PAGE = {\"EXECUTE_NB\", \"READTHEDOCS\"}.intersection(os.environ)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "hideCode": true, + "hideOutput": true, + "hidePrompt": true, + "jupyter": { + "source_hidden": true + }, + "slideshow": { + "slide_type": "skip" + }, + "tags": [ + "remove-cell", + "skip-execution" + ] + }, + "outputs": [], + "source": [ + "# WARNING: advised to install a specific version, e.g. tensorwaves==0.1.2\n", + "%pip install -q tensorwaves[doc,viz] IPython" ] }, { diff --git a/docs/usage/faster-lambdify.ipynb b/docs/usage/faster-lambdify.ipynb index 1c21a45d..808d05f3 100644 --- a/docs/usage/faster-lambdify.ipynb +++ b/docs/usage/faster-lambdify.ipynb @@ -19,25 +19,34 @@ }, "outputs": [], "source": [ - "%%capture\n", - "%config Completer.use_jedi = False\n", "%config InlineBackend.figure_formats = ['svg']\n", "import os\n", "\n", - "STATIC_WEB_PAGE = {\"EXECUTE_NB\", \"READTHEDOCS\"}.intersection(os.environ)\n", - "\n", - "# Install on Google Colab\n", - "import subprocess\n", - "import sys\n", - "\n", - "from IPython import get_ipython\n", - "\n", - "install_packages = \"google.colab\" in str(get_ipython())\n", - "if install_packages:\n", - " for package in [\"tensorwaves[doc]\", \"graphviz\"]:\n", - " subprocess.check_call(\n", - " [sys.executable, \"-m\", \"pip\", \"install\", package]\n", - " )" + "STATIC_WEB_PAGE = {\"EXECUTE_NB\", \"READTHEDOCS\"}.intersection(os.environ)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "hideCode": true, + "hideOutput": true, + "hidePrompt": true, + "jupyter": { + "source_hidden": true + }, + "slideshow": { + "slide_type": "skip" + }, + "tags": [ + "remove-cell", + "skip-execution" + ] + }, + "outputs": [], + "source": [ + "# WARNING: advised to install a specific version, e.g. tensorwaves==0.1.2\n", + "%pip install -q tensorwaves[doc,viz] IPython" ] }, { diff --git a/docs/usage/unbinned-fit.ipynb b/docs/usage/unbinned-fit.ipynb index 70937cb5..405f807a 100644 --- a/docs/usage/unbinned-fit.ipynb +++ b/docs/usage/unbinned-fit.ipynb @@ -19,25 +19,34 @@ }, "outputs": [], "source": [ - "%%capture\n", - "%config Completer.use_jedi = False\n", "%config InlineBackend.figure_formats = ['svg']\n", "import os\n", "\n", - "STATIC_WEB_PAGE = {\"EXECUTE_NB\", \"READTHEDOCS\"}.intersection(os.environ)\n", - "\n", - "# Install on Google Colab\n", - "import subprocess\n", - "import sys\n", - "\n", - "from IPython import get_ipython\n", - "\n", - "install_packages = \"google.colab\" in str(get_ipython())\n", - "if install_packages:\n", - " for package in [\"tensorwaves[doc]\", \"graphviz\"]:\n", - " subprocess.check_call(\n", - " [sys.executable, \"-m\", \"pip\", \"install\", package]\n", - " )" + "STATIC_WEB_PAGE = {\"EXECUTE_NB\", \"READTHEDOCS\"}.intersection(os.environ)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "hideCode": true, + "hideOutput": true, + "hidePrompt": true, + "jupyter": { + "source_hidden": true + }, + "slideshow": { + "slide_type": "skip" + }, + "tags": [ + "remove-cell", + "skip-execution" + ] + }, + "outputs": [], + "source": [ + "# WARNING: advised to install a specific version, e.g. tensorwaves==0.1.2\n", + "%pip install -q tensorwaves[doc,viz] IPython" ] }, { diff --git a/setup.cfg b/setup.cfg index 406e0f4a..de43b05b 100644 --- a/setup.cfg +++ b/setup.cfg @@ -87,8 +87,10 @@ doc = jupyter matplotlib myst-nb >=0.11 # myst_enable_extensions + nbclient >=0.5.5 # https://github.com/executablebooks/jupyter-book/issues/833 pandas Sphinx >=3 + Sphinx <4.4; python_version <"3.8.0" # https://github.com/ComPWA/qrules/runs/4833302679 sphinx-book-theme sphinx-copybutton sphinx-panels