From 2c0899a634ebd4a249fe0a7ffc0973fc8fcd1aa1 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 2 Jul 2024 00:56:20 +0000 Subject: [PATCH 01/13] MAINT: autoupdate pre-commit hooks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/ComPWA/policy: 0.3.4 → 0.3.9](https://github.com/ComPWA/policy/compare/0.3.4...0.3.9) - [github.com/pre-commit/pre-commit-hooks: v4.5.0 → v4.6.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.5.0...v4.6.0) - [github.com/asottile/blacken-docs: 1.16.0 → 1.18.0](https://github.com/asottile/blacken-docs/compare/1.16.0...1.18.0) - [github.com/psf/black: 24.3.0 → 24.4.2](https://github.com/psf/black/compare/24.3.0...24.4.2) - [github.com/streetsidesoftware/cspell-cli: v8.6.1 → v8.9.0](https://github.com/streetsidesoftware/cspell-cli/compare/v8.6.1...v8.9.0) --- .pre-commit-config.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index acfefbf..568d753 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -37,7 +37,7 @@ repos: metadata.vscode - repo: https://github.com/ComPWA/policy - rev: 0.3.4 + rev: 0.3.9 hooks: - id: check-dev-files args: @@ -63,7 +63,7 @@ repos: - --py36-plus - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 + rev: v4.6.0 hooks: - id: check-case-conflict - id: check-json @@ -80,7 +80,7 @@ repos: - id: trailing-whitespace - repo: https://github.com/asottile/blacken-docs - rev: 1.16.0 + rev: 1.18.0 hooks: - id: blacken-docs @@ -102,12 +102,12 @@ repos: - --in-place - repo: https://github.com/psf/black - rev: 24.3.0 + rev: 24.4.2 hooks: - id: black-jupyter - repo: https://github.com/streetsidesoftware/cspell-cli - rev: v8.6.1 + rev: v8.9.0 hooks: - id: cspell From 78b053290c48efa95ea8bd11bc82b9509630d977 Mon Sep 17 00:00:00 2001 From: GitHub Date: Tue, 2 Jul 2024 00:58:54 +0000 Subject: [PATCH 02/13] MAINT: update pip constraints and pre-commit --- binder/requirements.txt | 24 +++++----- requirements.txt | 102 ++++++++++++++++++++-------------------- 2 files changed, 63 insertions(+), 63 deletions(-) diff --git a/binder/requirements.txt b/binder/requirements.txt index e6626bd..3460f43 100644 --- a/binder/requirements.txt +++ b/binder/requirements.txt @@ -11,31 +11,31 @@ contourpy==1.1.1 cycler==0.12.1 decorator==5.1.1 executing==2.0.1 -fonttools==4.51.0 +fonttools==4.53.0 importlib-resources==6.4.0 ipython==8.12.3 -ipywidgets==8.1.2 +ipywidgets==8.1.3 jedi==0.19.1 -jupyterlab-widgets==3.0.10 +jupyterlab-widgets==3.0.11 kiwisolver==1.4.5 matplotlib==3.7.5 -matplotlib-inline==0.1.6 +matplotlib-inline==0.1.7 numpy==1.24.4 -packaging==24.0 +packaging==24.1 parso==0.8.4 pexpect==4.9.0 pickleshare==0.7.5 -pillow==10.3.0 -prompt-toolkit==3.0.43 +pillow==10.4.0 +prompt-toolkit==3.0.47 ptyprocess==0.7.0 pure-eval==0.2.2 -pygments==2.17.2 +pygments==2.18.0 pyparsing==3.1.2 python-dateutil==2.9.0.post0 six==1.16.0 stack-data==0.6.3 -traitlets==5.14.2 -typing-extensions==4.11.0 +traitlets==5.14.3 +typing-extensions==4.12.2 wcwidth==0.2.13 -widgetsnbextension==4.0.10 -zipp==3.18.1 +widgetsnbextension==4.0.11 +zipp==3.19.2 diff --git a/requirements.txt b/requirements.txt index 146beb9..57a2e16 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,20 +6,20 @@ # aiofiles==22.1.0 aiosqlite==0.20.0 -anyio==4.3.0 +anyio==4.4.0 argon2-cffi==23.1.0 argon2-cffi-bindings==21.2.0 arrow==1.3.0 asttokens==2.4.1 async-lru==2.0.4 attrs==23.2.0 -babel==2.14.0 +babel==2.15.0 backcall==0.2.0 beautifulsoup4==4.12.3 -black==24.3.0 +black==24.4.2 bleach==6.1.0 cachetools==5.3.3 -certifi==2024.2.2 +certifi==2024.6.2 cffi==1.16.0 cfgv==3.4.0 chardet==5.2.0 @@ -29,113 +29,113 @@ colorama==0.4.6 comm==0.2.2 contourpy==1.1.1 cycler==0.12.1 -debugpy==1.8.1 +debugpy==1.8.2 decorator==5.1.1 defusedxml==0.7.1 distlib==0.3.8 -exceptiongroup==1.2.0 +exceptiongroup==1.2.1 executing==2.0.1 -fastjsonschema==2.19.1 -filelock==3.13.3 -fonttools==4.51.0 +fastjsonschema==2.20.0 +filelock==3.15.4 +fonttools==4.53.0 fqdn==1.5.1 h11==0.14.0 httpcore==1.0.5 httpx==0.27.0 -identify==2.5.35 -idna==3.6 -importlib-metadata==7.1.0 +identify==2.5.36 +idna==3.7 +importlib-metadata==8.0.0 importlib-resources==6.4.0 -ipykernel==6.29.4 +ipykernel==6.29.5 ipython==8.12.3 -ipywidgets==8.1.2 +ipywidgets==8.1.3 isoduration==20.11.0 isort==5.13.2 jedi==0.19.1 -jinja2==3.1.3 -json5==0.9.24 -jsonpointer==2.4 -jsonschema==4.21.1 +jinja2==3.1.4 +json5==0.9.25 +jsonpointer==3.0.0 +jsonschema==4.22.0 jsonschema-specifications==2023.12.1 -jupyter-client==8.6.1 +jupyter-client==8.6.2 jupyter-core==5.7.2 jupyter-events==0.10.0 -jupyter-lsp==2.2.4 -jupyter-server==2.13.0 +jupyter-lsp==2.2.5 +jupyter-server==2.14.1 jupyter-server-terminals==0.5.3 -jupyterlab==4.1.5 +jupyterlab==4.2.3 jupyterlab-code-formatter==2.2.1 jupyterlab-pygments==0.3.0 -jupyterlab-server==2.25.4 -jupyterlab-widgets==3.0.10 +jupyterlab-server==2.27.2 +jupyterlab-widgets==3.0.11 kiwisolver==1.4.5 markupsafe==2.1.5 matplotlib==3.7.5 -matplotlib-inline==0.1.6 +matplotlib-inline==0.1.7 mistune==3.0.2 mypy-extensions==1.0.0 nbclient==0.10.0 -nbconvert==7.16.3 +nbconvert==7.16.4 nbformat==5.10.4 nest-asyncio==1.6.0 -nodeenv==1.8.0 +nodeenv==1.9.1 notebook-shim==0.2.4 numpy==1.24.4 overrides==7.7.0 -packaging==24.0 +packaging==24.1 pandocfilters==1.5.1 parso==0.8.4 pathspec==0.12.1 pexpect==4.9.0 pickleshare==0.7.5 -pillow==10.3.0 +pillow==10.4.0 pkgutil-resolve-name==1.3.10 -platformdirs==4.2.0 -pluggy==1.4.0 +platformdirs==4.2.2 +pluggy==1.5.0 pre-commit==3.5.0 prometheus-client==0.20.0 -prompt-toolkit==3.0.43 -psutil==5.9.8 +prompt-toolkit==3.0.47 +psutil==6.0.0 ptyprocess==0.7.0 pure-eval==0.2.2 pycparser==2.22 -pygments==2.17.2 +pygments==2.18.0 pyparsing==3.1.2 -pyproject-api==1.6.1 +pyproject-api==1.7.1 python-dateutil==2.9.0.post0 python-json-logger==2.0.7 pytz==2024.1 pyyaml==6.0.1 -pyzmq==25.1.2 -referencing==0.34.0 -requests==2.31.0 +pyzmq==26.0.3 +referencing==0.35.1 +requests==2.32.3 rfc3339-validator==0.1.4 rfc3986-validator==0.1.1 -rpds-py==0.18.0 -send2trash==1.8.2 +rpds-py==0.18.1 +send2trash==1.8.3 six==1.16.0 sniffio==1.3.1 soupsieve==2.5 stack-data==0.6.3 terminado==0.18.1 -tinycss2==1.2.1 +tinycss2==1.3.0 tomli==2.0.1 -tornado==6.4 -tox==4.14.2 -traitlets==5.14.2 +tornado==6.4.1 +tox==4.15.1 +traitlets==5.14.3 types-python-dateutil==2.9.0.20240316 -typing-extensions==4.11.0 +typing-extensions==4.12.2 uri-template==1.3.0 -urllib3==2.2.1 -virtualenv==20.25.1 +urllib3==2.2.2 +virtualenv==20.26.3 wcwidth==0.2.13 -webcolors==1.13 +webcolors==24.6.0 webencodings==0.5.1 -websocket-client==1.7.0 -widgetsnbextension==4.0.10 +websocket-client==1.8.0 +widgetsnbextension==4.0.11 y-py==0.5.9 ypy-websocket==0.8.2 -zipp==3.18.1 +zipp==3.19.2 # The following packages are considered to be unsafe in a requirements file: # setuptools From 84e6c7a85211918dbb573a219842249065e69d9e Mon Sep 17 00:00:00 2001 From: Remco de Boer <29308176+redeboer@users.noreply.github.com> Date: Wed, 7 Aug 2024 11:14:40 +0200 Subject: [PATCH 03/13] DX: implement `.envrc` for `direnv` --- .envrc | 1 + .vscode/settings.json | 1 + 2 files changed, 2 insertions(+) create mode 100644 .envrc diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..cce3aa5 --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +layout anaconda diff --git a/.vscode/settings.json b/.vscode/settings.json index 596cf2d..532740c 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -40,6 +40,7 @@ "multiDiffEditor.experimental.enabled": true, "python.analysis.autoImportCompletions": false, "python.languageServer": "Pylance", + "python.terminal.activateEnvironment": false, "python.testing.unittestEnabled": false, "redhat.telemetry.enabled": false, "rewrap.wrappingColumn": 88, From 956238f797add841f2c402fb42313c48e62b5f3c Mon Sep 17 00:00:00 2001 From: Remco de Boer <29308176+redeboer@users.noreply.github.com> Date: Wed, 7 Aug 2024 11:14:57 +0200 Subject: [PATCH 04/13] DX: modernise dev setup with latest ComPWA policy --- .pre-commit-config.yaml | 11 +++++++---- .vscode/settings.json | 8 ++------ 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 568d753..1302155 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -20,8 +20,10 @@ repos: - | cell.attachments cell.metadata.code_folding + cell.metadata.editable cell.metadata.id cell.metadata.pycharm + cell.metadata.slideshow cell.metadata.user_expressions metadata.celltoolbar metadata.colab.name @@ -37,7 +39,7 @@ repos: metadata.vscode - repo: https://github.com/ComPWA/policy - rev: 0.3.9 + rev: 0.3.17 hooks: - id: check-dev-files args: @@ -52,9 +54,10 @@ repos: - --repo-name=ComPWA-demo - --repo-title="ComPWA demos" - id: colab-toc-visible + - id: remove-empty-tags - repo: https://github.com/nbQA-dev/nbQA - rev: 1.8.5 + rev: 1.8.7 hooks: - id: nbqa-flake8 - id: nbqa-isort @@ -102,12 +105,12 @@ repos: - --in-place - repo: https://github.com/psf/black - rev: 24.4.2 + rev: 24.8.0 hooks: - id: black-jupyter - repo: https://github.com/streetsidesoftware/cspell-cli - rev: v8.9.0 + rev: v8.13.1 hooks: - id: cspell diff --git a/.vscode/settings.json b/.vscode/settings.json index 532740c..0d4466d 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -3,9 +3,7 @@ "editor.formatOnSave": false }, "[git-commit]": { - "editor.rulers": [ - 72 - ], + "editor.rulers": [72], "rewrap.wrappingColumn": 72 }, "[ipynb]": { @@ -33,9 +31,7 @@ "diffEditor.experimental.showMoves": true, "editor.formatOnSave": true, "git.rebaseWhenSync": true, - "github-actions.workflows.pinned.workflows": [ - ".github/workflows/ci.yml" - ], + "github-actions.workflows.pinned.workflows": [".github/workflows/ci.yml"], "gitlens.telemetry.enabled": false, "multiDiffEditor.experimental.enabled": true, "python.analysis.autoImportCompletions": false, From d572b3a4f2743b73b099aaca4f5c5b86208801a8 Mon Sep 17 00:00:00 2001 From: Remco de Boer <29308176+redeboer@users.noreply.github.com> Date: Wed, 7 Aug 2024 11:15:54 +0200 Subject: [PATCH 05/13] MAINT: remove redundant notebook cell metadata --- 2021.11.29/ampform.ipynb | 20 ++--- 2021.11.29/qrules.ipynb | 11 +-- 2021.11.29/tensorwaves-0.3.4.ipynb | 30 +++----- 2021.11.29/tensorwaves.ipynb | 30 +++----- 2021.12.13/ampform.ipynb | 40 +++------- 2021.12.13/qrules.ipynb | 23 ++---- 2021.12.13/tensorwaves-caching.ipynb | 74 ++++++------------- .../tensorwaves-optimized-expression.ipynb | 38 +++------- 2021.12.13/tensorwaves.ipynb | 34 +++------ 9 files changed, 87 insertions(+), 213 deletions(-) diff --git a/2021.11.29/ampform.ipynb b/2021.11.29/ampform.ipynb index 5ebc9b5..2d9ce84 100644 --- a/2021.11.29/ampform.ipynb +++ b/2021.11.29/ampform.ipynb @@ -22,9 +22,7 @@ }, { "cell_type": "markdown", - "metadata": { - "tags": [] - }, + "metadata": {}, "source": [ "## Install dependencies" ] @@ -44,8 +42,7 @@ "metadata": { "jupyter": { "source_hidden": true - }, - "tags": [] + } }, "outputs": [], "source": [ @@ -131,9 +128,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [] - }, + "metadata": {}, "outputs": [], "source": [ "dot = qrules.io.asdot(reaction, collapse_graphs=True, render_final_state_id=True)\n", @@ -177,8 +172,7 @@ "metadata": { "jupyter": { "source_hidden": true - }, - "tags": [] + } }, "outputs": [], "source": [ @@ -215,8 +209,7 @@ "metadata": { "jupyter": { "source_hidden": true - }, - "tags": [] + } }, "outputs": [], "source": [ @@ -262,8 +255,7 @@ "metadata": { "jupyter": { "source_hidden": true - }, - "tags": [] + } }, "outputs": [], "source": [ diff --git a/2021.11.29/qrules.ipynb b/2021.11.29/qrules.ipynb index 315fc39..7f06978 100644 --- a/2021.11.29/qrules.ipynb +++ b/2021.11.29/qrules.ipynb @@ -32,9 +32,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [] - }, + "metadata": {}, "outputs": [], "source": [ "%load_ext autoreload\n", @@ -73,9 +71,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [] - }, + "metadata": {}, "outputs": [], "source": [ "dot = qrules.io.asdot(reaction, collapse_graphs=True)\n", @@ -95,8 +91,7 @@ "metadata": { "jupyter": { "source_hidden": true - }, - "tags": [] + } }, "outputs": [], "source": [ diff --git a/2021.11.29/tensorwaves-0.3.4.ipynb b/2021.11.29/tensorwaves-0.3.4.ipynb index 9668868..84bfa18 100644 --- a/2021.11.29/tensorwaves-0.3.4.ipynb +++ b/2021.11.29/tensorwaves-0.3.4.ipynb @@ -22,9 +22,7 @@ }, { "cell_type": "markdown", - "metadata": { - "tags": [] - }, + "metadata": {}, "source": [ "## Install dependencies" ] @@ -32,9 +30,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [] - }, + "metadata": {}, "outputs": [], "source": [ "%pip install -q ampform[viz]==0.11.* tensorwaves[jax]==0.3.4 tensorflow==2.7.*" @@ -46,8 +42,7 @@ "metadata": { "jupyter": { "source_hidden": true - }, - "tags": [] + } }, "outputs": [], "source": [ @@ -104,8 +99,7 @@ "metadata": { "jupyter": { "source_hidden": true - }, - "tags": [] + } }, "outputs": [], "source": [ @@ -202,8 +196,7 @@ "metadata": { "jupyter": { "source_hidden": true - }, - "tags": [] + } }, "outputs": [], "source": [ @@ -248,9 +241,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [] - }, + "metadata": {}, "outputs": [], "source": [ "template = SympyModel(\n", @@ -288,8 +279,7 @@ "metadata": { "jupyter": { "source_hidden": true - }, - "tags": [] + } }, "outputs": [], "source": [ @@ -355,8 +345,7 @@ "metadata": { "jupyter": { "source_hidden": true - }, - "tags": [] + } }, "outputs": [], "source": [ @@ -377,8 +366,7 @@ "metadata": { "jupyter": { "source_hidden": true - }, - "tags": [] + } }, "outputs": [], "source": [ diff --git a/2021.11.29/tensorwaves.ipynb b/2021.11.29/tensorwaves.ipynb index 77f3404..f8180ea 100644 --- a/2021.11.29/tensorwaves.ipynb +++ b/2021.11.29/tensorwaves.ipynb @@ -22,9 +22,7 @@ }, { "cell_type": "markdown", - "metadata": { - "tags": [] - }, + "metadata": {}, "source": [ "## Install dependencies" ] @@ -32,9 +30,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [] - }, + "metadata": {}, "outputs": [], "source": [ "%pip install -q ampform[viz]==0.11.* tensorwaves[jax]==0.3.7" @@ -46,8 +42,7 @@ "metadata": { "jupyter": { "source_hidden": true - }, - "tags": [] + } }, "outputs": [], "source": [ @@ -104,8 +99,7 @@ "metadata": { "jupyter": { "source_hidden": true - }, - "tags": [] + } }, "outputs": [], "source": [ @@ -203,8 +197,7 @@ "metadata": { "jupyter": { "source_hidden": true - }, - "tags": [] + } }, "outputs": [], "source": [ @@ -249,9 +242,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [] - }, + "metadata": {}, "outputs": [], "source": [ "template = SympyModel(\n", @@ -288,8 +279,7 @@ "metadata": { "jupyter": { "source_hidden": true - }, - "tags": [] + } }, "outputs": [], "source": [ @@ -355,8 +345,7 @@ "metadata": { "jupyter": { "source_hidden": true - }, - "tags": [] + } }, "outputs": [], "source": [ @@ -377,8 +366,7 @@ "metadata": { "jupyter": { "source_hidden": true - }, - "tags": [] + } }, "outputs": [], "source": [ diff --git a/2021.12.13/ampform.ipynb b/2021.12.13/ampform.ipynb index 01d831d..170c9cc 100644 --- a/2021.12.13/ampform.ipynb +++ b/2021.12.13/ampform.ipynb @@ -22,9 +22,7 @@ }, { "cell_type": "markdown", - "metadata": { - "tags": [] - }, + "metadata": {}, "source": [ "## Install dependencies" ] @@ -44,8 +42,7 @@ "metadata": { "jupyter": { "source_hidden": true - }, - "tags": [] + } }, "outputs": [], "source": [ @@ -140,9 +137,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [] - }, + "metadata": {}, "outputs": [], "source": [ "dot = qrules.io.asdot(reaction, collapse_graphs=True, render_final_state_id=True)\n", @@ -186,8 +181,7 @@ "metadata": { "jupyter": { "source_hidden": true - }, - "tags": [] + } }, "outputs": [], "source": [ @@ -224,8 +218,7 @@ "metadata": { "jupyter": { "source_hidden": true - }, - "tags": [] + } }, "outputs": [], "source": [ @@ -274,8 +267,7 @@ "metadata": { "jupyter": { "source_hidden": true - }, - "tags": [] + } }, "outputs": [], "source": [ @@ -295,8 +287,7 @@ "metadata": { "jupyter": { "source_hidden": true - }, - "tags": [] + } }, "outputs": [], "source": [ @@ -416,8 +407,7 @@ "metadata": { "jupyter": { "source_hidden": true - }, - "tags": [] + } }, "outputs": [], "source": [ @@ -441,8 +431,7 @@ "metadata": { "jupyter": { "source_hidden": true - }, - "tags": [] + } }, "outputs": [], "source": [ @@ -462,8 +451,7 @@ "metadata": { "jupyter": { "source_hidden": true - }, - "tags": [] + } }, "outputs": [], "source": [ @@ -477,9 +465,7 @@ }, { "cell_type": "markdown", - "metadata": { - "tags": [] - }, + "metadata": {}, "source": [ "## Symbolic kinematic variables" ] @@ -507,9 +493,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [] - }, + "metadata": {}, "outputs": [], "source": [ "model.kinematic_variables[theta_1_12].doit()" diff --git a/2021.12.13/qrules.ipynb b/2021.12.13/qrules.ipynb index 38ce018..05e50c5 100644 --- a/2021.12.13/qrules.ipynb +++ b/2021.12.13/qrules.ipynb @@ -32,9 +32,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [] - }, + "metadata": {}, "outputs": [], "source": [ "%load_ext autoreload\n", @@ -46,9 +44,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [] - }, + "metadata": {}, "outputs": [], "source": [ "PDG = qrules.load_pdg()\n", @@ -58,9 +54,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [] - }, + "metadata": {}, "outputs": [], "source": [ "selection = PDG.filter(\n", @@ -76,9 +70,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [] - }, + "metadata": {}, "outputs": [], "source": [ "qrules.check_reaction_violations(\n", @@ -117,9 +109,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [] - }, + "metadata": {}, "outputs": [], "source": [ "dot = qrules.io.asdot(reaction, collapse_graphs=True)\n", @@ -139,8 +129,7 @@ "metadata": { "jupyter": { "source_hidden": true - }, - "tags": [] + } }, "outputs": [], "source": [ diff --git a/2021.12.13/tensorwaves-caching.ipynb b/2021.12.13/tensorwaves-caching.ipynb index 3aa034f..c694204 100644 --- a/2021.12.13/tensorwaves-caching.ipynb +++ b/2021.12.13/tensorwaves-caching.ipynb @@ -24,9 +24,7 @@ }, { "cell_type": "markdown", - "metadata": { - "tags": [] - }, + "metadata": {}, "source": [ "## Install dependencies" ] @@ -34,9 +32,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [] - }, + "metadata": {}, "outputs": [], "source": [ "%pip install -q ampform[viz]==0.12.* tensorwaves[jax,pwa]==0.4.*" @@ -48,8 +44,7 @@ "metadata": { "jupyter": { "source_hidden": true - }, - "tags": [] + } }, "outputs": [], "source": [ @@ -112,8 +107,7 @@ "metadata": { "jupyter": { "source_hidden": true - }, - "tags": [] + } }, "outputs": [], "source": [ @@ -211,8 +205,7 @@ "metadata": { "jupyter": { "source_hidden": true - }, - "tags": [] + } }, "outputs": [], "source": [ @@ -257,9 +250,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [] - }, + "metadata": {}, "outputs": [], "source": [ "expression = model.expression.doit()\n", @@ -294,8 +285,7 @@ "metadata": { "jupyter": { "source_hidden": true - }, - "tags": [] + } }, "outputs": [], "source": [ @@ -369,9 +359,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [] - }, + "metadata": {}, "outputs": [], "source": [ "free_parameters = {p for p in model.parameter_defaults if p.name in initial_parameters}\n", @@ -486,9 +474,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [] - }, + "metadata": {}, "outputs": [], "source": [ "def cache_constant_sub_expressions(expression, free_symbols):\n", @@ -512,9 +498,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [] - }, + "metadata": {}, "outputs": [], "source": [ "cached_expression, cse = cache_constant_sub_expressions(\n", @@ -529,8 +513,7 @@ "metadata": { "jupyter": { "source_hidden": true - }, - "tags": [] + } }, "outputs": [], "source": [ @@ -544,8 +527,7 @@ "metadata": { "jupyter": { "source_hidden": true - }, - "tags": [] + } }, "outputs": [], "source": [ @@ -559,8 +541,7 @@ "metadata": { "jupyter": { "source_hidden": true - }, - "tags": [] + } }, "outputs": [], "source": [ @@ -574,8 +555,7 @@ "metadata": { "jupyter": { "source_hidden": true - }, - "tags": [] + } }, "outputs": [], "source": [ @@ -586,9 +566,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [] - }, + "metadata": {}, "outputs": [], "source": [ "cache_converter = SympyDataTransformer.from_sympy(cse, backend=\"jax\")\n", @@ -606,9 +584,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [] - }, + "metadata": {}, "outputs": [], "source": [ "# Express expressions in backend\n", @@ -637,9 +613,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [] - }, + "metadata": {}, "outputs": [], "source": [ "estimator = UnbinnedNLL(function, data, phsp, backend=\"jax\")\n", @@ -650,9 +624,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [] - }, + "metadata": {}, "outputs": [], "source": [ "estimator = UnbinnedNLL(optimized_function, data_real, phsp_real, backend=\"jax\")\n", @@ -671,9 +643,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [] - }, + "metadata": {}, "outputs": [], "source": [ "estimator = UnbinnedNLL(cached_function, cached_data, cached_phsp, backend=\"jax\")\n", @@ -687,8 +657,7 @@ "metadata": { "jupyter": { "source_hidden": true - }, - "tags": [] + } }, "outputs": [], "source": [ @@ -709,8 +678,7 @@ "metadata": { "jupyter": { "source_hidden": true - }, - "tags": [] + } }, "outputs": [], "source": [ diff --git a/2021.12.13/tensorwaves-optimized-expression.ipynb b/2021.12.13/tensorwaves-optimized-expression.ipynb index 48d5609..5f891b1 100644 --- a/2021.12.13/tensorwaves-optimized-expression.ipynb +++ b/2021.12.13/tensorwaves-optimized-expression.ipynb @@ -24,9 +24,7 @@ }, { "cell_type": "markdown", - "metadata": { - "tags": [] - }, + "metadata": {}, "source": [ "## Install dependencies" ] @@ -34,9 +32,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [] - }, + "metadata": {}, "outputs": [], "source": [ "%pip install -q ampform[viz]==0.12.* tensorwaves[jax,pwa]==0.4.*" @@ -48,8 +44,7 @@ "metadata": { "jupyter": { "source_hidden": true - }, - "tags": [] + } }, "outputs": [], "source": [ @@ -111,8 +106,7 @@ "metadata": { "jupyter": { "source_hidden": true - }, - "tags": [] + } }, "outputs": [], "source": [ @@ -210,8 +204,7 @@ "metadata": { "jupyter": { "source_hidden": true - }, - "tags": [] + } }, "outputs": [], "source": [ @@ -256,9 +249,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [] - }, + "metadata": {}, "outputs": [], "source": [ "expression = model.expression.doit()\n", @@ -293,8 +284,7 @@ "metadata": { "jupyter": { "source_hidden": true - }, - "tags": [] + } }, "outputs": [], "source": [ @@ -361,9 +351,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [] - }, + "metadata": {}, "outputs": [], "source": [ "fixed_parameters = {\n", @@ -499,9 +487,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [] - }, + "metadata": {}, "outputs": [], "source": [ "estimator = UnbinnedNLL(optimized_function, data_real, phsp_real, backend=\"jax\")\n", @@ -524,8 +510,7 @@ "metadata": { "jupyter": { "source_hidden": true - }, - "tags": [] + } }, "outputs": [], "source": [ @@ -546,8 +531,7 @@ "metadata": { "jupyter": { "source_hidden": true - }, - "tags": [] + } }, "outputs": [], "source": [ diff --git a/2021.12.13/tensorwaves.ipynb b/2021.12.13/tensorwaves.ipynb index 59ee2ec..fc1f7b1 100644 --- a/2021.12.13/tensorwaves.ipynb +++ b/2021.12.13/tensorwaves.ipynb @@ -22,9 +22,7 @@ }, { "cell_type": "markdown", - "metadata": { - "tags": [] - }, + "metadata": {}, "source": [ "## Install dependencies" ] @@ -32,9 +30,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [] - }, + "metadata": {}, "outputs": [], "source": [ "%pip install -q ampform[viz]==0.12.* tensorwaves[jax,pwa]==0.4.*" @@ -46,8 +42,7 @@ "metadata": { "jupyter": { "source_hidden": true - }, - "tags": [] + } }, "outputs": [], "source": [ @@ -109,8 +104,7 @@ "metadata": { "jupyter": { "source_hidden": true - }, - "tags": [] + } }, "outputs": [], "source": [ @@ -208,8 +202,7 @@ "metadata": { "jupyter": { "source_hidden": true - }, - "tags": [] + } }, "outputs": [], "source": [ @@ -254,9 +247,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [] - }, + "metadata": {}, "outputs": [], "source": [ "expression = model.expression.doit()\n", @@ -291,8 +282,7 @@ "metadata": { "jupyter": { "source_hidden": true - }, - "tags": [] + } }, "outputs": [], "source": [ @@ -345,9 +335,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [] - }, + "metadata": {}, "outputs": [], "source": [ "function = create_parametrized_function(expression, parameter_defaults, backend=\"jax\")\n", @@ -372,8 +360,7 @@ "metadata": { "jupyter": { "source_hidden": true - }, - "tags": [] + } }, "outputs": [], "source": [ @@ -394,8 +381,7 @@ "metadata": { "jupyter": { "source_hidden": true - }, - "tags": [] + } }, "outputs": [], "source": [ From b3dc539fb81a3a8c54a1b5b09a83a82dfbe96b70 Mon Sep 17 00:00:00 2001 From: Remco de Boer <29308176+redeboer@users.noreply.github.com> Date: Wed, 7 Aug 2024 11:32:01 +0200 Subject: [PATCH 06/13] DX: switch to Ruff as formatter and linter --- .pre-commit-config.yaml | 28 ++++--------- .vscode/extensions.json | 8 ++-- .vscode/settings.json | 10 ++++- README.md | 1 + pyproject.toml | 87 +++++++++++++++++++++++++++++++++-------- requirements.in | 3 +- 6 files changed, 95 insertions(+), 42 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1302155..2d35776 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -39,7 +39,7 @@ repos: metadata.vscode - repo: https://github.com/ComPWA/policy - rev: 0.3.17 + rev: 0.3.18 hooks: - id: check-dev-files args: @@ -48,22 +48,20 @@ repos: - --no-gitpod - --no-prettierrc - --no-pypi - - --no-python - - --no-ruff - --no-version-branches - --repo-name=ComPWA-demo - --repo-title="ComPWA demos" - id: colab-toc-visible - id: remove-empty-tags - - repo: https://github.com/nbQA-dev/nbQA - rev: 1.8.7 + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.5.6 hooks: - - id: nbqa-flake8 - - id: nbqa-isort - - id: nbqa-pyupgrade - args: - - --py36-plus + - id: ruff + args: [--fix] + types_or: [python, pyi, jupyter] + - id: ruff-format + types_or: [python, pyi, jupyter] - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.6.0 @@ -82,11 +80,6 @@ repos: - id: mixed-line-ending - id: trailing-whitespace - - repo: https://github.com/asottile/blacken-docs - rev: 1.18.0 - hooks: - - id: blacken-docs - - repo: https://github.com/pre-commit/mirrors-prettier rev: v4.0.0-alpha.8 hooks: @@ -104,11 +97,6 @@ repos: args: - --in-place - - repo: https://github.com/psf/black - rev: 24.8.0 - hooks: - - id: black-jupyter - - repo: https://github.com/streetsidesoftware/cspell-cli rev: v8.13.1 hooks: diff --git a/.vscode/extensions.json b/.vscode/extensions.json index d128869..7f72746 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,12 +1,10 @@ { "recommendations": [ + "charliermarsh.ruff", "eamodio.gitlens", "editorconfig.editorconfig", "esbenp.prettier-vscode", "github.vscode-github-actions", - "ms-python.black-formatter", - "ms-python.flake8", - "ms-python.isort", "ms-python.python", "ms-vsliveshare.vsliveshare", "redhat.vscode-yaml", @@ -20,6 +18,10 @@ "bungcip.better-toml", "davidanson.vscode-markdownlint", "garaioag.garaio-vscode-unwanted-recommendations", + "ms-python.black-formatter", + "ms-python.flake8", + "ms-python.isort", + "ms-python.mypy-type-checker", "ms-python.pylint", "travisillig.vscode-json-stable-stringify", "tyriar.sort-lines" diff --git a/.vscode/settings.json b/.vscode/settings.json index 0d4466d..cf31567 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -22,7 +22,8 @@ "[python]": { "editor.codeActionsOnSave": { "source.organizeImports": "explicit" - } + }, + "editor.defaultFormatter": "charliermarsh.ruff" }, "[yaml]": { "editor.defaultFormatter": "esbenp.prettier-vscode" @@ -34,11 +35,18 @@ "github-actions.workflows.pinned.workflows": [".github/workflows/ci.yml"], "gitlens.telemetry.enabled": false, "multiDiffEditor.experimental.enabled": true, + "notebook.codeActionsOnSave": { + "notebook.source.organizeImports": "explicit" + }, + "notebook.formatOnSave.enabled": true, "python.analysis.autoImportCompletions": false, "python.languageServer": "Pylance", "python.terminal.activateEnvironment": false, "python.testing.unittestEnabled": false, "redhat.telemetry.enabled": false, "rewrap.wrappingColumn": 88, + "ruff.enable": true, + "ruff.importStrategy": "fromEnvironment", + "ruff.organizeImports": true, "telemetry.telemetryLevel": "off" } diff --git a/README.md b/README.md index b07dcc2..51f0919 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # ComPWA demo notebooks +[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff) [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier) [![Spelling checked](https://img.shields.io/badge/cspell-checked-brightgreen.svg)](https://github.com/streetsidesoftware/cspell/tree/master/packages/cspell) diff --git a/pyproject.toml b/pyproject.toml index b79391c..3112dec 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,27 +1,82 @@ -[tool.black] -target-version = [ - "py36", - "py37", - "py38", - "py39", -] - -[tool.isort] -profile = "black" - -[tool.nbqa.addopts] -flake8 = [ - "--extend-ignore=E402,E501", -] - [tool.pytest.ini_options] addopts = [ + "--color=yes", "--durations=0", ] filterwarnings = [ "ignore:Passing a schema to Validator.iter_errors is deprecated.*:DeprecationWarning", ] +[tool.ruff] +extend-include = ["*.ipynb"] +preview = true +show-fixes = true +target-version = "py37" + +[tool.ruff.format] +docstring-code-format = true +line-ending = "lf" + +[tool.ruff.lint] +ignore = [ + "ANN401", + "COM812", + "CPY001", + "D101", + "D102", + "D103", + "D105", + "D107", + "D203", + "D213", + "D407", + "D416", + "DOC", + "E501", + "FURB101", + "FURB103", + "FURB140", + "G004", + "ISC001", + "PLW1514", + "PT001", + "PTH", + "SIM108", +] +select = ["ALL"] +task-tags = ["cspell"] + +[tool.ruff.lint.flake8-builtins] +builtins-ignorelist = ["display"] + +[tool.ruff.lint.flake8-comprehensions] +allow-dict-calls-with-keyword-arguments = true + +[tool.ruff.lint.isort] +split-on-trailing-comma = false + +[tool.ruff.lint.per-file-ignores] +"*.ipynb" = [ + "ANN", + "B018", + "C90", + "D", + "E303", + "E703", + "N806", + "N816", + "PLR09", + "PLR2004", + "PLW0602", + "PLW0603", + "S101", + "T20", + "TCH00", +] + +[tool.ruff.lint.pydocstyle] +convention = "google" + [tool.tomlsort] all = false ignore_case = true diff --git a/requirements.in b/requirements.in index 5939261..6ffe7cc 100644 --- a/requirements.in +++ b/requirements.in @@ -1,9 +1,8 @@ -c binder/requirements.txt -r binder/requirements.in -black -isort jupyterlab >=3 jupyterlab-code-formatter pre-commit +ruff tox ypy-websocket <0.8.3 # dependency conflict From f6405f7a2ed89365322d57c90dc07612320f7f86 Mon Sep 17 00:00:00 2001 From: Remco de Boer <29308176+redeboer@users.noreply.github.com> Date: Wed, 7 Aug 2024 11:32:26 +0200 Subject: [PATCH 07/13] MAINT: apply Ruff formatting --- 2021.12.13/tensorwaves-caching.ipynb | 10 ++++------ 2021.12.13/tensorwaves-optimized-expression.ipynb | 10 ++++------ 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/2021.12.13/tensorwaves-caching.ipynb b/2021.12.13/tensorwaves-caching.ipynb index c694204..39bdb7c 100644 --- a/2021.12.13/tensorwaves-caching.ipynb +++ b/2021.12.13/tensorwaves-caching.ipynb @@ -383,12 +383,10 @@ "metadata": {}, "outputs": [], "source": [ - "optimized_expression = optimized_expression.subs(\n", - " {\n", - " sp.Symbol(f\"m_{i}\", real=True): particle.mass\n", - " for i, particle in reaction.final_state.items()\n", - " }\n", - ")\n", + "optimized_expression = optimized_expression.subs({\n", + " sp.Symbol(f\"m_{i}\", real=True): particle.mass\n", + " for i, particle in reaction.final_state.items()\n", + "})\n", "sp.count_ops(optimized_expression)" ] }, diff --git a/2021.12.13/tensorwaves-optimized-expression.ipynb b/2021.12.13/tensorwaves-optimized-expression.ipynb index 5f891b1..a51581b 100644 --- a/2021.12.13/tensorwaves-optimized-expression.ipynb +++ b/2021.12.13/tensorwaves-optimized-expression.ipynb @@ -376,12 +376,10 @@ "metadata": {}, "outputs": [], "source": [ - "optimized_expression = optimized_expression.subs(\n", - " {\n", - " sp.Symbol(f\"m_{i}\", real=True): particle.mass\n", - " for i, particle in reaction.final_state.items()\n", - " }\n", - ")\n", + "optimized_expression = optimized_expression.subs({\n", + " sp.Symbol(f\"m_{i}\", real=True): particle.mass\n", + " for i, particle in reaction.final_state.items()\n", + "})\n", "sp.count_ops(optimized_expression)" ] }, From 5208f1faf6121320a55a98f2f74750d682c401a8 Mon Sep 17 00:00:00 2001 From: Remco de Boer <29308176+redeboer@users.noreply.github.com> Date: Wed, 7 Aug 2024 11:34:40 +0200 Subject: [PATCH 08/13] FIX: do not format notebooks with Prettier --- .prettierignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 .prettierignore diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..fa65608 --- /dev/null +++ b/.prettierignore @@ -0,0 +1 @@ +*.ipynb From acbb79e521618c95e52e33b203b72ff7938c1559 Mon Sep 17 00:00:00 2001 From: Remco de Boer <29308176+redeboer@users.noreply.github.com> Date: Wed, 7 Aug 2024 11:40:22 +0200 Subject: [PATCH 09/13] ENH: compile constraint files with `uv pip compile` --- .github/workflows/constraints.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/constraints.yml b/.github/workflows/constraints.yml index 3cac60d..b87dcca 100644 --- a/.github/workflows/constraints.yml +++ b/.github/workflows/constraints.yml @@ -24,9 +24,9 @@ jobs: - uses: actions/setup-python@v5 with: python-version: "3.8" - - run: pip install pip-tools - - run: pip-compile --no-annotate --strip-extras --upgrade binder/requirements.in - - run: pip-compile --no-annotate --strip-extras --upgrade requirements.in + - run: pip install uv + - run: uv pip compile binder/requirements.in -o binder/requirements.txt --no-annotate --strip-extras --upgrade + - run: uv pip compile requirements.in -o requirements.txt --no-annotate --strip-extras --upgrade - uses: actions/upload-artifact@v4 with: name: pip-constraints From eeba29fde491b9394f40ba492571516ae10fdab5 Mon Sep 17 00:00:00 2001 From: Remco de Boer <29308176+redeboer@users.noreply.github.com> Date: Wed, 7 Aug 2024 11:40:51 +0200 Subject: [PATCH 10/13] DX: add `*.egg-info/` to `.gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 9727aa9..22223ed 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ *.csv +*.egg-info/ .ipynb_checkpoints/ .tox/ condaenv.*.requirements.txt From 0eddb733c9ba4be4638d930014723ed754f21d21 Mon Sep 17 00:00:00 2001 From: Remco de Boer <29308176+redeboer@users.noreply.github.com> Date: Wed, 7 Aug 2024 11:42:39 +0200 Subject: [PATCH 11/13] MAINT: address Ruff issues --- 2021.11.29/tensorwaves-0.3.4.ipynb | 4 ++-- 2021.11.29/tensorwaves.ipynb | 4 ++-- 2021.12.13/ampform.ipynb | 2 +- 2021.12.13/tensorwaves-caching.ipynb | 6 +++--- 2021.12.13/tensorwaves-optimized-expression.ipynb | 4 ++-- 2021.12.13/tensorwaves.ipynb | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/2021.11.29/tensorwaves-0.3.4.ipynb b/2021.11.29/tensorwaves-0.3.4.ipynb index 84bfa18..186590c 100644 --- a/2021.11.29/tensorwaves-0.3.4.ipynb +++ b/2021.11.29/tensorwaves-0.3.4.ipynb @@ -55,7 +55,7 @@ "\n", "import ampform\n", "import graphviz\n", - "import matplotlib\n", + "import matplotlib as mpl\n", "import matplotlib.pyplot as plt\n", "import numpy as np\n", "import qrules\n", @@ -77,7 +77,7 @@ "tf.get_logger().setLevel(\"WARNING\")\n", "warnings.filterwarnings(\"ignore\")\n", "\n", - "matplotlib.rcParams.update({\"font.size\": 14})\n", + "mpl.rcParams.update({\"font.size\": 14})\n", "np_config.enable_numpy_behavior()\n", "\n", "has_tf_gpu = bool(tf.config.list_physical_devices(\"GPU\"))\n", diff --git a/2021.11.29/tensorwaves.ipynb b/2021.11.29/tensorwaves.ipynb index f8180ea..9a206d1 100644 --- a/2021.11.29/tensorwaves.ipynb +++ b/2021.11.29/tensorwaves.ipynb @@ -55,7 +55,7 @@ "\n", "import ampform\n", "import graphviz\n", - "import matplotlib\n", + "import matplotlib as mpl\n", "import matplotlib.pyplot as plt\n", "import numpy as np\n", "import qrules\n", @@ -77,7 +77,7 @@ "tf.get_logger().setLevel(\"WARNING\")\n", "warnings.filterwarnings(\"ignore\")\n", "\n", - "matplotlib.rcParams.update({\"font.size\": 14})\n", + "mpl.rcParams.update({\"font.size\": 14})\n", "np_config.enable_numpy_behavior()\n", "\n", "has_tf_gpu = bool(tf.config.list_physical_devices(\"GPU\"))\n", diff --git a/2021.12.13/ampform.ipynb b/2021.12.13/ampform.ipynb index 170c9cc..2f8a090 100644 --- a/2021.12.13/ampform.ipynb +++ b/2021.12.13/ampform.ipynb @@ -457,7 +457,7 @@ "source": [ "expr_subs = expr.subs(mass_substitutions)\n", "expr_subs = round_nested(expr_subs, n_decimals=2)\n", - "node = [s for s in sp.preorder_traversal(expr_subs) if isinstance(s, sp.Float)][0]\n", + "node = next(s for s in sp.preorder_traversal(expr_subs) if isinstance(s, sp.Float))\n", "dot = sp.dotprint(expr_subs.subs(node, Symbol(f\"{node}\")), **graph_style)\n", "display(expr_subs.subs(node, sp.Symbol(Rf\"\\color{{RoyalBlue}}{node}\")))\n", "graphviz.Source(dot)" diff --git a/2021.12.13/tensorwaves-caching.ipynb b/2021.12.13/tensorwaves-caching.ipynb index 39bdb7c..37e565b 100644 --- a/2021.12.13/tensorwaves-caching.ipynb +++ b/2021.12.13/tensorwaves-caching.ipynb @@ -57,7 +57,7 @@ "\n", "import ampform\n", "import graphviz\n", - "import matplotlib\n", + "import matplotlib as mpl\n", "import matplotlib.pyplot as plt\n", "import numpy as np\n", "import qrules\n", @@ -85,7 +85,7 @@ "tf.get_logger().setLevel(\"WARNING\")\n", "warnings.filterwarnings(\"ignore\")\n", "\n", - "matplotlib.rcParams.update({\"font.size\": 14})\n", + "mpl.rcParams.update({\"font.size\": 14})\n", "np_config.enable_numpy_behavior()\n", "\n", "has_tf_gpu = bool(tf.config.list_physical_devices(\"GPU\"))\n", @@ -481,7 +481,7 @@ " cached_expression = cached_expressions[0]\n", " cse_dict = dict(cse)\n", " cse_symbols = set(cse_dict)\n", - " while any([bool(expr.free_symbols & cse_symbols) for expr in cse_dict.values()]):\n", + " while any(bool(expr.free_symbols & cse_symbols) for expr in cse_dict.values()):\n", " cse_dict = {\n", " symbol: expr.xreplace(cse_dict) for symbol, expr in cse_dict.items()\n", " }\n", diff --git a/2021.12.13/tensorwaves-optimized-expression.ipynb b/2021.12.13/tensorwaves-optimized-expression.ipynb index a51581b..5409029 100644 --- a/2021.12.13/tensorwaves-optimized-expression.ipynb +++ b/2021.12.13/tensorwaves-optimized-expression.ipynb @@ -57,7 +57,7 @@ "\n", "import ampform\n", "import graphviz\n", - "import matplotlib\n", + "import matplotlib as mpl\n", "import matplotlib.pyplot as plt\n", "import numpy as np\n", "import qrules\n", @@ -84,7 +84,7 @@ "tf.get_logger().setLevel(\"WARNING\")\n", "warnings.filterwarnings(\"ignore\")\n", "\n", - "matplotlib.rcParams.update({\"font.size\": 14})\n", + "mpl.rcParams.update({\"font.size\": 14})\n", "np_config.enable_numpy_behavior()\n", "\n", "has_tf_gpu = bool(tf.config.list_physical_devices(\"GPU\"))\n", diff --git a/2021.12.13/tensorwaves.ipynb b/2021.12.13/tensorwaves.ipynb index fc1f7b1..57edec0 100644 --- a/2021.12.13/tensorwaves.ipynb +++ b/2021.12.13/tensorwaves.ipynb @@ -55,7 +55,7 @@ "\n", "import ampform\n", "import graphviz\n", - "import matplotlib\n", + "import matplotlib as mpl\n", "import matplotlib.pyplot as plt\n", "import numpy as np\n", "import qrules\n", @@ -82,7 +82,7 @@ "tf.get_logger().setLevel(\"WARNING\")\n", "warnings.filterwarnings(\"ignore\")\n", "\n", - "matplotlib.rcParams.update({\"font.size\": 14})\n", + "mpl.rcParams.update({\"font.size\": 14})\n", "np_config.enable_numpy_behavior()\n", "\n", "has_tf_gpu = bool(tf.config.list_physical_devices(\"GPU\"))\n", From 2b6aa06cd582624baad52cce1a87e9087d6d0262 Mon Sep 17 00:00:00 2001 From: GitHub Date: Wed, 7 Aug 2024 09:43:27 +0000 Subject: [PATCH 12/13] MAINT: update pip constraints and pre-commit --- binder/requirements.txt | 12 +++------ requirements.txt | 56 +++++++++++++++++------------------------ 2 files changed, 27 insertions(+), 41 deletions(-) diff --git a/binder/requirements.txt b/binder/requirements.txt index 3460f43..04d18da 100644 --- a/binder/requirements.txt +++ b/binder/requirements.txt @@ -1,9 +1,5 @@ -# -# This file is autogenerated by pip-compile with Python 3.8 -# by the following command: -# -# pip-compile --no-annotate --strip-extras binder/requirements.in -# +# This file was autogenerated by uv via the following command: +# uv pip compile binder/requirements.in -o binder/requirements.txt --no-annotate --strip-extras asttokens==2.4.1 backcall==0.2.0 comm==0.2.2 @@ -11,7 +7,7 @@ contourpy==1.1.1 cycler==0.12.1 decorator==5.1.1 executing==2.0.1 -fonttools==4.53.0 +fonttools==4.53.1 importlib-resources==6.4.0 ipython==8.12.3 ipywidgets==8.1.3 @@ -28,7 +24,7 @@ pickleshare==0.7.5 pillow==10.4.0 prompt-toolkit==3.0.47 ptyprocess==0.7.0 -pure-eval==0.2.2 +pure-eval==0.2.3 pygments==2.18.0 pyparsing==3.1.2 python-dateutil==2.9.0.post0 diff --git a/requirements.txt b/requirements.txt index 57a2e16..58a2069 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,9 +1,5 @@ -# -# This file is autogenerated by pip-compile with Python 3.8 -# by the following command: -# -# pip-compile --no-annotate --strip-extras requirements.in -# +# This file was autogenerated by uv via the following command: +# uv pip compile requirements.in -o requirements.txt --no-annotate --strip-extras aiofiles==22.1.0 aiosqlite==0.20.0 anyio==4.4.0 @@ -12,68 +8,64 @@ argon2-cffi-bindings==21.2.0 arrow==1.3.0 asttokens==2.4.1 async-lru==2.0.4 -attrs==23.2.0 +attrs==24.2.0 babel==2.15.0 backcall==0.2.0 beautifulsoup4==4.12.3 -black==24.4.2 bleach==6.1.0 -cachetools==5.3.3 -certifi==2024.6.2 -cffi==1.16.0 +cachetools==5.4.0 +certifi==2024.7.4 +cffi==1.17.0 cfgv==3.4.0 chardet==5.2.0 charset-normalizer==3.3.2 -click==8.1.7 colorama==0.4.6 comm==0.2.2 contourpy==1.1.1 cycler==0.12.1 -debugpy==1.8.2 +debugpy==1.8.5 decorator==5.1.1 defusedxml==0.7.1 distlib==0.3.8 -exceptiongroup==1.2.1 +exceptiongroup==1.2.2 executing==2.0.1 fastjsonschema==2.20.0 filelock==3.15.4 -fonttools==4.53.0 +fonttools==4.53.1 fqdn==1.5.1 h11==0.14.0 httpcore==1.0.5 httpx==0.27.0 -identify==2.5.36 +identify==2.6.0 idna==3.7 -importlib-metadata==8.0.0 +importlib-metadata==8.2.0 importlib-resources==6.4.0 ipykernel==6.29.5 ipython==8.12.3 ipywidgets==8.1.3 isoduration==20.11.0 -isort==5.13.2 jedi==0.19.1 jinja2==3.1.4 json5==0.9.25 jsonpointer==3.0.0 -jsonschema==4.22.0 +jsonschema==4.23.0 jsonschema-specifications==2023.12.1 jupyter-client==8.6.2 jupyter-core==5.7.2 jupyter-events==0.10.0 jupyter-lsp==2.2.5 -jupyter-server==2.14.1 +jupyter-server==2.14.2 jupyter-server-terminals==0.5.3 -jupyterlab==4.2.3 -jupyterlab-code-formatter==2.2.1 +jupyterlab==4.2.4 +jupyterlab-code-formatter==3.0.0 jupyterlab-pygments==0.3.0 -jupyterlab-server==2.27.2 +jupyterlab-server==2.27.3 jupyterlab-widgets==3.0.11 kiwisolver==1.4.5 markupsafe==2.1.5 matplotlib==3.7.5 matplotlib-inline==0.1.7 mistune==3.0.2 -mypy-extensions==1.0.0 nbclient==0.10.0 nbconvert==7.16.4 nbformat==5.10.4 @@ -85,7 +77,6 @@ overrides==7.7.0 packaging==24.1 pandocfilters==1.5.1 parso==0.8.4 -pathspec==0.12.1 pexpect==4.9.0 pickleshare==0.7.5 pillow==10.4.0 @@ -97,7 +88,7 @@ prometheus-client==0.20.0 prompt-toolkit==3.0.47 psutil==6.0.0 ptyprocess==0.7.0 -pure-eval==0.2.2 +pure-eval==0.2.3 pycparser==2.22 pygments==2.18.0 pyparsing==3.1.2 @@ -105,14 +96,16 @@ pyproject-api==1.7.1 python-dateutil==2.9.0.post0 python-json-logger==2.0.7 pytz==2024.1 -pyyaml==6.0.1 -pyzmq==26.0.3 +pyyaml==6.0.2 +pyzmq==26.1.0 referencing==0.35.1 requests==2.32.3 rfc3339-validator==0.1.4 rfc3986-validator==0.1.1 -rpds-py==0.18.1 +rpds-py==0.20.0 +ruff==0.5.6 send2trash==1.8.3 +setuptools==72.1.0 six==1.16.0 sniffio==1.3.1 soupsieve==2.5 @@ -121,7 +114,7 @@ terminado==0.18.1 tinycss2==1.3.0 tomli==2.0.1 tornado==6.4.1 -tox==4.15.1 +tox==4.17.0 traitlets==5.14.3 types-python-dateutil==2.9.0.20240316 typing-extensions==4.12.2 @@ -136,6 +129,3 @@ widgetsnbextension==4.0.11 y-py==0.5.9 ypy-websocket==0.8.2 zipp==3.19.2 - -# The following packages are considered to be unsafe in a requirements file: -# setuptools From db26c4bed31564146b438365bd1fc2b8d6217581 Mon Sep 17 00:00:00 2001 From: GitHub Date: Wed, 7 Aug 2024 15:00:45 +0000 Subject: [PATCH 13/13] MAINT: update pip constraints and pre-commit --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 58a2069..15c1eef 100644 --- a/requirements.txt +++ b/requirements.txt @@ -57,7 +57,7 @@ jupyter-lsp==2.2.5 jupyter-server==2.14.2 jupyter-server-terminals==0.5.3 jupyterlab==4.2.4 -jupyterlab-code-formatter==3.0.0 +jupyterlab-code-formatter==3.0.1 jupyterlab-pygments==0.3.0 jupyterlab-server==2.27.3 jupyterlab-widgets==3.0.11