From 5c534ef36e1a355c85499cc75eb8c1789aa1d470 Mon Sep 17 00:00:00 2001 From: Remco de Boer <29308176+redeboer@users.noreply.github.com> Date: Mon, 29 Jan 2024 18:16:58 +0100 Subject: [PATCH 1/8] MAINT: autoupdate pip constraints --- .constraints/py3.10.txt | 62 ++++++++++++++++++++--------------------- .constraints/py3.11.txt | 62 ++++++++++++++++++++--------------------- .constraints/py3.12.txt | 62 ++++++++++++++++++++--------------------- .constraints/py3.7.txt | 18 ++++++------ .constraints/py3.8.txt | 52 +++++++++++++++++----------------- .constraints/py3.9.txt | 62 ++++++++++++++++++++--------------------- 6 files changed, 159 insertions(+), 159 deletions(-) diff --git a/.constraints/py3.10.txt b/.constraints/py3.10.txt index a2bc06f72..6bf15e098 100644 --- a/.constraints/py3.10.txt +++ b/.constraints/py3.10.txt @@ -14,8 +14,8 @@ asttokens==2.4.1 async-lru==2.0.4 attrs==23.2.0 babel==2.14.0 -beautifulsoup4==4.12.2 -black==23.12.1 +beautifulsoup4==4.12.3 +black==24.1.1 bleach==6.1.0 cachetools==5.3.2 cattrs==23.2.3 @@ -28,7 +28,7 @@ click==8.1.7 colorama==0.4.6 comm==0.2.1 contourpy==1.2.0 -coverage==7.4.0 +coverage==7.4.1 cycler==0.12.1 debugpy==1.8.0 decorator==5.1.1 @@ -54,7 +54,7 @@ idna==3.6 imagesize==1.4.1 importlib-metadata==7.0.1 iniconfig==2.0.0 -ipykernel==6.28.0 +ipykernel==6.29.0 ipympl==0.9.3 ipython==8.20.0 ipython-genutils==0.2.0 @@ -65,20 +65,20 @@ jedi==0.19.1 jinja2==3.1.3 json5==0.9.14 jsonpointer==2.4 -jsonschema==4.20.0 +jsonschema==4.21.1 jsonschema-specifications==2023.12.1 jupyter-cache==1.0.0 jupyter-client==8.6.0 jupyter-core==5.7.1 jupyter-events==0.9.0 -jupyter-lsp==2.2.1 -jupyter-server==2.12.4 +jupyter-lsp==2.2.2 +jupyter-server==2.12.5 jupyter-server-mathjax==0.2.6 -jupyter-server-terminals==0.5.1 -jupyterlab==4.0.10 +jupyter-server-terminals==0.5.2 +jupyterlab==4.0.11 jupyterlab-code-formatter==2.2.1 jupyterlab-git==0.50.0 -jupyterlab-lsp==5.0.1 +jupyterlab-lsp==5.0.2 jupyterlab-myst==2.1.0 jupyterlab-pygments==0.3.0 jupyterlab-server==2.25.2 @@ -86,9 +86,9 @@ jupyterlab-widgets==3.0.9 kiwisolver==1.4.5 latexcodec==2.0.1 livereload==2.6.3 -lsprotocol==2023.0.1 +lsprotocol==2024.0.0a1 markdown-it-py==3.0.0 -markupsafe==2.1.3 +markupsafe==2.1.4 matplotlib==3.8.2 matplotlib-inline==0.1.6 mdit-py-plugins==0.4.0 @@ -101,38 +101,38 @@ mypy-extensions==1.0.0 myst-nb==1.0.0 myst-parser==2.0.0 nbclient==0.6.8 -nbconvert==7.14.1 +nbconvert==7.14.2 nbdime==4.0.1 nbformat==5.9.2 nbmake==1.4.6 -nest-asyncio==1.5.8 +nest-asyncio==1.6.0 nodeenv==1.8.0 notebook-shim==0.2.3 numpy==1.26.3 -overrides==7.4.0 +overrides==7.7.0 packaging==23.2 -pandocfilters==1.5.0 +pandocfilters==1.5.1 parso==0.8.3 particle==0.23.1 pathspec==0.12.1 pexpect==4.9.0 pillow==10.2.0 platformdirs==4.1.0 -pluggy==1.3.0 +pluggy==1.4.0 pre-commit==3.6.0 prometheus-client==0.19.0 prompt-toolkit==3.0.43 -psutil==5.9.7 +psutil==5.9.8 ptyprocess==0.7.0 pure-eval==0.2.2 pybtex==0.24.0 pybtex-docutils==1.0.3 pycparser==2.21 -pydata-sphinx-theme==0.15.1 +pydata-sphinx-theme==0.15.2 pygments==2.17.2 pyparsing==3.1.1 pyproject-api==1.6.1 -pytest==7.4.4 +pytest==8.0.0 pytest-cov==4.1.0 pytest-profiling==1.7.0 pytest-xdist==3.5.0 @@ -141,19 +141,19 @@ python-dateutil==2.8.2 python-json-logger==2.0.7 python-lsp-jsonrpc==1.1.2 python-lsp-ruff==2.0.2 -python-lsp-server==1.9.0 +python-lsp-server==1.10.0 pytoolconfig==1.3.1 pyyaml==6.0.1 pyzmq==25.1.2 qrules==0.9.8 -referencing==0.32.1 +referencing==0.33.0 requests==2.31.0 rfc3339-validator==0.1.4 rfc3986-validator==0.1.1 rich==13.7.0 -rope==1.11.0 -rpds-py==0.16.2 -ruff==0.1.13 +rope==1.12.0 +rpds-py==0.17.1 +ruff==0.1.14 send2trash==1.8.2 six==1.16.0 smmap==5.0.1 @@ -172,13 +172,13 @@ sphinx-hep-pdgref==0.2.0 sphinx-pybtex-etal-style==0.0.2 sphinx-thebe==0.3.0 sphinx-togglebutton==0.3.2 -sphinxcontrib-applehelp==1.0.7 +sphinxcontrib-applehelp==1.0.8 sphinxcontrib-bibtex==2.6.2 -sphinxcontrib-devhelp==1.0.5 -sphinxcontrib-htmlhelp==2.0.4 +sphinxcontrib-devhelp==1.0.6 +sphinxcontrib-htmlhelp==2.0.5 sphinxcontrib-jsmath==1.0.1 -sphinxcontrib-qthelp==1.0.6 -sphinxcontrib-serializinghtml==1.1.9 +sphinxcontrib-qthelp==1.0.7 +sphinxcontrib-serializinghtml==1.1.10 sqlalchemy==2.0.25 stack-data==0.6.3 sympy==1.12 @@ -187,7 +187,7 @@ terminado==0.18.0 tinycss2==1.2.1 tomli==2.0.1 tornado==6.4 -tox==4.12.0 +tox==4.12.1 tqdm==4.66.1 traitlets==5.14.1 types-python-dateutil==2.8.19.20240106 diff --git a/.constraints/py3.11.txt b/.constraints/py3.11.txt index e8fe3e8d7..636d61129 100644 --- a/.constraints/py3.11.txt +++ b/.constraints/py3.11.txt @@ -14,8 +14,8 @@ asttokens==2.4.1 async-lru==2.0.4 attrs==23.2.0 babel==2.14.0 -beautifulsoup4==4.12.2 -black==23.12.1 +beautifulsoup4==4.12.3 +black==24.1.1 bleach==6.1.0 cachetools==5.3.2 cattrs==23.2.3 @@ -28,7 +28,7 @@ click==8.1.7 colorama==0.4.6 comm==0.2.1 contourpy==1.2.0 -coverage==7.4.0 +coverage==7.4.1 cycler==0.12.1 debugpy==1.8.0 decorator==5.1.1 @@ -53,7 +53,7 @@ idna==3.6 imagesize==1.4.1 importlib-metadata==7.0.1 iniconfig==2.0.0 -ipykernel==6.28.0 +ipykernel==6.29.0 ipympl==0.9.3 ipython==8.20.0 ipython-genutils==0.2.0 @@ -64,20 +64,20 @@ jedi==0.19.1 jinja2==3.1.3 json5==0.9.14 jsonpointer==2.4 -jsonschema==4.20.0 +jsonschema==4.21.1 jsonschema-specifications==2023.12.1 jupyter-cache==1.0.0 jupyter-client==8.6.0 jupyter-core==5.7.1 jupyter-events==0.9.0 -jupyter-lsp==2.2.1 -jupyter-server==2.12.4 +jupyter-lsp==2.2.2 +jupyter-server==2.12.5 jupyter-server-mathjax==0.2.6 -jupyter-server-terminals==0.5.1 -jupyterlab==4.0.10 +jupyter-server-terminals==0.5.2 +jupyterlab==4.0.11 jupyterlab-code-formatter==2.2.1 jupyterlab-git==0.50.0 -jupyterlab-lsp==5.0.1 +jupyterlab-lsp==5.0.2 jupyterlab-myst==2.1.0 jupyterlab-pygments==0.3.0 jupyterlab-server==2.25.2 @@ -85,9 +85,9 @@ jupyterlab-widgets==3.0.9 kiwisolver==1.4.5 latexcodec==2.0.1 livereload==2.6.3 -lsprotocol==2023.0.1 +lsprotocol==2024.0.0a1 markdown-it-py==3.0.0 -markupsafe==2.1.3 +markupsafe==2.1.4 matplotlib==3.8.2 matplotlib-inline==0.1.6 mdit-py-plugins==0.4.0 @@ -100,38 +100,38 @@ mypy-extensions==1.0.0 myst-nb==1.0.0 myst-parser==2.0.0 nbclient==0.6.8 -nbconvert==7.14.1 +nbconvert==7.14.2 nbdime==4.0.1 nbformat==5.9.2 nbmake==1.4.6 -nest-asyncio==1.5.8 +nest-asyncio==1.6.0 nodeenv==1.8.0 notebook-shim==0.2.3 numpy==1.26.3 -overrides==7.4.0 +overrides==7.7.0 packaging==23.2 -pandocfilters==1.5.0 +pandocfilters==1.5.1 parso==0.8.3 particle==0.23.1 pathspec==0.12.1 pexpect==4.9.0 pillow==10.2.0 platformdirs==4.1.0 -pluggy==1.3.0 +pluggy==1.4.0 pre-commit==3.6.0 prometheus-client==0.19.0 prompt-toolkit==3.0.43 -psutil==5.9.7 +psutil==5.9.8 ptyprocess==0.7.0 pure-eval==0.2.2 pybtex==0.24.0 pybtex-docutils==1.0.3 pycparser==2.21 -pydata-sphinx-theme==0.15.1 +pydata-sphinx-theme==0.15.2 pygments==2.17.2 pyparsing==3.1.1 pyproject-api==1.6.1 -pytest==7.4.4 +pytest==8.0.0 pytest-cov==4.1.0 pytest-profiling==1.7.0 pytest-xdist==3.5.0 @@ -140,19 +140,19 @@ python-dateutil==2.8.2 python-json-logger==2.0.7 python-lsp-jsonrpc==1.1.2 python-lsp-ruff==2.0.2 -python-lsp-server==1.9.0 +python-lsp-server==1.10.0 pytoolconfig==1.3.1 pyyaml==6.0.1 pyzmq==25.1.2 qrules==0.9.8 -referencing==0.32.1 +referencing==0.33.0 requests==2.31.0 rfc3339-validator==0.1.4 rfc3986-validator==0.1.1 rich==13.7.0 -rope==1.11.0 -rpds-py==0.16.2 -ruff==0.1.13 +rope==1.12.0 +rpds-py==0.17.1 +ruff==0.1.14 send2trash==1.8.2 six==1.16.0 smmap==5.0.1 @@ -171,13 +171,13 @@ sphinx-hep-pdgref==0.2.0 sphinx-pybtex-etal-style==0.0.2 sphinx-thebe==0.3.0 sphinx-togglebutton==0.3.2 -sphinxcontrib-applehelp==1.0.7 +sphinxcontrib-applehelp==1.0.8 sphinxcontrib-bibtex==2.6.2 -sphinxcontrib-devhelp==1.0.5 -sphinxcontrib-htmlhelp==2.0.4 +sphinxcontrib-devhelp==1.0.6 +sphinxcontrib-htmlhelp==2.0.5 sphinxcontrib-jsmath==1.0.1 -sphinxcontrib-qthelp==1.0.6 -sphinxcontrib-serializinghtml==1.1.9 +sphinxcontrib-qthelp==1.0.7 +sphinxcontrib-serializinghtml==1.1.10 sqlalchemy==2.0.25 stack-data==0.6.3 sympy==1.12 @@ -185,7 +185,7 @@ tabulate==0.9.0 terminado==0.18.0 tinycss2==1.2.1 tornado==6.4 -tox==4.12.0 +tox==4.12.1 tqdm==4.66.1 traitlets==5.14.1 types-python-dateutil==2.8.19.20240106 diff --git a/.constraints/py3.12.txt b/.constraints/py3.12.txt index 7ac61d2a7..bf1f52c26 100644 --- a/.constraints/py3.12.txt +++ b/.constraints/py3.12.txt @@ -14,8 +14,8 @@ asttokens==2.4.1 async-lru==2.0.4 attrs==23.2.0 babel==2.14.0 -beautifulsoup4==4.12.2 -black==23.12.1 +beautifulsoup4==4.12.3 +black==24.1.1 bleach==6.1.0 cachetools==5.3.2 cattrs==23.2.3 @@ -28,7 +28,7 @@ click==8.1.7 colorama==0.4.6 comm==0.2.1 contourpy==1.2.0 -coverage==7.4.0 +coverage==7.4.1 cycler==0.12.1 debugpy==1.8.0 decorator==5.1.1 @@ -53,7 +53,7 @@ idna==3.6 imagesize==1.4.1 importlib-metadata==7.0.1 iniconfig==2.0.0 -ipykernel==6.28.0 +ipykernel==6.29.0 ipympl==0.9.3 ipython==8.20.0 ipython-genutils==0.2.0 @@ -64,20 +64,20 @@ jedi==0.19.1 jinja2==3.1.3 json5==0.9.14 jsonpointer==2.4 -jsonschema==4.20.0 +jsonschema==4.21.1 jsonschema-specifications==2023.12.1 jupyter-cache==1.0.0 jupyter-client==8.6.0 jupyter-core==5.7.1 jupyter-events==0.9.0 -jupyter-lsp==2.2.1 -jupyter-server==2.12.4 +jupyter-lsp==2.2.2 +jupyter-server==2.12.5 jupyter-server-mathjax==0.2.6 -jupyter-server-terminals==0.5.1 -jupyterlab==4.0.10 +jupyter-server-terminals==0.5.2 +jupyterlab==4.0.11 jupyterlab-code-formatter==2.2.1 jupyterlab-git==0.50.0 -jupyterlab-lsp==5.0.1 +jupyterlab-lsp==5.0.2 jupyterlab-myst==2.1.0 jupyterlab-pygments==0.3.0 jupyterlab-server==2.25.2 @@ -85,9 +85,9 @@ jupyterlab-widgets==3.0.9 kiwisolver==1.4.5 latexcodec==2.0.1 livereload==2.6.3 -lsprotocol==2023.0.1 +lsprotocol==2024.0.0a1 markdown-it-py==3.0.0 -markupsafe==2.1.3 +markupsafe==2.1.4 matplotlib==3.8.2 matplotlib-inline==0.1.6 mdit-py-plugins==0.4.0 @@ -100,38 +100,38 @@ mypy-extensions==1.0.0 myst-nb==1.0.0 myst-parser==2.0.0 nbclient==0.6.8 -nbconvert==7.14.1 +nbconvert==7.14.2 nbdime==4.0.1 nbformat==5.9.2 nbmake==1.4.6 -nest-asyncio==1.5.8 +nest-asyncio==1.6.0 nodeenv==1.8.0 notebook-shim==0.2.3 numpy==1.26.3 -overrides==7.4.0 +overrides==7.7.0 packaging==23.2 -pandocfilters==1.5.0 +pandocfilters==1.5.1 parso==0.8.3 particle==0.23.1 pathspec==0.12.1 pexpect==4.9.0 pillow==10.2.0 platformdirs==4.1.0 -pluggy==1.3.0 +pluggy==1.4.0 pre-commit==3.6.0 prometheus-client==0.19.0 prompt-toolkit==3.0.43 -psutil==5.9.7 +psutil==5.9.8 ptyprocess==0.7.0 pure-eval==0.2.2 pybtex==0.24.0 pybtex-docutils==1.0.3 pycparser==2.21 -pydata-sphinx-theme==0.15.1 +pydata-sphinx-theme==0.15.2 pygments==2.17.2 pyparsing==3.1.1 pyproject-api==1.6.1 -pytest==7.4.4 +pytest==8.0.0 pytest-cov==4.1.0 pytest-profiling==1.7.0 pytest-xdist==3.5.0 @@ -140,19 +140,19 @@ python-dateutil==2.8.2 python-json-logger==2.0.7 python-lsp-jsonrpc==1.1.2 python-lsp-ruff==2.0.2 -python-lsp-server==1.9.0 +python-lsp-server==1.10.0 pytoolconfig==1.3.1 pyyaml==6.0.1 pyzmq==25.1.2 qrules==0.9.8 -referencing==0.32.1 +referencing==0.33.0 requests==2.31.0 rfc3339-validator==0.1.4 rfc3986-validator==0.1.1 rich==13.7.0 -rope==1.11.0 -rpds-py==0.16.2 -ruff==0.1.13 +rope==1.12.0 +rpds-py==0.17.1 +ruff==0.1.14 send2trash==1.8.2 six==1.16.0 smmap==5.0.1 @@ -171,13 +171,13 @@ sphinx-hep-pdgref==0.2.0 sphinx-pybtex-etal-style==0.0.2 sphinx-thebe==0.3.0 sphinx-togglebutton==0.3.2 -sphinxcontrib-applehelp==1.0.7 +sphinxcontrib-applehelp==1.0.8 sphinxcontrib-bibtex==2.6.2 -sphinxcontrib-devhelp==1.0.5 -sphinxcontrib-htmlhelp==2.0.4 +sphinxcontrib-devhelp==1.0.6 +sphinxcontrib-htmlhelp==2.0.5 sphinxcontrib-jsmath==1.0.1 -sphinxcontrib-qthelp==1.0.6 -sphinxcontrib-serializinghtml==1.1.9 +sphinxcontrib-qthelp==1.0.7 +sphinxcontrib-serializinghtml==1.1.10 sqlalchemy==2.0.25 stack-data==0.6.3 sympy==1.12 @@ -185,7 +185,7 @@ tabulate==0.9.0 terminado==0.18.0 tinycss2==1.2.1 tornado==6.4 -tox==4.12.0 +tox==4.12.1 tqdm==4.66.1 traitlets==5.14.1 types-python-dateutil==2.8.19.20240106 diff --git a/.constraints/py3.7.txt b/.constraints/py3.7.txt index 7251602db..320bd4910 100644 --- a/.constraints/py3.7.txt +++ b/.constraints/py3.7.txt @@ -15,7 +15,7 @@ arrow==1.2.3 attrs==23.2.0 babel==2.14.0 backcall==0.2.0 -beautifulsoup4==4.12.2 +beautifulsoup4==4.12.3 black==23.3.0 bleach==6.0.0 cached-property==1.5.2 @@ -78,7 +78,7 @@ jupyter-server-fileid==0.9.1 jupyter-server-mathjax==0.2.6 jupyter-server-ydoc==0.8.0 jupyter-ydoc==0.2.5 -jupyterlab==3.6.6 +jupyterlab==3.6.7 jupyterlab-code-formatter==2.2.1 jupyterlab-git==0.44.0 jupyterlab-lsp==3.10.2 @@ -91,7 +91,7 @@ latexcodec==2.0.1 livereload==2.6.3 lsprotocol==2023.0.1 markdown-it-py==2.2.0 -markupsafe==2.1.3 +markupsafe==2.1.4 matplotlib==3.5.3 matplotlib-inline==0.1.6 mdit-py-plugins==0.3.5 @@ -109,13 +109,13 @@ nbconvert==7.6.0 nbdime==3.2.1 nbformat==5.8.0 nbmake==1.3.0 -nest-asyncio==1.5.8 +nest-asyncio==1.6.0 nodeenv==1.8.0 notebook==6.5.6 notebook-shim==0.2.3 numpy==1.21.6 packaging==23.2 -pandocfilters==1.5.0 +pandocfilters==1.5.1 parso==0.8.3 particle==0.23.1 pathspec==0.11.2 @@ -128,12 +128,12 @@ pluggy==1.2.0 pre-commit==2.21.0 prometheus-client==0.17.1 prompt-toolkit==3.0.43 -psutil==5.9.7 +psutil==5.9.8 ptyprocess==0.7.0 pybtex==0.24.0 pybtex-docutils==1.0.3 pycparser==2.21 -pydantic==1.10.13 +pydantic==1.10.14 pydata-sphinx-theme==0.13.3 pygments==2.17.2 pyparsing==3.1.1 @@ -150,7 +150,7 @@ python-lsp-jsonrpc==1.0.0 python-lsp-ruff==1.6.0 python-lsp-server==1.7.4 pytoolconfig==1.3.0 -pytz==2023.3.post1 +pytz==2023.4 pyyaml==6.0.1 pyzmq==24.0.1 qrules==0.9.8 @@ -159,7 +159,7 @@ rfc3339-validator==0.1.4 rfc3986-validator==0.1.1 rich==13.7.0 rope==1.9.0 -ruff==0.1.13 +ruff==0.1.14 send2trash==1.8.2 singledispatchmethod==1.0 ; python_version < "3.8.0" six==1.16.0 diff --git a/.constraints/py3.8.txt b/.constraints/py3.8.txt index 92520a9f4..ddccad691 100644 --- a/.constraints/py3.8.txt +++ b/.constraints/py3.8.txt @@ -15,8 +15,8 @@ async-lru==2.0.4 attrs==23.2.0 babel==2.14.0 backcall==0.2.0 -beautifulsoup4==4.12.2 -black==23.12.1 +beautifulsoup4==4.12.3 +black==24.1.1 bleach==6.1.0 cachetools==5.3.2 cattrs==23.2.3 @@ -29,7 +29,7 @@ click==8.1.7 colorama==0.4.6 comm==0.2.1 contourpy==1.1.1 -coverage==7.4.0 +coverage==7.4.1 cycler==0.12.1 debugpy==1.8.0 decorator==5.1.1 @@ -56,7 +56,7 @@ imagesize==1.4.1 importlib-metadata==7.0.1 importlib-resources==6.1.1 iniconfig==2.0.0 -ipykernel==6.28.0 +ipykernel==6.29.0 ipympl==0.9.3 ipython==8.12.3 ipython-genutils==0.2.0 @@ -67,20 +67,20 @@ jedi==0.19.1 jinja2==3.1.3 json5==0.9.14 jsonpointer==2.4 -jsonschema==4.20.0 +jsonschema==4.21.1 jsonschema-specifications==2023.12.1 jupyter-cache==0.6.1 jupyter-client==8.6.0 jupyter-core==5.7.1 jupyter-events==0.9.0 -jupyter-lsp==2.2.1 -jupyter-server==2.12.4 +jupyter-lsp==2.2.2 +jupyter-server==2.12.5 jupyter-server-mathjax==0.2.6 -jupyter-server-terminals==0.5.1 -jupyterlab==4.0.10 +jupyter-server-terminals==0.5.2 +jupyterlab==4.0.11 jupyterlab-code-formatter==2.2.1 jupyterlab-git==0.50.0 -jupyterlab-lsp==5.0.1 +jupyterlab-lsp==5.0.2 jupyterlab-myst==2.1.0 jupyterlab-pygments==0.3.0 jupyterlab-server==2.25.2 @@ -88,9 +88,9 @@ jupyterlab-widgets==3.0.9 kiwisolver==1.4.5 latexcodec==2.0.1 livereload==2.6.3 -lsprotocol==2023.0.1 +lsprotocol==2024.0.0a1 markdown-it-py==2.2.0 -markupsafe==2.1.3 +markupsafe==2.1.4 matplotlib==3.7.4 matplotlib-inline==0.1.6 mdit-py-plugins==0.3.5 @@ -103,17 +103,17 @@ mypy-extensions==1.0.0 myst-nb==0.17.2 myst-parser==0.18.1 nbclient==0.6.8 -nbconvert==7.14.1 +nbconvert==7.14.2 nbdime==4.0.1 nbformat==5.9.2 nbmake==1.4.6 -nest-asyncio==1.5.8 +nest-asyncio==1.6.0 nodeenv==1.8.0 notebook-shim==0.2.3 numpy==1.24.4 -overrides==7.4.0 +overrides==7.7.0 packaging==23.2 -pandocfilters==1.5.0 +pandocfilters==1.5.1 parso==0.8.3 particle==0.23.1 pathspec==0.12.1 @@ -122,11 +122,11 @@ pickleshare==0.7.5 pillow==10.2.0 pkgutil-resolve-name==1.3.10 platformdirs==4.1.0 -pluggy==1.3.0 +pluggy==1.4.0 pre-commit==3.5.0 prometheus-client==0.19.0 prompt-toolkit==3.0.43 -psutil==5.9.7 +psutil==5.9.8 ptyprocess==0.7.0 pure-eval==0.2.2 pybtex==0.24.0 @@ -136,7 +136,7 @@ pydata-sphinx-theme==0.14.4 pygments==2.17.2 pyparsing==3.1.1 pyproject-api==1.6.1 -pytest==7.4.4 +pytest==8.0.0 pytest-cov==4.1.0 pytest-profiling==1.7.0 pytest-xdist==3.5.0 @@ -145,20 +145,20 @@ python-dateutil==2.8.2 python-json-logger==2.0.7 python-lsp-jsonrpc==1.1.2 python-lsp-ruff==2.0.2 -python-lsp-server==1.9.0 +python-lsp-server==1.10.0 pytoolconfig==1.3.1 -pytz==2023.3.post1 +pytz==2023.4 pyyaml==6.0.1 pyzmq==25.1.2 qrules==0.9.8 -referencing==0.32.1 +referencing==0.33.0 requests==2.31.0 rfc3339-validator==0.1.4 rfc3986-validator==0.1.1 rich==13.7.0 -rope==1.11.0 -rpds-py==0.16.2 -ruff==0.1.13 +rope==1.12.0 +rpds-py==0.17.1 +ruff==0.1.14 send2trash==1.8.2 six==1.16.0 smmap==5.0.1 @@ -192,7 +192,7 @@ terminado==0.18.0 tinycss2==1.2.1 tomli==2.0.1 tornado==6.4 -tox==4.12.0 +tox==4.12.1 tqdm==4.66.1 traitlets==5.14.1 types-python-dateutil==2.8.19.20240106 diff --git a/.constraints/py3.9.txt b/.constraints/py3.9.txt index a1109267a..6aa03b27b 100644 --- a/.constraints/py3.9.txt +++ b/.constraints/py3.9.txt @@ -14,8 +14,8 @@ asttokens==2.4.1 async-lru==2.0.4 attrs==23.2.0 babel==2.14.0 -beautifulsoup4==4.12.2 -black==23.12.1 +beautifulsoup4==4.12.3 +black==24.1.1 bleach==6.1.0 cachetools==5.3.2 cattrs==23.2.3 @@ -28,7 +28,7 @@ click==8.1.7 colorama==0.4.6 comm==0.2.1 contourpy==1.2.0 -coverage==7.4.0 +coverage==7.4.1 cycler==0.12.1 debugpy==1.8.0 decorator==5.1.1 @@ -55,7 +55,7 @@ imagesize==1.4.1 importlib-metadata==7.0.1 importlib-resources==6.1.1 iniconfig==2.0.0 -ipykernel==6.28.0 +ipykernel==6.29.0 ipympl==0.9.3 ipython==8.18.1 ipython-genutils==0.2.0 @@ -66,20 +66,20 @@ jedi==0.19.1 jinja2==3.1.3 json5==0.9.14 jsonpointer==2.4 -jsonschema==4.20.0 +jsonschema==4.21.1 jsonschema-specifications==2023.12.1 jupyter-cache==1.0.0 jupyter-client==8.6.0 jupyter-core==5.7.1 jupyter-events==0.9.0 -jupyter-lsp==2.2.1 -jupyter-server==2.12.4 +jupyter-lsp==2.2.2 +jupyter-server==2.12.5 jupyter-server-mathjax==0.2.6 -jupyter-server-terminals==0.5.1 -jupyterlab==4.0.10 +jupyter-server-terminals==0.5.2 +jupyterlab==4.0.11 jupyterlab-code-formatter==2.2.1 jupyterlab-git==0.50.0 -jupyterlab-lsp==5.0.1 +jupyterlab-lsp==5.0.2 jupyterlab-myst==2.1.0 jupyterlab-pygments==0.3.0 jupyterlab-server==2.25.2 @@ -87,9 +87,9 @@ jupyterlab-widgets==3.0.9 kiwisolver==1.4.5 latexcodec==2.0.1 livereload==2.6.3 -lsprotocol==2023.0.1 +lsprotocol==2024.0.0a1 markdown-it-py==3.0.0 -markupsafe==2.1.3 +markupsafe==2.1.4 matplotlib==3.8.2 matplotlib-inline==0.1.6 mdit-py-plugins==0.4.0 @@ -102,38 +102,38 @@ mypy-extensions==1.0.0 myst-nb==1.0.0 myst-parser==2.0.0 nbclient==0.6.8 -nbconvert==7.14.1 +nbconvert==7.14.2 nbdime==4.0.1 nbformat==5.9.2 nbmake==1.4.6 -nest-asyncio==1.5.8 +nest-asyncio==1.6.0 nodeenv==1.8.0 notebook-shim==0.2.3 numpy==1.26.3 -overrides==7.4.0 +overrides==7.7.0 packaging==23.2 -pandocfilters==1.5.0 +pandocfilters==1.5.1 parso==0.8.3 particle==0.23.1 pathspec==0.12.1 pexpect==4.9.0 pillow==10.2.0 platformdirs==4.1.0 -pluggy==1.3.0 +pluggy==1.4.0 pre-commit==3.6.0 prometheus-client==0.19.0 prompt-toolkit==3.0.43 -psutil==5.9.7 +psutil==5.9.8 ptyprocess==0.7.0 pure-eval==0.2.2 pybtex==0.24.0 pybtex-docutils==1.0.3 pycparser==2.21 -pydata-sphinx-theme==0.15.1 +pydata-sphinx-theme==0.15.2 pygments==2.17.2 pyparsing==3.1.1 pyproject-api==1.6.1 -pytest==7.4.4 +pytest==8.0.0 pytest-cov==4.1.0 pytest-profiling==1.7.0 pytest-xdist==3.5.0 @@ -142,19 +142,19 @@ python-dateutil==2.8.2 python-json-logger==2.0.7 python-lsp-jsonrpc==1.1.2 python-lsp-ruff==2.0.2 -python-lsp-server==1.9.0 +python-lsp-server==1.10.0 pytoolconfig==1.3.1 pyyaml==6.0.1 pyzmq==25.1.2 qrules==0.9.8 -referencing==0.32.1 +referencing==0.33.0 requests==2.31.0 rfc3339-validator==0.1.4 rfc3986-validator==0.1.1 rich==13.7.0 -rope==1.11.0 -rpds-py==0.16.2 -ruff==0.1.13 +rope==1.12.0 +rpds-py==0.17.1 +ruff==0.1.14 send2trash==1.8.2 six==1.16.0 smmap==5.0.1 @@ -173,13 +173,13 @@ sphinx-hep-pdgref==0.2.0 sphinx-pybtex-etal-style==0.0.2 sphinx-thebe==0.3.0 sphinx-togglebutton==0.3.2 -sphinxcontrib-applehelp==1.0.7 +sphinxcontrib-applehelp==1.0.8 sphinxcontrib-bibtex==2.6.2 -sphinxcontrib-devhelp==1.0.5 -sphinxcontrib-htmlhelp==2.0.4 +sphinxcontrib-devhelp==1.0.6 +sphinxcontrib-htmlhelp==2.0.5 sphinxcontrib-jsmath==1.0.1 -sphinxcontrib-qthelp==1.0.6 -sphinxcontrib-serializinghtml==1.1.9 +sphinxcontrib-qthelp==1.0.7 +sphinxcontrib-serializinghtml==1.1.10 sqlalchemy==2.0.25 stack-data==0.6.3 sympy==1.12 @@ -188,7 +188,7 @@ terminado==0.18.0 tinycss2==1.2.1 tomli==2.0.1 tornado==6.4 -tox==4.12.0 +tox==4.12.1 tqdm==4.66.1 traitlets==5.14.1 types-python-dateutil==2.8.19.20240106 From d1cda7eeafd9cfccb2eb2c349d0ee8fde36ea38b Mon Sep 17 00:00:00 2001 From: Remco de Boer <29308176+redeboer@users.noreply.github.com> Date: Mon, 29 Jan 2024 18:17:53 +0100 Subject: [PATCH 2/8] BREAK: remove QRules version restriction --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index df518f736..7dc53f850 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,7 +28,7 @@ classifiers = [ ] dependencies = [ "attrs >=20.1.0", # on_setattr and https://www.attrs.org/en/stable/api.html#next-gen - "qrules ==0.9.*, >=0.9.6", # https://github.com/ComPWA/qrules/pull/145 + "qrules >=0.9.6", "sympy >=1.10", 'singledispatchmethod; python_version <"3.8.0"', 'typing-extensions; python_version <"3.8.0"', From 54329c28d2ccf4f9ccd2d8ab34e1086f24acbfb2 Mon Sep 17 00:00:00 2001 From: Remco de Boer <29308176+redeboer@users.noreply.github.com> Date: Mon, 29 Jan 2024 18:35:31 +0100 Subject: [PATCH 3/8] MAINT: autoupdate to qrules v0.10.0 --- .constraints/py3.10.txt | 2 +- .constraints/py3.11.txt | 2 +- .constraints/py3.12.txt | 2 +- .constraints/py3.7.txt | 2 +- .constraints/py3.8.txt | 2 +- .constraints/py3.9.txt | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.constraints/py3.10.txt b/.constraints/py3.10.txt index 6bf15e098..20d35a69c 100644 --- a/.constraints/py3.10.txt +++ b/.constraints/py3.10.txt @@ -145,7 +145,7 @@ python-lsp-server==1.10.0 pytoolconfig==1.3.1 pyyaml==6.0.1 pyzmq==25.1.2 -qrules==0.9.8 +qrules==0.10.0 referencing==0.33.0 requests==2.31.0 rfc3339-validator==0.1.4 diff --git a/.constraints/py3.11.txt b/.constraints/py3.11.txt index 636d61129..2f717a631 100644 --- a/.constraints/py3.11.txt +++ b/.constraints/py3.11.txt @@ -144,7 +144,7 @@ python-lsp-server==1.10.0 pytoolconfig==1.3.1 pyyaml==6.0.1 pyzmq==25.1.2 -qrules==0.9.8 +qrules==0.10.0 referencing==0.33.0 requests==2.31.0 rfc3339-validator==0.1.4 diff --git a/.constraints/py3.12.txt b/.constraints/py3.12.txt index bf1f52c26..73a42b247 100644 --- a/.constraints/py3.12.txt +++ b/.constraints/py3.12.txt @@ -144,7 +144,7 @@ python-lsp-server==1.10.0 pytoolconfig==1.3.1 pyyaml==6.0.1 pyzmq==25.1.2 -qrules==0.9.8 +qrules==0.10.0 referencing==0.33.0 requests==2.31.0 rfc3339-validator==0.1.4 diff --git a/.constraints/py3.7.txt b/.constraints/py3.7.txt index 320bd4910..b3a7ce7dc 100644 --- a/.constraints/py3.7.txt +++ b/.constraints/py3.7.txt @@ -153,7 +153,7 @@ pytoolconfig==1.3.0 pytz==2023.4 pyyaml==6.0.1 pyzmq==24.0.1 -qrules==0.9.8 +qrules==0.10.0 requests==2.31.0 rfc3339-validator==0.1.4 rfc3986-validator==0.1.1 diff --git a/.constraints/py3.8.txt b/.constraints/py3.8.txt index ddccad691..ed8b20bd1 100644 --- a/.constraints/py3.8.txt +++ b/.constraints/py3.8.txt @@ -150,7 +150,7 @@ pytoolconfig==1.3.1 pytz==2023.4 pyyaml==6.0.1 pyzmq==25.1.2 -qrules==0.9.8 +qrules==0.10.0 referencing==0.33.0 requests==2.31.0 rfc3339-validator==0.1.4 diff --git a/.constraints/py3.9.txt b/.constraints/py3.9.txt index 6aa03b27b..8e54e822b 100644 --- a/.constraints/py3.9.txt +++ b/.constraints/py3.9.txt @@ -146,7 +146,7 @@ python-lsp-server==1.10.0 pytoolconfig==1.3.1 pyyaml==6.0.1 pyzmq==25.1.2 -qrules==0.9.8 +qrules==0.10.0 referencing==0.33.0 requests==2.31.0 rfc3339-validator==0.1.4 From 7a5b37ab3ad754aee05406afe2dccdbc0ee9619c Mon Sep 17 00:00:00 2001 From: Remco de Boer <29308176+redeboer@users.noreply.github.com> Date: Fri, 13 Oct 2023 15:20:12 +0200 Subject: [PATCH 4/8] DX: run AmpForm tests with QRules v0.9.x --- .github/workflows/ci-qrules-v0.9.yml | 36 ++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/ci-qrules-v0.9.yml diff --git a/.github/workflows/ci-qrules-v0.9.yml b/.github/workflows/ci-qrules-v0.9.yml new file mode 100644 index 000000000..b416eba2b --- /dev/null +++ b/.github/workflows/ci-qrules-v0.9.yml @@ -0,0 +1,36 @@ +name: Test with QRules v0.9 + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +env: + PYTHONHASHSEED: "0" + +on: + push: + branches: + - main + - epic/* + - "[0-9]+.[0-9]+.x" + pull_request: + branches: + - main + - epic/* + - "[0-9]+.[0-9]+.x" + workflow_dispatch: + +jobs: + pytest: + name: Run unit tests + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + - uses: ComPWA/actions/pip-install@v1 + with: + additional-packages: tox + editable: "yes" + extras: test + python-version: "3.9" + specific-packages: qrules==0.9.* + - run: pytest -n auto From 822eafc092e9764de26fb98c35b08798b6d07fcc Mon Sep 17 00:00:00 2001 From: Remco de Boer <29308176+redeboer@users.noreply.github.com> Date: Fri, 13 Oct 2023 15:01:02 +0200 Subject: [PATCH 5/8] FEAT: add `get_qrules_version()` function --- pyproject.toml | 1 + src/ampform/_qrules.py | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 src/ampform/_qrules.py diff --git a/pyproject.toml b/pyproject.toml index 7dc53f850..882c02fff 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -30,6 +30,7 @@ dependencies = [ "attrs >=20.1.0", # on_setattr and https://www.attrs.org/en/stable/api.html#next-gen "qrules >=0.9.6", "sympy >=1.10", + 'importlib-metadata; python_version <"3.8.0"', 'singledispatchmethod; python_version <"3.8.0"', 'typing-extensions; python_version <"3.8.0"', ] diff --git a/src/ampform/_qrules.py b/src/ampform/_qrules.py new file mode 100644 index 000000000..45d7ded53 --- /dev/null +++ b/src/ampform/_qrules.py @@ -0,0 +1,25 @@ +from __future__ import annotations + +import sys +from functools import lru_cache + +if sys.version_info < (3, 8): + from importlib_metadata import version +else: + from importlib.metadata import version + + +@lru_cache(maxsize=1) +def get_qrules_version() -> tuple[int, ...]: + """Get the version of qrules as a tuple of integers. + + >>> get_qrules_version() >= (0, 10) + True + >>> import pytest + >>> from ampform._qrules import get_qrules_version + >>> if get_qrules_version() < (0, 10): + ... pytest.skip('Doctest only works for qrules>=0.10') + ... + """ + v = version("qrules") + return tuple(int(i) for i in v.split(".") if i.strip().isdigit()) From 012b1c1612be3999d42305358014b132fae10c6f Mon Sep 17 00:00:00 2001 From: Remco de Boer <29308176+redeboer@users.noreply.github.com> Date: Fri, 13 Oct 2023 15:40:17 +0200 Subject: [PATCH 6/8] ENH: adapt implementation to QRules v0.10 --- pyproject.toml | 1 + src/ampform/helicity/__init__.py | 33 +++++++++++++++--- src/ampform/helicity/align/dpd.py | 54 ++++++++++++++++++++++-------- src/ampform/helicity/decay.py | 48 ++++++++++++++++++++++---- src/ampform/helicity/naming.py | 5 +-- src/ampform/kinematics/__init__.py | 12 +++++-- src/ampform/kinematics/lorentz.py | 4 ++- tests/helicity/test_decay.py | 5 +-- tests/kinematics/conftest.py | 3 +- 9 files changed, 132 insertions(+), 33 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 882c02fff..5e284a949 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -220,6 +220,7 @@ reportPrivateImportUsage = false reportPrivateUsage = false reportUnboundVariable = false reportUnknownArgumentType = false +reportUnknownLambdaType = false reportUnknownMemberType = false reportUnknownParameterType = false reportUnknownVariableType = false diff --git a/src/ampform/helicity/__init__.py b/src/ampform/helicity/__init__.py index 57fc4e2c3..233013589 100644 --- a/src/ampform/helicity/__init__.py +++ b/src/ampform/helicity/__init__.py @@ -31,8 +31,14 @@ from attrs.validators import deep_iterable, instance_of, optional from qrules.combinatorics import perform_external_edge_identical_particle_combinatorics from qrules.particle import Particle -from qrules.transition import ReactionInfo, StateTransition +from qrules.transition import ( + InteractionProperties, + ReactionInfo, + State, + StateTransition, +) +from ampform._qrules import get_qrules_version from ampform.dynamics.builder import ( ResonanceDynamicsBuilder, TwoBodyKinematicVariableSet, @@ -71,6 +77,7 @@ if TYPE_CHECKING: from IPython.lib.pretty import PrettyPrinter + from qrules.topology import MutableTransition _LOGGER = logging.getLogger(__name__) @@ -449,11 +456,9 @@ def __formulate_topology_amplitude( ) -> sp.Expr: sequential_expressions: list[sp.Expr] = [] for transition in transitions: - sequential_graphs = perform_external_edge_identical_particle_combinatorics( - transition.to_graph() - ) + sequential_graphs = _perform_combinatorics(transition) for graph in sequential_graphs: - first_transition = StateTransition.from_graph(graph) + first_transition = _freeze(graph) expression = self.__formulate_sequential_decay(first_transition) sequential_expressions.append(expression) @@ -557,6 +562,24 @@ def __generate_amplitude_prefactor( return None +def _perform_combinatorics( + transition: StateTransition, +) -> list[MutableTransition[State, InteractionProperties]]: + if get_qrules_version() < (0, 10): + return perform_external_edge_identical_particle_combinatorics( + transition.to_graph() # type: ignore[attr-defined] + ) + graph = transition.convert(lambda s: (s.particle, s.spin_projection)).unfreeze() + combinations = perform_external_edge_identical_particle_combinatorics(graph) + return [g.freeze().convert(lambda s: State(*s)).unfreeze() for g in combinations] + + +def _freeze(graph: MutableTransition[State, InteractionProperties]) -> StateTransition: + if get_qrules_version() < (0, 10): + return StateTransition.from_graph(graph) # type: ignore[attr-defined] + return graph.freeze() + + class CanonicalAmplitudeBuilder(HelicityAmplitudeBuilder): r"""Amplitude model generator for the canonical helicity formalism. diff --git a/src/ampform/helicity/align/dpd.py b/src/ampform/helicity/align/dpd.py index 2d564eaaa..da1732538 100644 --- a/src/ampform/helicity/align/dpd.py +++ b/src/ampform/helicity/align/dpd.py @@ -14,9 +14,10 @@ from attrs import define, field from attrs.validators import in_ from qrules.topology import Topology -from qrules.transition import ReactionInfo, StateTransition, StateTransitionCollection +from qrules.transition import ReactionInfo, StateTransition from sympy.physics.quantum.spin import Rotation as Wigner +from ampform._qrules import get_qrules_version from ampform.helicity.align import SpinAlignment from ampform.helicity.decay import ( get_outer_state_ids, @@ -35,6 +36,11 @@ if TYPE_CHECKING: from sympy.physics.quantum.spin import WignerD +if get_qrules_version() < (0, 10): + from qrules.transition import ( # type: ignore[attr-defined] + StateTransitionCollection, + ) + @define class DalitzPlotDecomposition(SpinAlignment): @@ -110,8 +116,14 @@ def __call__( return Wigner.d(j, m, m_prime, zeta) -T = TypeVar("T", ReactionInfo, StateTransition, StateTransitionCollection, Topology) -"""Allowed types for :func:`relabel_edge_ids`.""" +if get_qrules_version() < (0, 10): + T = TypeVar("T", ReactionInfo, StateTransition, StateTransitionCollection, Topology) + """Allowed types for :func:`relabel_edge_ids`.""" +else: + T = TypeVar( # type: ignore[misc] # pyright: ignore[reportConstantRedefinition] + "T", ReactionInfo, StateTransition, Topology + ) + """Allowed types for :func:`relabel_edge_ids`.""" @singledispatch @@ -122,23 +134,29 @@ def relabel_edge_ids(obj: T) -> T: @relabel_edge_ids.register(ReactionInfo) def _(obj: ReactionInfo) -> ReactionInfo: # type: ignore[misc] - return ReactionInfo( # no attrs.evolve() in order to call __attrs_post_init__() - transition_groups=[relabel_edge_ids(g) for g in obj.transition_groups], + if get_qrules_version() < (0, 10): + return ReactionInfo( # type: ignore[call-arg] + transition_groups=[relabel_edge_ids(g) for g in obj.transition_groups], # type: ignore[attr-defined] + formalism=obj.formalism, + ) + return ReactionInfo( + # no attrs.evolve() in order to call __attrs_post_init__() + transitions=[relabel_edge_ids(g) for g in obj.transitions], formalism=obj.formalism, ) -@relabel_edge_ids.register(StateTransitionCollection) -def _(obj: StateTransitionCollection) -> StateTransitionCollection: # type: ignore[misc] - return StateTransitionCollection( - [ # no attrs.evolve() for __attrs_post_init__() - relabel_edge_ids(transition) for transition in obj.transitions - ] - ) +if get_qrules_version() < (0, 10): + def __relabel_stc(obj: StateTransitionCollection) -> StateTransitionCollection: # type: ignore[misc] + return StateTransitionCollection( + [relabel_edge_ids(transition) for transition in obj.transitions] + ) + + relabel_edge_ids.register(StateTransitionCollection)(__relabel_stc) -@relabel_edge_ids.register(StateTransition) -def _(obj: StateTransition) -> StateTransition: # type: ignore[misc] + +def __relabel_st(obj: StateTransition) -> StateTransition: # type: ignore[misc] mapping = __get_default_relabel_mapping() return attrs.evolve( obj, @@ -147,6 +165,14 @@ def _(obj: StateTransition) -> StateTransition: # type: ignore[misc] ) +if get_qrules_version() < (0, 10): + relabel_edge_ids.register(StateTransition)(__relabel_st) +else: + from qrules.topology import FrozenTransition + + relabel_edge_ids.register(FrozenTransition)(__relabel_st) + + @relabel_edge_ids.register(Topology) def _(obj: Topology) -> Topology: # type: ignore[misc] mapping = __get_default_relabel_mapping() diff --git a/src/ampform/helicity/decay.py b/src/ampform/helicity/decay.py index b5923d696..39fcb7721 100644 --- a/src/ampform/helicity/decay.py +++ b/src/ampform/helicity/decay.py @@ -8,16 +8,22 @@ from typing import TYPE_CHECKING, Iterable from attrs import frozen +from qrules.quantum_numbers import InteractionProperties from qrules.transition import ReactionInfo, State, StateTransition +from ampform._qrules import get_qrules_version + if TYPE_CHECKING: - from qrules.quantum_numbers import InteractionProperties from qrules.topology import Topology if sys.version_info < (3, 8): from typing_extensions import Literal else: from typing import Literal +if sys.version_info < (3, 10): + from typing_extensions import TypeGuard +else: + from typing import TypeGuard @frozen @@ -104,12 +110,30 @@ def _(obj: TwoBodyDecay) -> TwoBodyDecay: def _(obj: tuple) -> TwoBodyDecay: if len(obj) == 2: # noqa: PLR2004 transition, node_id = obj - if isinstance(transition, StateTransition) and isinstance(node_id, int): - return TwoBodyDecay.from_transition(*obj) + if _is_qrules_state_transition(transition) and isinstance(node_id, int): + return TwoBodyDecay.from_transition(transition, node_id) msg = f"Cannot create a {TwoBodyDecay.__name__} from {obj}" raise NotImplementedError(msg) +def _is_qrules_state_transition(obj) -> TypeGuard[StateTransition]: + if get_qrules_version() >= (0, 10): + from qrules.topology import FrozenTransition + + if isinstance(obj, FrozenTransition): + if any(not isinstance(s, State) for s in obj.states.values()): + return False + if any( + not isinstance(i, InteractionProperties) + for i in obj.interactions.values() + ): + return False + return True + if get_qrules_version() < (0, 10) and isinstance(obj, StateTransition): # type: ignore[misc] + return True + return False + + @lru_cache(maxsize=None) def is_opposite_helicity_state(topology: Topology, state_id: int) -> bool: """Determine if an edge is an "opposite helicity" state. @@ -329,8 +353,13 @@ def determine_attached_final_state(topology: Topology, state_id: int) -> list[in >>> from qrules.topology import create_isobar_topologies >>> topologies = create_isobar_topologies(5) - >>> determine_attached_final_state(topologies[0], state_id=5) + >>> determine_attached_final_state(topologies[3], state_id=5) [0, 3, 4] + >>> import pytest + >>> from ampform._qrules import get_qrules_version + >>> if get_qrules_version() < (0, 10): + ... pytest.skip('Doctest only works for qrules>=0.10') + ... """ edge = topology.edges[state_id] if edge.ending_node_id is None: @@ -344,13 +373,20 @@ def get_outer_state_ids(obj: ReactionInfo | StateTransition) -> list[int]: raise NotImplementedError(msg) -@get_outer_state_ids.register(StateTransition) -def _(transition: StateTransition) -> list[int]: +def __convert_state_transition(transition: StateTransition) -> list[int]: outer_state_ids = list(transition.initial_states) outer_state_ids += sorted(transition.final_states) return outer_state_ids +if get_qrules_version() < (0, 10): + get_outer_state_ids.register(StateTransition)(__convert_state_transition) +else: + from qrules.topology import FrozenTransition + + get_outer_state_ids.register(FrozenTransition)(__convert_state_transition) + + @get_outer_state_ids.register(ReactionInfo) def _(reaction: ReactionInfo) -> list[int]: return get_outer_state_ids(reaction.transitions[0]) diff --git a/src/ampform/helicity/naming.py b/src/ampform/helicity/naming.py index b427b458a..5bfd4dcde 100644 --- a/src/ampform/helicity/naming.py +++ b/src/ampform/helicity/naming.py @@ -352,8 +352,9 @@ def get_boost_chain_suffix(topology: Topology, state_id: int) -> str: the internal decay topology. >>> from qrules.topology import create_isobar_topologies + >>> from ampform._qrules import get_qrules_version >>> topologies = create_isobar_topologies(5) - >>> topology = topologies[0] + >>> topology = topologies[0 if get_qrules_version() < (0, 10) else 3] >>> for i in topology.intermediate_edge_ids | topology.outgoing_edge_ids: ... suffix = get_boost_chain_suffix(topology, i) ... print(f"{i}: 'phi{suffix}'") @@ -365,7 +366,7 @@ def get_boost_chain_suffix(topology: Topology, state_id: int) -> str: 5: 'phi_034' 6: 'phi_12' 7: 'phi_34^034' - >>> topology = topologies[1] + >>> topology = topologies[1 if get_qrules_version() < (0, 10) else 2] >>> for i in topology.intermediate_edge_ids | topology.outgoing_edge_ids: ... suffix = get_boost_chain_suffix(topology, i) ... print(f"{i}: 'phi{suffix}'") diff --git a/src/ampform/kinematics/__init__.py b/src/ampform/kinematics/__init__.py index b16089d44..c36efbada 100644 --- a/src/ampform/kinematics/__init__.py +++ b/src/ampform/kinematics/__init__.py @@ -17,6 +17,7 @@ from qrules.topology import Topology from qrules.transition import ReactionInfo, StateTransition +from ampform._qrules import get_qrules_version from ampform.helicity.decay import assert_isobar_topology from ampform.kinematics.angles import compute_helicity_angles from ampform.kinematics.lorentz import ( @@ -121,6 +122,13 @@ def _(obj: Topology) -> Topology: return obj -@_get_topology.register(StateTransition) -def _(obj: StateTransition) -> Topology: +def __get_state_transition(obj: StateTransition) -> Topology: return obj.topology + + +if get_qrules_version() < (0, 10): + _get_topology.register(StateTransition)(__get_state_transition) +else: + from qrules.topology import FrozenTransition + + _get_topology.register(FrozenTransition)(__get_state_transition) diff --git a/src/ampform/kinematics/lorentz.py b/src/ampform/kinematics/lorentz.py index 7c6ec79e7..e1e72fa89 100644 --- a/src/ampform/kinematics/lorentz.py +++ b/src/ampform/kinematics/lorentz.py @@ -601,8 +601,10 @@ def get_invariant_mass_symbol(topology: Topology, state_id: int) -> sp.Symbol: state :math:`5` is :math:`m_{034}`, because :math:`p_5=p_0+p_3+p_4`: >>> from qrules.topology import create_isobar_topologies + >>> from ampform._qrules import get_qrules_version >>> topologies = create_isobar_topologies(5) - >>> get_invariant_mass_symbol(topologies[0], state_id=5) + >>> topology = topologies[0 if get_qrules_version() < (0, 10) else 3] + >>> get_invariant_mass_symbol(topology, state_id=5) m_034 Naturally, the 'invariant' mass label for a final state is just the mass of the diff --git a/tests/helicity/test_decay.py b/tests/helicity/test_decay.py index 857a4fd4c..4a06b3b4d 100644 --- a/tests/helicity/test_decay.py +++ b/tests/helicity/test_decay.py @@ -6,6 +6,7 @@ import pytest from qrules.topology import Topology, create_isobar_topologies +from ampform._qrules import get_qrules_version from ampform.helicity.decay import ( determine_attached_final_state, get_sibling_state_id, @@ -24,10 +25,10 @@ def test_determine_attached_final_state(): topology.outgoing_edge_ids ) # intermediate states - topology = topologies[0] + topology = topologies[0 if get_qrules_version() < (0, 10) else 1] assert determine_attached_final_state(topology, state_id=4) == [0, 1] assert determine_attached_final_state(topology, state_id=5) == [2, 3] - topology = topologies[1] + topology = topologies[1 if get_qrules_version() < (0, 10) else 0] assert determine_attached_final_state(topology, state_id=4) == [1, 2, 3] assert determine_attached_final_state(topology, state_id=5) == [2, 3] diff --git a/tests/kinematics/conftest.py b/tests/kinematics/conftest.py index 385c10807..ba2ac41ff 100644 --- a/tests/kinematics/conftest.py +++ b/tests/kinematics/conftest.py @@ -5,6 +5,7 @@ import pytest from qrules.topology import Topology, create_isobar_topologies +from ampform._qrules import get_qrules_version from ampform.kinematics.lorentz import FourMomenta, create_four_momentum_symbols if TYPE_CHECKING: @@ -18,6 +19,6 @@ def topology_and_momentum_symbols( n = len(data_sample) assert n == 4 topologies = create_isobar_topologies(n) - topology = topologies[1] + topology = topologies[1 if get_qrules_version() < (0, 10) else 0] momentum_symbols = create_four_momentum_symbols(topology) return topology, momentum_symbols From 1e147919fbfa56c0c15bed7d5190e4b22924123d Mon Sep 17 00:00:00 2001 From: Remco de Boer <29308176+redeboer@users.noreply.github.com> Date: Fri, 1 Mar 2024 17:20:55 +0100 Subject: [PATCH 7/8] MAINT: upgrade to QRules v0.10.1 --- .constraints/py3.10.txt | 2 +- .constraints/py3.11.txt | 2 +- .constraints/py3.12.txt | 2 +- .constraints/py3.7.txt | 2 +- .constraints/py3.8.txt | 2 +- .constraints/py3.9.txt | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.constraints/py3.10.txt b/.constraints/py3.10.txt index 043bb1707..297b9a165 100644 --- a/.constraints/py3.10.txt +++ b/.constraints/py3.10.txt @@ -148,7 +148,7 @@ python-lsp-server==1.10.0 pytoolconfig==1.3.1 pyyaml==6.0.1 pyzmq==25.1.2 -qrules==0.10.0 +qrules==0.10.1 referencing==0.33.0 requests==2.31.0 rfc3339-validator==0.1.4 diff --git a/.constraints/py3.11.txt b/.constraints/py3.11.txt index 13290ea2b..d7bdd9d2c 100644 --- a/.constraints/py3.11.txt +++ b/.constraints/py3.11.txt @@ -147,7 +147,7 @@ python-lsp-server==1.10.0 pytoolconfig==1.3.1 pyyaml==6.0.1 pyzmq==25.1.2 -qrules==0.10.0 +qrules==0.10.1 referencing==0.33.0 requests==2.31.0 rfc3339-validator==0.1.4 diff --git a/.constraints/py3.12.txt b/.constraints/py3.12.txt index ded3d2852..2d3518278 100644 --- a/.constraints/py3.12.txt +++ b/.constraints/py3.12.txt @@ -147,7 +147,7 @@ python-lsp-server==1.10.0 pytoolconfig==1.3.1 pyyaml==6.0.1 pyzmq==25.1.2 -qrules==0.10.0 +qrules==0.10.1 referencing==0.33.0 requests==2.31.0 rfc3339-validator==0.1.4 diff --git a/.constraints/py3.7.txt b/.constraints/py3.7.txt index e31f8f842..9981c4ae7 100644 --- a/.constraints/py3.7.txt +++ b/.constraints/py3.7.txt @@ -153,7 +153,7 @@ pytoolconfig==1.3.0 pytz==2024.1 pyyaml==6.0.1 pyzmq==24.0.1 -qrules==0.10.0 +qrules==0.10.1 requests==2.31.0 rfc3339-validator==0.1.4 rfc3986-validator==0.1.1 diff --git a/.constraints/py3.8.txt b/.constraints/py3.8.txt index bb42cf3db..5fd5e6f22 100644 --- a/.constraints/py3.8.txt +++ b/.constraints/py3.8.txt @@ -153,7 +153,7 @@ pytoolconfig==1.3.1 pytz==2024.1 pyyaml==6.0.1 pyzmq==25.1.2 -qrules==0.10.0 +qrules==0.10.1 referencing==0.33.0 requests==2.31.0 rfc3339-validator==0.1.4 diff --git a/.constraints/py3.9.txt b/.constraints/py3.9.txt index 833aa2870..40fb5b455 100644 --- a/.constraints/py3.9.txt +++ b/.constraints/py3.9.txt @@ -149,7 +149,7 @@ python-lsp-server==1.10.0 pytoolconfig==1.3.1 pyyaml==6.0.1 pyzmq==25.1.2 -qrules==0.10.0 +qrules==0.10.1 referencing==0.33.0 requests==2.31.0 rfc3339-validator==0.1.4 From 93168da6a3e9b745446e839e03545a4f3d66b73b Mon Sep 17 00:00:00 2001 From: Remco de Boer <29308176+redeboer@users.noreply.github.com> Date: Fri, 1 Mar 2024 17:37:54 +0100 Subject: [PATCH 8/8] MAINT: update links to QRules v0.10 API --- docs/conf.py | 4 ++-- docs/usage/amplitude.ipynb | 2 +- docs/usage/dynamics/custom.ipynb | 2 +- docs/usage/helicity/formalism.ipynb | 4 ++-- src/ampform/__init__.py | 2 +- src/ampform/helicity/__init__.py | 2 +- src/ampform/helicity/align/axisangle.py | 2 +- src/ampform/helicity/decay.py | 8 ++++---- src/ampform/helicity/naming.py | 4 ++-- 9 files changed, 15 insertions(+), 15 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 4f9f9f781..a54b72725 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -59,7 +59,7 @@ "ReactionInfo": "qrules.transition.ReactionInfo", "Slider": ("obj", "symplot.Slider"), "State": "qrules.transition.State", - "StateTransition": "qrules.transition.StateTransition", + "StateTransition": "qrules.topology.Transition", "T": "TypeVar", "Topology": "qrules.topology.Topology", "WignerD": "sympy.physics.quantum.spin.WignerD", @@ -238,7 +238,7 @@ "numpy": (f"https://numpy.org/doc/{pin_minor('numpy')}", None), "pwa": ("https://pwa.readthedocs.io", None), "python": ("https://docs.python.org/3", None), - "qrules": (f"https://qrules.readthedocs.io/en/{pin('qrules')}", None), + "qrules": (f"https://qrules.readthedocs.io/{pin('qrules')}", None), "sympy": ("https://docs.sympy.org/latest", None), } linkcheck_anchors = False diff --git a/docs/usage/amplitude.ipynb b/docs/usage/amplitude.ipynb index 46c599eb4..00f4a15df 100644 --- a/docs/usage/amplitude.ipynb +++ b/docs/usage/amplitude.ipynb @@ -99,7 +99,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "In {doc}`qrules:usage/reaction`, we used {func}`~qrules.generate_transitions` to create a list of allowed {class}`~qrules.transition.StateTransition`s for a specific decay channel:" + "In {doc}`qrules:usage/reaction`, we used {func}`~qrules.generate_transitions` to create a list of allowed {class}`~qrules.topology.Transition`s for a specific decay channel:" ] }, { diff --git a/docs/usage/dynamics/custom.ipynb b/docs/usage/dynamics/custom.ipynb index b10325601..4c676d46e 100644 --- a/docs/usage/dynamics/custom.ipynb +++ b/docs/usage/dynamics/custom.ipynb @@ -176,7 +176,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "A function that behaves like a {class}`.ResonanceDynamicsBuilder` should return a {class}`tuple` of some {class}`~sympy.core.expr.Expr` (which formulates your lineshape) and a {class}`dict` of {class}`~sympy.core.symbol.Symbol`s to some suggested initial values. This signature is required so the builder knows how to extract the correct symbol names and their suggested initial values from a {class}`~qrules.transition.StateTransition`." + "A function that behaves like a {class}`.ResonanceDynamicsBuilder` should return a {class}`tuple` of some {class}`~sympy.core.expr.Expr` (which formulates your lineshape) and a {class}`dict` of {class}`~sympy.core.symbol.Symbol`s to some suggested initial values. This signature is required so the builder knows how to extract the correct symbol names and their suggested initial values from a {class}`~qrules.topology.Transition`." ] }, { diff --git a/docs/usage/helicity/formalism.ipynb b/docs/usage/helicity/formalism.ipynb index 32468c981..e9003a404 100644 --- a/docs/usage/helicity/formalism.ipynb +++ b/docs/usage/helicity/formalism.ipynb @@ -332,9 +332,9 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "See {func}`.formulate_isobar_wigner_d` and {func}`.formulate_isobar_cg_coefficients` for how these Wigner-$D$ functions and Clebsch-Gordan coefficients are computed for each node on a {class}`~qrules.transition.StateTransition`.\n", + "See {func}`.formulate_isobar_wigner_d` and {func}`.formulate_isobar_cg_coefficients` for how these Wigner-$D$ functions and Clebsch-Gordan coefficients are computed for each node on a {class}`~qrules.topology.Transition`.\n", "\n", - "We can see this also from the original {class}`~qrules.transition.ReactionInfo` objects. Let's select only the {attr}`~qrules.transition.ReactionInfo.transitions` where the $a_1(1260)^+$ resonance has spin projection $-1$ (taken to be helicity $-1$ in the helicity formalism). We then see just one {class}`~qrules.transition.StateTransition` in the helicity basis and three transitions in the canonical basis:" + "We can see this also from the original {class}`~qrules.transition.ReactionInfo` objects. Let's select only the {attr}`~qrules.transition.ReactionInfo.transitions` where the $a_1(1260)^+$ resonance has spin projection $-1$ (taken to be helicity $-1$ in the helicity formalism). We then see just one {class}`~qrules.topology.Transition` in the helicity basis and three transitions in the canonical basis:" ] }, { diff --git a/src/ampform/__init__.py b/src/ampform/__init__.py index 030e25d0b..466095cbc 100644 --- a/src/ampform/__init__.py +++ b/src/ampform/__init__.py @@ -1,7 +1,7 @@ """Build amplitude models with different PWA formalisms. AmpForm formalizes formalisms from :doc:`Partial Wave Analysis `. It provides -tools to convert `~qrules.transition.StateTransition` solutions that the `.qrules` +tools to convert `~qrules.topology.Transition` solutions that the `.qrules` package found into an `.HelicityModel`. The output `.HelicityModel` can then be used by external fitter packages to generate a data set (toy Monte Carlo) for this specific reaction process, or to optimize ('fit') its parameters so that they resemble the data diff --git a/src/ampform/helicity/__init__.py b/src/ampform/helicity/__init__.py index f2aa26660..05e46ae62 100644 --- a/src/ampform/helicity/__init__.py +++ b/src/ampform/helicity/__init__.py @@ -679,7 +679,7 @@ def assign( # noqa: PLR6301 - `str`: Select transition nodes by the name of the `~.TwoBodyDecay.parent` `~qrules.particle.Particle`. - - `.TwoBodyDecay` or `tuple` of a `~qrules.transition.StateTransition` with a + - `.TwoBodyDecay` or `tuple` of a `~qrules.topology.Transition` with a node ID: set dynamics for one specific transition node. """ msg = ( diff --git a/src/ampform/helicity/align/axisangle.py b/src/ampform/helicity/align/axisangle.py index 409845f72..90cfd31ff 100644 --- a/src/ampform/helicity/align/axisangle.py +++ b/src/ampform/helicity/align/axisangle.py @@ -197,7 +197,7 @@ def formulate_wigner_rotation( :cite:`marangottoHelicityAmplitudesGeneric2020`, p.6, especially Eq.(36). Args: - transition: The `~qrules.transition.StateTransition` in which you + transition: The `~qrules.topology.Transition` in which you want to rotate one of the spin states. rotated_state_id: The state ID of a spin `~qrules.transition.State` that you want to rotate. diff --git a/src/ampform/helicity/decay.py b/src/ampform/helicity/decay.py index c1860b7fc..f65e8cfdc 100644 --- a/src/ampform/helicity/decay.py +++ b/src/ampform/helicity/decay.py @@ -1,4 +1,4 @@ -"""Extract two-body decay info from a `~qrules.transition.StateTransition`.""" +"""Extract two-body decay info from a `~qrules.topology.Transition`.""" from __future__ import annotations @@ -44,11 +44,11 @@ def from_transition(cls, transition: StateTransition, state_id: int) -> StateWit @frozen class TwoBodyDecay: - """Two-body sub-decay in a `~qrules.transition.StateTransition`. + """Two-body sub-decay in a `~qrules.topology.Transition`. This container class ensures that: - 1. a selected node in a `~qrules.transition.StateTransition` is indeed a 1-to-2 body + 1. a selected node in a `~qrules.topology.Transition` is indeed a 1-to-2 body decay 2. its two `.children` are sorted by whether they decay further or not (see @@ -407,7 +407,7 @@ def group_by_spin_projection( ) -> list[list[StateTransition]]: """Match final and initial states in groups. - Each `~qrules.transition.StateTransition` corresponds to a specific state transition + Each `~qrules.topology.Transition` corresponds to a specific state transition amplitude. This function groups together transitions, which have the same initial and final state (including spin). This is needed to determine the coherency of the individual amplitude parts. diff --git a/src/ampform/helicity/naming.py b/src/ampform/helicity/naming.py index 889293ba6..f1f78de4e 100644 --- a/src/ampform/helicity/naming.py +++ b/src/ampform/helicity/naming.py @@ -41,10 +41,10 @@ def generate_amplitude_name( ) -> str: """Generates a unique name for the amplitude corresponding. - That is, corresponging to the given `~qrules.transition.StateTransition`. If + That is, corresponging to the given `~qrules.topology.Transition`. If ``node_id`` is given, it generates a unique name for the partial amplitude corresponding to the interaction node of the given - `~qrules.transition.StateTransition`. + `~qrules.topology.Transition`. """ @abstractmethod