From d352f76b0d799740578bd90a549a3ab7962fe60f Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 7 Aug 2024 16:40:37 +0200 Subject: [PATCH] MAINT: update pip constraints and pre-commit (#530) * DX: implement `.envrc` for `direnv` * FIX: downgrade `tensorflow` in tests * FIX: relink matplotlib API * MAINT: address linting issues * MAINT: ignore `unsafe_hash` deprecation warning * MAINT: reduce diff * MAINT: remove `editor` and `slideshow` cell metadata * MAINT: remove empty tags from notebooks --- .constraints/py3.10.txt | 129 +++++++++--------- .constraints/py3.11.txt | 127 +++++++++-------- .constraints/py3.12.txt | 125 +++++++++-------- .constraints/py3.8.txt | 79 ++++++----- .constraints/py3.9.txt | 117 ++++++++-------- .cspell.json | 1 + .envrc | 1 + .pre-commit-config.yaml | 13 +- .vscode/settings.json | 4 + benchmarks/ampform.py | 4 +- benchmarks/expression.py | 4 +- docs/amplitude-analysis.ipynb | 47 ++----- .../analytic-continuation.ipynb | 10 +- docs/conf.py | 12 +- docs/usage.ipynb | 66 ++------- docs/usage/basics.ipynb | 70 +++------- docs/usage/binned-fit.ipynb | 38 ++---- docs/usage/caching.ipynb | 34 +---- docs/usage/chi-squared.ipynb | 10 +- docs/usage/faster-lambdify.ipynb | 10 +- docs/usage/unbinned-fit.ipynb | 26 +--- pyproject.toml | 81 ++++++----- src/tensorwaves/data/_data_sample.py | 3 +- src/tensorwaves/data/rng.py | 4 +- src/tensorwaves/estimator.py | 6 +- src/tensorwaves/function/sympy/__init__.py | 2 +- src/tensorwaves/function/sympy/_printer.py | 4 +- src/tensorwaves/interface.py | 2 +- src/tensorwaves/optimizer/scipy.py | 3 +- tests/function/test_function.py | 4 +- tests/optimizer/test_fit_simple_model.py | 4 +- tests/test_interface.py | 4 +- 32 files changed, 435 insertions(+), 609 deletions(-) create mode 100644 .envrc diff --git a/.constraints/py3.10.txt b/.constraints/py3.10.txt index 784948ee..b050ac45 100644 --- a/.constraints/py3.10.txt +++ b/.constraints/py3.10.txt @@ -2,7 +2,7 @@ # uv pip compile pyproject.toml -o .constraints/py3.10.txt --all-extras --no-annotate --python-version=3.10 --no-emit-package setuptools absl-py==2.1.0 accessible-pygments==0.0.5 -alabaster==0.7.16 +alabaster==1.0.0 ampform==0.15.4 anyio==4.4.0 argon2-cffi==23.1.0 @@ -11,15 +11,14 @@ arrow==1.3.0 asttokens==2.4.1 astunparse==1.6.3 async-lru==2.0.4 -attrs==23.2.0 +attrs==24.2.0 babel==2.15.0 beautifulsoup4==4.12.3 -black==24.4.2 bleach==6.1.0 -cachetools==5.3.3 +cachetools==5.4.0 cattrs==23.2.3 -certifi==2024.6.2 -cffi==1.16.0 +certifi==2024.7.4 +cffi==1.17.0 cfgv==3.4.0 chardet==5.2.0 charset-normalizer==3.3.2 @@ -28,55 +27,54 @@ cloudpickle==3.0.0 colorama==0.4.6 comm==0.2.2 contourpy==1.2.1 -coverage==7.5.4 +coverage==7.6.1 cycler==0.12.1 -debugpy==1.8.1 +debugpy==1.8.5 decorator==5.1.1 defusedxml==0.7.1 distlib==0.3.8 dm-tree==0.1.8 docstring-to-markdown==0.15 docutils==0.21.2 -exceptiongroup==1.2.1 +exceptiongroup==1.2.2 execnet==2.1.1 executing==2.0.1 fastjsonschema==2.20.0 filelock==3.15.4 flatbuffers==24.3.25 -fonttools==4.53.0 +fonttools==4.53.1 fqdn==1.5.1 -gast==0.5.4 +gast==0.6.0 gitdb==4.0.11 gitpython==3.1.43 google-pasta==0.2.0 graphviz==0.20.3 greenlet==3.0.3 -grpcio==1.64.1 +grpcio==1.65.4 h11==0.14.0 h5py==3.11.0 hepunits==2.3.4 httpcore==1.0.5 httpx==0.27.0 -identify==2.5.36 +identify==2.6.0 idna==3.7 imagesize==1.4.1 -iminuit==2.26.0 -importlib-metadata==7.2.1 +iminuit==2.28.0 +importlib-metadata==8.2.0 iniconfig==2.0.0 -ipykernel==6.29.4 +ipykernel==6.29.5 ipympl==0.9.4 -ipython==8.25.0 +ipython==8.26.0 ipython-genutils==0.2.0 ipywidgets==8.1.3 isoduration==20.11.0 -isort==5.13.2 -jax==0.4.30 -jaxlib==0.4.30 +jax==0.4.31 +jaxlib==0.4.31 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==1.0.0 jupyter-cache==1.0.0 @@ -85,18 +83,18 @@ jupyter-console==6.6.3 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-mathjax==0.2.6 jupyter-server-terminals==0.5.3 -jupyterlab==4.2.2 -jupyterlab-code-formatter==2.2.1 +jupyterlab==4.2.4 +jupyterlab-code-formatter==3.0.0 jupyterlab-git==0.50.1 jupyterlab-lsp==5.1.0 jupyterlab-myst==2.4.2 jupyterlab-pygments==0.3.0 -jupyterlab-server==2.27.2 +jupyterlab-server==2.27.3 jupyterlab-widgets==3.0.11 -keras==3.3.3 +keras==3.4.1 kiwisolver==1.4.5 libclang==18.1.1 llvmlite==0.43.0 @@ -104,17 +102,17 @@ lsprotocol==2023.0.1 markdown==3.6 markdown-it-py==3.0.0 markupsafe==2.1.5 -matplotlib==3.9.0 +matplotlib==3.9.1.post1 matplotlib-inline==0.1.7 mdit-py-plugins==0.4.1 mdurl==0.1.2 mistune==3.0.2 ml-dtypes==0.3.2 mpmath==1.3.0 -mypy==1.10.0 +mypy==1.11.1 mypy-extensions==1.0.0 -myst-nb==1.1.0 -myst-parser==3.0.1 +myst-nb==1.1.1 +myst-parser==4.0.0 namex==0.0.8 nbclient==0.6.8 nbconvert==7.16.4 @@ -128,34 +126,33 @@ notebook-shim==0.2.4 numba==0.60.0 numpy==1.26.4 opt-einsum==3.3.0 -optree==0.11.0 +optree==0.12.1 overrides==7.7.0 packaging==24.1 pandas==2.2.2 pandocfilters==1.5.1 parso==0.8.4 particle==0.24.0 -pathspec==0.12.1 pexpect==4.9.0 phasespace==1.10.3 -pillow==10.3.0 +pillow==10.4.0 platformdirs==4.2.2 pluggy==1.5.0 -pre-commit==3.7.1 +pre-commit==3.8.0 prometheus-client==0.20.0 prompt-toolkit==3.0.47 -protobuf==4.25.3 +protobuf==4.25.4 psutil==6.0.0 ptyprocess==0.7.0 -pure-eval==0.2.2 +pure-eval==0.2.3 py-cpuinfo==9.0.0 -pyarrow==16.1.0 +pyarrow==17.0.0 pycparser==2.22 -pydata-sphinx-theme==0.15.3 +pydata-sphinx-theme==0.15.4 pygments==2.18.0 pyparsing==3.1.2 pyproject-api==1.7.1 -pytest==8.2.2 +pytest==8.3.2 pytest-benchmark==4.0.0 pytest-cov==5.0.0 pytest-mock==3.14.0 @@ -164,12 +161,12 @@ python-constraint2==2.0.0b5 python-dateutil==2.9.0.post0 python-json-logger==2.0.7 python-lsp-jsonrpc==1.1.2 -python-lsp-ruff==2.2.1 +python-lsp-ruff==2.2.2 python-lsp-server==1.11.0 pytoolconfig==1.3.1 pytz==2024.1 -pyyaml==6.0.1 -pyzmq==26.0.3 +pyyaml==6.0.2 +pyzmq==26.1.0 qrules==0.10.2 qtconsole==5.5.2 qtpy==2.4.1 @@ -179,71 +176,71 @@ rfc3339-validator==0.1.4 rfc3986-validator==0.1.1 rich==13.7.1 rope==1.13.0 -rpds-py==0.18.1 -ruff==0.4.10 -scipy==1.13.1 +rpds-py==0.20.0 +ruff==0.5.6 +scipy==1.14.0 send2trash==1.8.3 six==1.16.0 smmap==5.0.1 sniffio==1.3.1 snowballstemmer==2.2.0 soupsieve==2.5 -sphinx==7.3.7 +sphinx==8.0.2 sphinx-api-relink==0.0.9 sphinx-autobuild==2024.4.16 sphinx-book-theme==1.1.3 sphinx-codeautolink==0.15.2 sphinx-comments==0.0.3 sphinx-copybutton==0.5.2 -sphinx-design==0.6.0 +sphinx-design==0.6.1 sphinx-thebe==0.3.1 sphinx-togglebutton==0.3.2 -sphinxcontrib-applehelp==1.0.8 -sphinxcontrib-devhelp==1.0.6 -sphinxcontrib-htmlhelp==2.0.5 +sphinxcontrib-applehelp==2.0.0 +sphinxcontrib-devhelp==2.0.0 +sphinxcontrib-htmlhelp==2.1.0 sphinxcontrib-jsmath==1.0.1 -sphinxcontrib-qthelp==1.0.7 -sphinxcontrib-serializinghtml==1.1.10 +sphinxcontrib-qthelp==2.0.0 +sphinxcontrib-serializinghtml==2.0.0 sphobjinv==2.3.1.1 -sqlalchemy==2.0.31 +sqlalchemy==2.0.32 stack-data==0.6.3 -starlette==0.37.2 -sympy==1.12.1 +starlette==0.38.2 +sympy==1.13.1 tabulate==0.9.0 tensorboard==2.16.2 tensorboard-data-server==0.7.2 -tensorflow==2.16.1 -tensorflow-io-gcs-filesystem==0.37.0 +tensorflow==2.16.2 +tensorflow-io-gcs-filesystem==0.37.1 tensorflow-probability==0.24.0 termcolor==2.4.0 terminado==0.18.1 tinycss2==1.3.0 tomli==2.0.1 tornado==6.4.1 -tox==4.15.1 -tqdm==4.66.4 +tox==4.17.0 +tqdm==4.66.5 traitlets==5.14.3 -types-protobuf==5.26.0.20240422 +types-protobuf==5.27.0.20240626 types-python-dateutil==2.9.0.20240316 -types-pyyaml==6.0.12.20240311 -types-requests==2.32.0.20240622 -types-tensorflow==2.16.0.20240618 +types-pyyaml==6.0.12.20240724 +types-requests==2.32.0.20240712 +types-tensorflow==2.16.0.20240804 types-tqdm==4.66.0.20240417 typing-extensions==4.12.2 tzdata==2024.1 ujson==5.10.0 uri-template==1.3.0 urllib3==2.2.2 -uvicorn==0.30.1 +uvicorn==0.30.5 virtualenv==20.26.3 -watchfiles==0.22.0 +watchfiles==0.23.0 wcwidth==0.2.13 webcolors==24.6.0 webencodings==0.5.1 websocket-client==1.8.0 websockets==12.0 werkzeug==3.0.3 -wheel==0.43.0 +wheel==0.44.0 widgetsnbextension==4.0.11 wrapt==1.16.0 zipp==3.19.2 diff --git a/.constraints/py3.11.txt b/.constraints/py3.11.txt index fb113061..3db13156 100644 --- a/.constraints/py3.11.txt +++ b/.constraints/py3.11.txt @@ -2,7 +2,7 @@ # uv pip compile pyproject.toml -o .constraints/py3.11.txt --all-extras --no-annotate --python-version=3.11 --no-emit-package setuptools absl-py==2.1.0 accessible-pygments==0.0.5 -alabaster==0.7.16 +alabaster==1.0.0 ampform==0.15.4 anyio==4.4.0 argon2-cffi==23.1.0 @@ -11,15 +11,14 @@ arrow==1.3.0 asttokens==2.4.1 astunparse==1.6.3 async-lru==2.0.4 -attrs==23.2.0 +attrs==24.2.0 babel==2.15.0 beautifulsoup4==4.12.3 -black==24.4.2 bleach==6.1.0 -cachetools==5.3.3 +cachetools==5.4.0 cattrs==23.2.3 -certifi==2024.6.2 -cffi==1.16.0 +certifi==2024.7.4 +cffi==1.17.0 cfgv==3.4.0 chardet==5.2.0 charset-normalizer==3.3.2 @@ -28,9 +27,9 @@ cloudpickle==3.0.0 colorama==0.4.6 comm==0.2.2 contourpy==1.2.1 -coverage==7.5.4 +coverage==7.6.1 cycler==0.12.1 -debugpy==1.8.1 +debugpy==1.8.5 decorator==5.1.1 defusedxml==0.7.1 distlib==0.3.8 @@ -42,40 +41,39 @@ executing==2.0.1 fastjsonschema==2.20.0 filelock==3.15.4 flatbuffers==24.3.25 -fonttools==4.53.0 +fonttools==4.53.1 fqdn==1.5.1 -gast==0.5.4 +gast==0.6.0 gitdb==4.0.11 gitpython==3.1.43 google-pasta==0.2.0 graphviz==0.20.3 greenlet==3.0.3 -grpcio==1.64.1 +grpcio==1.65.4 h11==0.14.0 h5py==3.11.0 hepunits==2.3.4 httpcore==1.0.5 httpx==0.27.0 -identify==2.5.36 +identify==2.6.0 idna==3.7 imagesize==1.4.1 -iminuit==2.26.0 -importlib-metadata==7.2.1 +iminuit==2.28.0 +importlib-metadata==8.2.0 iniconfig==2.0.0 -ipykernel==6.29.4 +ipykernel==6.29.5 ipympl==0.9.4 -ipython==8.25.0 +ipython==8.26.0 ipython-genutils==0.2.0 ipywidgets==8.1.3 isoduration==20.11.0 -isort==5.13.2 -jax==0.4.30 -jaxlib==0.4.30 +jax==0.4.31 +jaxlib==0.4.31 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==1.0.0 jupyter-cache==1.0.0 @@ -84,18 +82,18 @@ jupyter-console==6.6.3 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-mathjax==0.2.6 jupyter-server-terminals==0.5.3 -jupyterlab==4.2.2 -jupyterlab-code-formatter==2.2.1 +jupyterlab==4.2.4 +jupyterlab-code-formatter==3.0.0 jupyterlab-git==0.50.1 jupyterlab-lsp==5.1.0 jupyterlab-myst==2.4.2 jupyterlab-pygments==0.3.0 -jupyterlab-server==2.27.2 +jupyterlab-server==2.27.3 jupyterlab-widgets==3.0.11 -keras==3.3.3 +keras==3.4.1 kiwisolver==1.4.5 libclang==18.1.1 llvmlite==0.43.0 @@ -103,17 +101,17 @@ lsprotocol==2023.0.1 markdown==3.6 markdown-it-py==3.0.0 markupsafe==2.1.5 -matplotlib==3.9.0 +matplotlib==3.9.1.post1 matplotlib-inline==0.1.7 mdit-py-plugins==0.4.1 mdurl==0.1.2 mistune==3.0.2 ml-dtypes==0.3.2 mpmath==1.3.0 -mypy==1.10.0 +mypy==1.11.1 mypy-extensions==1.0.0 -myst-nb==1.1.0 -myst-parser==3.0.1 +myst-nb==1.1.1 +myst-parser==4.0.0 namex==0.0.8 nbclient==0.6.8 nbconvert==7.16.4 @@ -127,34 +125,33 @@ notebook-shim==0.2.4 numba==0.60.0 numpy==1.26.4 opt-einsum==3.3.0 -optree==0.11.0 +optree==0.12.1 overrides==7.7.0 packaging==24.1 pandas==2.2.2 pandocfilters==1.5.1 parso==0.8.4 particle==0.24.0 -pathspec==0.12.1 pexpect==4.9.0 phasespace==1.10.3 -pillow==10.3.0 +pillow==10.4.0 platformdirs==4.2.2 pluggy==1.5.0 -pre-commit==3.7.1 +pre-commit==3.8.0 prometheus-client==0.20.0 prompt-toolkit==3.0.47 -protobuf==4.25.3 +protobuf==4.25.4 psutil==6.0.0 ptyprocess==0.7.0 -pure-eval==0.2.2 +pure-eval==0.2.3 py-cpuinfo==9.0.0 -pyarrow==16.1.0 +pyarrow==17.0.0 pycparser==2.22 -pydata-sphinx-theme==0.15.3 +pydata-sphinx-theme==0.15.4 pygments==2.18.0 pyparsing==3.1.2 pyproject-api==1.7.1 -pytest==8.2.2 +pytest==8.3.2 pytest-benchmark==4.0.0 pytest-cov==5.0.0 pytest-mock==3.14.0 @@ -163,12 +160,12 @@ python-constraint2==2.0.0b5 python-dateutil==2.9.0.post0 python-json-logger==2.0.7 python-lsp-jsonrpc==1.1.2 -python-lsp-ruff==2.2.1 +python-lsp-ruff==2.2.2 python-lsp-server==1.11.0 pytoolconfig==1.3.1 pytz==2024.1 -pyyaml==6.0.1 -pyzmq==26.0.3 +pyyaml==6.0.2 +pyzmq==26.1.0 qrules==0.10.2 qtconsole==5.5.2 qtpy==2.4.1 @@ -178,70 +175,70 @@ rfc3339-validator==0.1.4 rfc3986-validator==0.1.1 rich==13.7.1 rope==1.13.0 -rpds-py==0.18.1 -ruff==0.4.10 -scipy==1.13.1 +rpds-py==0.20.0 +ruff==0.5.6 +scipy==1.14.0 send2trash==1.8.3 six==1.16.0 smmap==5.0.1 sniffio==1.3.1 snowballstemmer==2.2.0 soupsieve==2.5 -sphinx==7.3.7 +sphinx==8.0.2 sphinx-api-relink==0.0.9 sphinx-autobuild==2024.4.16 sphinx-book-theme==1.1.3 sphinx-codeautolink==0.15.2 sphinx-comments==0.0.3 sphinx-copybutton==0.5.2 -sphinx-design==0.6.0 +sphinx-design==0.6.1 sphinx-thebe==0.3.1 sphinx-togglebutton==0.3.2 -sphinxcontrib-applehelp==1.0.8 -sphinxcontrib-devhelp==1.0.6 -sphinxcontrib-htmlhelp==2.0.5 +sphinxcontrib-applehelp==2.0.0 +sphinxcontrib-devhelp==2.0.0 +sphinxcontrib-htmlhelp==2.1.0 sphinxcontrib-jsmath==1.0.1 -sphinxcontrib-qthelp==1.0.7 -sphinxcontrib-serializinghtml==1.1.10 +sphinxcontrib-qthelp==2.0.0 +sphinxcontrib-serializinghtml==2.0.0 sphobjinv==2.3.1.1 -sqlalchemy==2.0.31 +sqlalchemy==2.0.32 stack-data==0.6.3 -starlette==0.37.2 -sympy==1.12.1 +starlette==0.38.2 +sympy==1.13.1 tabulate==0.9.0 tensorboard==2.16.2 tensorboard-data-server==0.7.2 -tensorflow==2.16.1 -tensorflow-io-gcs-filesystem==0.37.0 +tensorflow==2.16.2 +tensorflow-io-gcs-filesystem==0.37.1 tensorflow-probability==0.24.0 termcolor==2.4.0 terminado==0.18.1 tinycss2==1.3.0 tornado==6.4.1 -tox==4.15.1 -tqdm==4.66.4 +tox==4.17.0 +tqdm==4.66.5 traitlets==5.14.3 -types-protobuf==5.26.0.20240422 +types-protobuf==5.27.0.20240626 types-python-dateutil==2.9.0.20240316 -types-pyyaml==6.0.12.20240311 -types-requests==2.32.0.20240622 -types-tensorflow==2.16.0.20240618 +types-pyyaml==6.0.12.20240724 +types-requests==2.32.0.20240712 +types-tensorflow==2.16.0.20240804 types-tqdm==4.66.0.20240417 typing-extensions==4.12.2 tzdata==2024.1 ujson==5.10.0 uri-template==1.3.0 urllib3==2.2.2 -uvicorn==0.30.1 +uvicorn==0.30.5 virtualenv==20.26.3 -watchfiles==0.22.0 +watchfiles==0.23.0 wcwidth==0.2.13 webcolors==24.6.0 webencodings==0.5.1 websocket-client==1.8.0 websockets==12.0 werkzeug==3.0.3 -wheel==0.43.0 +wheel==0.44.0 widgetsnbextension==4.0.11 wrapt==1.16.0 zipp==3.19.2 diff --git a/.constraints/py3.12.txt b/.constraints/py3.12.txt index 41825a1e..d6e73bf3 100644 --- a/.constraints/py3.12.txt +++ b/.constraints/py3.12.txt @@ -2,7 +2,7 @@ # uv pip compile pyproject.toml -o .constraints/py3.12.txt --all-extras --no-annotate --python-version=3.12 --no-emit-package setuptools absl-py==2.1.0 accessible-pygments==0.0.5 -alabaster==0.7.16 +alabaster==1.0.0 ampform==0.15.4 anyio==4.4.0 argon2-cffi==23.1.0 @@ -11,15 +11,14 @@ arrow==1.3.0 asttokens==2.4.1 astunparse==1.6.3 async-lru==2.0.4 -attrs==23.2.0 +attrs==24.2.0 babel==2.15.0 beautifulsoup4==4.12.3 -black==24.4.2 bleach==6.1.0 -cachetools==5.3.3 +cachetools==5.4.0 cattrs==23.2.3 -certifi==2024.6.2 -cffi==1.16.0 +certifi==2024.7.4 +cffi==1.17.0 cfgv==3.4.0 chardet==5.2.0 charset-normalizer==3.3.2 @@ -28,9 +27,9 @@ cloudpickle==3.0.0 colorama==0.4.6 comm==0.2.2 contourpy==1.2.1 -coverage==7.5.4 +coverage==7.6.1 cycler==0.12.1 -debugpy==1.8.1 +debugpy==1.8.5 decorator==5.1.1 defusedxml==0.7.1 distlib==0.3.8 @@ -42,40 +41,39 @@ executing==2.0.1 fastjsonschema==2.20.0 filelock==3.15.4 flatbuffers==24.3.25 -fonttools==4.53.0 +fonttools==4.53.1 fqdn==1.5.1 -gast==0.5.4 +gast==0.6.0 gitdb==4.0.11 gitpython==3.1.43 google-pasta==0.2.0 graphviz==0.20.3 greenlet==3.0.3 -grpcio==1.64.1 +grpcio==1.65.4 h11==0.14.0 h5py==3.11.0 hepunits==2.3.4 httpcore==1.0.5 httpx==0.27.0 -identify==2.5.36 +identify==2.6.0 idna==3.7 imagesize==1.4.1 -iminuit==2.26.0 -importlib-metadata==7.2.1 +iminuit==2.28.0 +importlib-metadata==8.2.0 iniconfig==2.0.0 -ipykernel==6.29.4 +ipykernel==6.29.5 ipympl==0.9.4 -ipython==8.25.0 +ipython==8.26.0 ipython-genutils==0.2.0 ipywidgets==8.1.3 isoduration==20.11.0 -isort==5.13.2 -jax==0.4.30 -jaxlib==0.4.30 +jax==0.4.31 +jaxlib==0.4.31 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==1.0.0 jupyter-cache==1.0.0 @@ -84,18 +82,18 @@ jupyter-console==6.6.3 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-mathjax==0.2.6 jupyter-server-terminals==0.5.3 -jupyterlab==4.2.2 -jupyterlab-code-formatter==2.2.1 +jupyterlab==4.2.4 +jupyterlab-code-formatter==3.0.0 jupyterlab-git==0.50.1 jupyterlab-lsp==5.1.0 jupyterlab-myst==2.4.2 jupyterlab-pygments==0.3.0 -jupyterlab-server==2.27.2 +jupyterlab-server==2.27.3 jupyterlab-widgets==3.0.11 -keras==3.3.3 +keras==3.4.1 kiwisolver==1.4.5 libclang==18.1.1 llvmlite==0.43.0 @@ -103,17 +101,17 @@ lsprotocol==2023.0.1 markdown==3.6 markdown-it-py==3.0.0 markupsafe==2.1.5 -matplotlib==3.9.0 +matplotlib==3.9.1.post1 matplotlib-inline==0.1.7 mdit-py-plugins==0.4.1 mdurl==0.1.2 mistune==3.0.2 ml-dtypes==0.3.2 mpmath==1.3.0 -mypy==1.10.0 +mypy==1.11.1 mypy-extensions==1.0.0 -myst-nb==1.1.0 -myst-parser==3.0.1 +myst-nb==1.1.1 +myst-parser==4.0.0 namex==0.0.8 nbclient==0.6.8 nbconvert==7.16.4 @@ -127,34 +125,33 @@ notebook-shim==0.2.4 numba==0.60.0 numpy==1.26.4 opt-einsum==3.3.0 -optree==0.11.0 +optree==0.12.1 overrides==7.7.0 packaging==24.1 pandas==2.2.2 pandocfilters==1.5.1 parso==0.8.4 particle==0.24.0 -pathspec==0.12.1 pexpect==4.9.0 phasespace==1.10.3 -pillow==10.3.0 +pillow==10.4.0 platformdirs==4.2.2 pluggy==1.5.0 -pre-commit==3.7.1 +pre-commit==3.8.0 prometheus-client==0.20.0 prompt-toolkit==3.0.47 -protobuf==4.25.3 +protobuf==4.25.4 psutil==6.0.0 ptyprocess==0.7.0 -pure-eval==0.2.2 +pure-eval==0.2.3 py-cpuinfo==9.0.0 -pyarrow==16.1.0 +pyarrow==17.0.0 pycparser==2.22 -pydata-sphinx-theme==0.15.3 +pydata-sphinx-theme==0.15.4 pygments==2.18.0 pyparsing==3.1.2 pyproject-api==1.7.1 -pytest==8.2.2 +pytest==8.3.2 pytest-benchmark==4.0.0 pytest-cov==5.0.0 pytest-mock==3.14.0 @@ -163,12 +160,12 @@ python-constraint2==2.0.0b5 python-dateutil==2.9.0.post0 python-json-logger==2.0.7 python-lsp-jsonrpc==1.1.2 -python-lsp-ruff==2.2.1 +python-lsp-ruff==2.2.2 python-lsp-server==1.11.0 pytoolconfig==1.3.1 pytz==2024.1 -pyyaml==6.0.1 -pyzmq==26.0.3 +pyyaml==6.0.2 +pyzmq==26.1.0 qrules==0.10.2 qtconsole==5.5.2 qtpy==2.4.1 @@ -178,69 +175,69 @@ rfc3339-validator==0.1.4 rfc3986-validator==0.1.1 rich==13.7.1 rope==1.13.0 -rpds-py==0.18.1 -ruff==0.4.10 -scipy==1.13.1 +rpds-py==0.20.0 +ruff==0.5.6 +scipy==1.14.0 send2trash==1.8.3 six==1.16.0 smmap==5.0.1 sniffio==1.3.1 snowballstemmer==2.2.0 soupsieve==2.5 -sphinx==7.3.7 +sphinx==8.0.2 sphinx-api-relink==0.0.9 sphinx-autobuild==2024.4.16 sphinx-book-theme==1.1.3 sphinx-codeautolink==0.15.2 sphinx-comments==0.0.3 sphinx-copybutton==0.5.2 -sphinx-design==0.6.0 +sphinx-design==0.6.1 sphinx-thebe==0.3.1 sphinx-togglebutton==0.3.2 -sphinxcontrib-applehelp==1.0.8 -sphinxcontrib-devhelp==1.0.6 -sphinxcontrib-htmlhelp==2.0.5 +sphinxcontrib-applehelp==2.0.0 +sphinxcontrib-devhelp==2.0.0 +sphinxcontrib-htmlhelp==2.1.0 sphinxcontrib-jsmath==1.0.1 -sphinxcontrib-qthelp==1.0.7 -sphinxcontrib-serializinghtml==1.1.10 +sphinxcontrib-qthelp==2.0.0 +sphinxcontrib-serializinghtml==2.0.0 sphobjinv==2.3.1.1 -sqlalchemy==2.0.31 +sqlalchemy==2.0.32 stack-data==0.6.3 -starlette==0.37.2 -sympy==1.12.1 +starlette==0.38.2 +sympy==1.13.1 tabulate==0.9.0 tensorboard==2.16.2 tensorboard-data-server==0.7.2 -tensorflow==2.16.1 +tensorflow==2.16.2 tensorflow-probability==0.24.0 termcolor==2.4.0 terminado==0.18.1 tinycss2==1.3.0 tornado==6.4.1 -tox==4.15.1 -tqdm==4.66.4 +tox==4.17.0 +tqdm==4.66.5 traitlets==5.14.3 -types-protobuf==5.26.0.20240422 +types-protobuf==5.27.0.20240626 types-python-dateutil==2.9.0.20240316 -types-pyyaml==6.0.12.20240311 -types-requests==2.32.0.20240622 -types-tensorflow==2.16.0.20240618 +types-pyyaml==6.0.12.20240724 +types-requests==2.32.0.20240712 +types-tensorflow==2.16.0.20240804 types-tqdm==4.66.0.20240417 typing-extensions==4.12.2 tzdata==2024.1 ujson==5.10.0 uri-template==1.3.0 urllib3==2.2.2 -uvicorn==0.30.1 +uvicorn==0.30.5 virtualenv==20.26.3 -watchfiles==0.22.0 +watchfiles==0.23.0 wcwidth==0.2.13 webcolors==24.6.0 webencodings==0.5.1 websocket-client==1.8.0 websockets==12.0 werkzeug==3.0.3 -wheel==0.43.0 +wheel==0.44.0 widgetsnbextension==4.0.11 wrapt==1.16.0 zipp==3.19.2 diff --git a/.constraints/py3.8.txt b/.constraints/py3.8.txt index cef295bb..dea5cfb8 100644 --- a/.constraints/py3.8.txt +++ b/.constraints/py3.8.txt @@ -11,16 +11,15 @@ arrow==1.3.0 asttokens==2.4.1 astunparse==1.6.3 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 +cachetools==5.4.0 cattrs==23.2.3 -certifi==2024.6.2 -cffi==1.16.0 +certifi==2024.7.4 +cffi==1.17.0 cfgv==3.4.0 chardet==5.2.0 charset-normalizer==3.3.2 @@ -29,58 +28,57 @@ cloudpickle==3.0.0 colorama==0.4.6 comm==0.2.2 contourpy==1.1.1 -coverage==7.5.4 +coverage==7.6.1 cycler==0.12.1 -debugpy==1.8.1 +debugpy==1.8.5 decorator==5.1.1 defusedxml==0.7.1 distlib==0.3.8 dm-tree==0.1.8 docstring-to-markdown==0.15 docutils==0.19 -exceptiongroup==1.2.1 +exceptiongroup==1.2.2 execnet==2.1.1 executing==2.0.1 fastjsonschema==2.20.0 filelock==3.15.4 flatbuffers==24.3.25 -fonttools==4.53.0 +fonttools==4.53.1 fqdn==1.5.1 gast==0.4.0 gitdb==4.0.11 gitpython==3.1.43 -google-auth==2.30.0 +google-auth==2.33.0 google-auth-oauthlib==0.4.6 google-pasta==0.2.0 graphviz==0.20.3 greenlet==3.0.3 -grpcio==1.64.1 +grpcio==1.65.4 h11==0.14.0 h5py==3.11.0 hepunits==2.3.4 httpcore==1.0.5 httpx==0.27.0 -identify==2.5.36 +identify==2.6.0 idna==3.7 imagesize==1.4.1 -iminuit==2.26.0 -importlib-metadata==7.2.1 +iminuit==2.27.0 +importlib-metadata==8.2.0 importlib-resources==6.4.0 iniconfig==2.0.0 -ipykernel==6.29.4 +ipykernel==6.29.5 ipympl==0.9.3 ipython==8.12.3 ipython-genutils==0.2.0 ipywidgets==8.1.3 isoduration==20.11.0 -isort==5.13.2 jax==0.4.13 jaxlib==0.4.13 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==1.0.0 jupyter-cache==0.6.1 @@ -89,16 +87,16 @@ jupyter-console==6.6.3 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-mathjax==0.2.6 jupyter-server-terminals==0.5.3 -jupyterlab==4.2.2 -jupyterlab-code-formatter==2.2.1 +jupyterlab==4.2.4 +jupyterlab-code-formatter==3.0.0 jupyterlab-git==0.50.1 jupyterlab-lsp==5.1.0 jupyterlab-myst==2.4.2 jupyterlab-pygments==0.3.0 -jupyterlab-server==2.27.2 +jupyterlab-server==2.27.3 jupyterlab-widgets==3.0.11 keras==2.11.0 kiwisolver==1.4.5 @@ -116,7 +114,7 @@ mdurl==0.1.2 mistune==3.0.2 ml-dtypes==0.2.0 mpmath==1.3.0 -mypy==1.10.0 +mypy==1.11.1 mypy-extensions==1.0.0 myst-nb==0.17.2 myst-parser==0.18.1 @@ -139,11 +137,10 @@ pandas==2.0.3 pandocfilters==1.5.1 parso==0.8.4 particle==0.24.0 -pathspec==0.12.1 pexpect==4.9.0 phasespace==1.9.0 pickleshare==0.7.5 -pillow==10.3.0 +pillow==10.4.0 pkgutil-resolve-name==1.3.10 platformdirs==4.2.2 pluggy==1.5.0 @@ -153,9 +150,9 @@ prompt-toolkit==3.0.47 protobuf==3.19.6 psutil==6.0.0 ptyprocess==0.7.0 -pure-eval==0.2.2 +pure-eval==0.2.3 py-cpuinfo==9.0.0 -pyarrow==16.1.0 +pyarrow==17.0.0 pyasn1==0.6.0 pyasn1-modules==0.4.0 pycparser==2.22 @@ -163,7 +160,7 @@ pydata-sphinx-theme==0.14.4 pygments==2.18.0 pyparsing==3.1.2 pyproject-api==1.7.1 -pytest==8.2.2 +pytest==8.3.2 pytest-benchmark==4.0.0 pytest-cov==5.0.0 pytest-mock==3.14.0 @@ -172,12 +169,12 @@ python-constraint2==2.0.0b5 python-dateutil==2.9.0.post0 python-json-logger==2.0.7 python-lsp-jsonrpc==1.1.2 -python-lsp-ruff==2.2.1 +python-lsp-ruff==2.2.2 python-lsp-server==1.11.0 pytoolconfig==1.3.1 pytz==2024.1 -pyyaml==6.0.1 -pyzmq==26.0.3 +pyyaml==6.0.2 +pyzmq==26.1.0 qrules==0.10.2 qtconsole==5.5.2 qtpy==2.4.1 @@ -187,9 +184,9 @@ requests-oauthlib==2.0.0 rfc3339-validator==0.1.4 rfc3986-validator==0.1.1 rope==1.13.0 -rpds-py==0.18.1 +rpds-py==0.20.0 rsa==4.9 -ruff==0.4.10 +ruff==0.5.6 scipy==1.10.1 send2trash==1.8.3 six==1.16.0 @@ -214,9 +211,9 @@ sphinxcontrib-jsmath==1.0.1 sphinxcontrib-qthelp==1.0.3 sphinxcontrib-serializinghtml==1.1.5 sphobjinv==2.3.1.1 -sqlalchemy==2.0.31 +sqlalchemy==2.0.32 stack-data==0.6.3 -sympy==1.12.1 +sympy==1.13.1 tabulate==0.9.0 tensorboard==2.11.2 tensorboard-data-server==0.6.1 @@ -230,14 +227,14 @@ terminado==0.18.1 tinycss2==1.3.0 tomli==2.0.1 tornado==6.4.1 -tox==4.15.1 -tqdm==4.66.4 +tox==4.17.0 +tqdm==4.66.5 traitlets==5.14.3 -types-protobuf==5.26.0.20240422 +types-protobuf==5.27.0.20240626 types-python-dateutil==2.9.0.20240316 -types-pyyaml==6.0.12.20240311 -types-requests==2.32.0.20240622 -types-tensorflow==2.16.0.20240618 +types-pyyaml==6.0.12.20240724 +types-requests==2.32.0.20240712 +types-tensorflow==2.16.0.20240804 types-tqdm==4.66.0.20240417 typing-extensions==4.12.2 tzdata==2024.1 @@ -250,7 +247,7 @@ webcolors==24.6.0 webencodings==0.5.1 websocket-client==1.8.0 werkzeug==3.0.3 -wheel==0.43.0 +wheel==0.44.0 widgetsnbextension==4.0.11 wrapt==1.16.0 zipp==3.19.2 diff --git a/.constraints/py3.9.txt b/.constraints/py3.9.txt index eb5909ff..3092e76a 100644 --- a/.constraints/py3.9.txt +++ b/.constraints/py3.9.txt @@ -11,15 +11,14 @@ arrow==1.3.0 asttokens==2.4.1 astunparse==1.6.3 async-lru==2.0.4 -attrs==23.2.0 +attrs==24.2.0 babel==2.15.0 beautifulsoup4==4.12.3 -black==24.4.2 bleach==6.1.0 -cachetools==5.3.3 +cachetools==5.4.0 cattrs==23.2.3 -certifi==2024.6.2 -cffi==1.16.0 +certifi==2024.7.4 +cffi==1.17.0 cfgv==3.4.0 chardet==5.2.0 charset-normalizer==3.3.2 @@ -28,56 +27,55 @@ cloudpickle==3.0.0 colorama==0.4.6 comm==0.2.2 contourpy==1.2.1 -coverage==7.5.4 +coverage==7.6.1 cycler==0.12.1 -debugpy==1.8.1 +debugpy==1.8.5 decorator==5.1.1 defusedxml==0.7.1 distlib==0.3.8 dm-tree==0.1.8 docstring-to-markdown==0.15 docutils==0.21.2 -exceptiongroup==1.2.1 +exceptiongroup==1.2.2 execnet==2.1.1 executing==2.0.1 fastjsonschema==2.20.0 filelock==3.15.4 flatbuffers==24.3.25 -fonttools==4.53.0 +fonttools==4.53.1 fqdn==1.5.1 -gast==0.5.4 +gast==0.6.0 gitdb==4.0.11 gitpython==3.1.43 google-pasta==0.2.0 graphviz==0.20.3 greenlet==3.0.3 -grpcio==1.64.1 +grpcio==1.65.4 h11==0.14.0 h5py==3.11.0 hepunits==2.3.4 httpcore==1.0.5 httpx==0.27.0 -identify==2.5.36 +identify==2.6.0 idna==3.7 imagesize==1.4.1 -iminuit==2.26.0 -importlib-metadata==7.2.1 +iminuit==2.28.0 +importlib-metadata==8.2.0 importlib-resources==6.4.0 iniconfig==2.0.0 -ipykernel==6.29.4 +ipykernel==6.29.5 ipympl==0.9.4 ipython==8.18.1 ipython-genutils==0.2.0 ipywidgets==8.1.3 isoduration==20.11.0 -isort==5.13.2 jax==0.4.30 jaxlib==0.4.30 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==1.0.0 jupyter-cache==1.0.0 @@ -86,18 +84,18 @@ jupyter-console==6.6.3 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-mathjax==0.2.6 jupyter-server-terminals==0.5.3 -jupyterlab==4.2.2 -jupyterlab-code-formatter==2.2.1 +jupyterlab==4.2.4 +jupyterlab-code-formatter==3.0.0 jupyterlab-git==0.50.1 jupyterlab-lsp==5.1.0 jupyterlab-myst==2.4.2 jupyterlab-pygments==0.3.0 -jupyterlab-server==2.27.2 +jupyterlab-server==2.27.3 jupyterlab-widgets==3.0.11 -keras==3.3.3 +keras==3.4.1 kiwisolver==1.4.5 libclang==18.1.1 llvmlite==0.43.0 @@ -105,16 +103,16 @@ lsprotocol==2023.0.1 markdown==3.6 markdown-it-py==3.0.0 markupsafe==2.1.5 -matplotlib==3.9.0 +matplotlib==3.9.1.post1 matplotlib-inline==0.1.7 mdit-py-plugins==0.4.1 mdurl==0.1.2 mistune==3.0.2 ml-dtypes==0.3.2 mpmath==1.3.0 -mypy==1.10.0 +mypy==1.11.1 mypy-extensions==1.0.0 -myst-nb==1.1.0 +myst-nb==1.1.1 myst-parser==3.0.1 namex==0.0.8 nbclient==0.6.8 @@ -129,34 +127,33 @@ notebook-shim==0.2.4 numba==0.60.0 numpy==1.26.4 opt-einsum==3.3.0 -optree==0.11.0 +optree==0.12.1 overrides==7.7.0 packaging==24.1 pandas==2.2.2 pandocfilters==1.5.1 parso==0.8.4 particle==0.24.0 -pathspec==0.12.1 pexpect==4.9.0 phasespace==1.10.3 -pillow==10.3.0 +pillow==10.4.0 platformdirs==4.2.2 pluggy==1.5.0 -pre-commit==3.7.1 +pre-commit==3.8.0 prometheus-client==0.20.0 prompt-toolkit==3.0.47 -protobuf==4.25.3 +protobuf==4.25.4 psutil==6.0.0 ptyprocess==0.7.0 -pure-eval==0.2.2 +pure-eval==0.2.3 py-cpuinfo==9.0.0 -pyarrow==16.1.0 +pyarrow==17.0.0 pycparser==2.22 -pydata-sphinx-theme==0.15.3 +pydata-sphinx-theme==0.15.4 pygments==2.18.0 pyparsing==3.1.2 pyproject-api==1.7.1 -pytest==8.2.2 +pytest==8.3.2 pytest-benchmark==4.0.0 pytest-cov==5.0.0 pytest-mock==3.14.0 @@ -165,12 +162,12 @@ python-constraint2==2.0.0b5 python-dateutil==2.9.0.post0 python-json-logger==2.0.7 python-lsp-jsonrpc==1.1.2 -python-lsp-ruff==2.2.1 +python-lsp-ruff==2.2.2 python-lsp-server==1.11.0 pytoolconfig==1.3.1 pytz==2024.1 -pyyaml==6.0.1 -pyzmq==26.0.3 +pyyaml==6.0.2 +pyzmq==26.1.0 qrules==0.10.2 qtconsole==5.5.2 qtpy==2.4.1 @@ -180,8 +177,8 @@ rfc3339-validator==0.1.4 rfc3986-validator==0.1.1 rich==13.7.1 rope==1.13.0 -rpds-py==0.18.1 -ruff==0.4.10 +rpds-py==0.20.0 +ruff==0.5.6 scipy==1.13.1 send2trash==1.8.3 six==1.16.0 @@ -189,62 +186,62 @@ smmap==5.0.1 sniffio==1.3.1 snowballstemmer==2.2.0 soupsieve==2.5 -sphinx==7.3.7 +sphinx==7.4.7 sphinx-api-relink==0.0.9 sphinx-autobuild==2024.4.16 sphinx-book-theme==1.1.3 sphinx-codeautolink==0.15.2 sphinx-comments==0.0.3 sphinx-copybutton==0.5.2 -sphinx-design==0.6.0 +sphinx-design==0.6.1 sphinx-thebe==0.3.1 sphinx-togglebutton==0.3.2 -sphinxcontrib-applehelp==1.0.8 -sphinxcontrib-devhelp==1.0.6 -sphinxcontrib-htmlhelp==2.0.5 +sphinxcontrib-applehelp==2.0.0 +sphinxcontrib-devhelp==2.0.0 +sphinxcontrib-htmlhelp==2.1.0 sphinxcontrib-jsmath==1.0.1 -sphinxcontrib-qthelp==1.0.7 -sphinxcontrib-serializinghtml==1.1.10 +sphinxcontrib-qthelp==2.0.0 +sphinxcontrib-serializinghtml==2.0.0 sphobjinv==2.3.1.1 -sqlalchemy==2.0.31 +sqlalchemy==2.0.32 stack-data==0.6.3 -starlette==0.37.2 -sympy==1.12.1 +starlette==0.38.2 +sympy==1.13.1 tabulate==0.9.0 tensorboard==2.16.2 tensorboard-data-server==0.7.2 -tensorflow==2.16.1 -tensorflow-io-gcs-filesystem==0.37.0 +tensorflow==2.16.2 +tensorflow-io-gcs-filesystem==0.37.1 tensorflow-probability==0.24.0 termcolor==2.4.0 terminado==0.18.1 tinycss2==1.3.0 tomli==2.0.1 tornado==6.4.1 -tox==4.15.1 -tqdm==4.66.4 +tox==4.17.0 +tqdm==4.66.5 traitlets==5.14.3 -types-protobuf==5.26.0.20240422 +types-protobuf==5.27.0.20240626 types-python-dateutil==2.9.0.20240316 -types-pyyaml==6.0.12.20240311 -types-requests==2.32.0.20240622 -types-tensorflow==2.16.0.20240618 +types-pyyaml==6.0.12.20240724 +types-requests==2.32.0.20240712 +types-tensorflow==2.16.0.20240804 types-tqdm==4.66.0.20240417 typing-extensions==4.12.2 tzdata==2024.1 ujson==5.10.0 uri-template==1.3.0 urllib3==2.2.2 -uvicorn==0.30.1 +uvicorn==0.30.5 virtualenv==20.26.3 -watchfiles==0.22.0 +watchfiles==0.23.0 wcwidth==0.2.13 webcolors==24.6.0 webencodings==0.5.1 websocket-client==1.8.0 websockets==12.0 werkzeug==3.0.3 -wheel==0.43.0 +wheel==0.44.0 widgetsnbextension==4.0.11 wrapt==1.16.0 zipp==3.19.2 diff --git a/.cspell.json b/.cspell.json index 718c43cc..e7428e5b 100644 --- a/.cspell.json +++ b/.cspell.json @@ -38,6 +38,7 @@ "typings" ], "ignoreWords": [ + "FURB", "MAINT", "Nelder", "PYDEVD", diff --git a/.envrc b/.envrc new file mode 100644 index 00000000..cce3aa58 --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +layout anaconda diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f92836d5..01c579f5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -23,8 +23,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 @@ -40,7 +42,7 @@ repos: metadata.vscode - repo: https://github.com/ComPWA/policy - rev: 0.3.9 + rev: 0.3.18 hooks: - id: check-dev-files args: @@ -53,6 +55,7 @@ repos: - --repo-title=TensorWaves - id: colab-toc-visible - id: fix-nbformat-version + - id: remove-empty-tags - id: set-nb-cells args: - --add-install-cell @@ -60,7 +63,7 @@ repos: - --extras-require=doc,jax,pwa,viz - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.4.10 + rev: v0.5.6 hooks: - id: ruff args: [--fix] @@ -113,7 +116,7 @@ repos: - --in-place - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.28.5 + rev: 0.29.1 hooks: - id: check-jsonschema name: Check CITATION.cff @@ -126,7 +129,7 @@ repos: pass_filenames: false - repo: https://github.com/streetsidesoftware/cspell-cli - rev: v8.9.0 + rev: v8.13.1 hooks: - id: cspell @@ -152,6 +155,6 @@ repos: - python - repo: https://github.com/ComPWA/mirrors-pyright - rev: v1.1.368 + rev: v1.1.374 hooks: - id: pyright diff --git a/.vscode/settings.json b/.vscode/settings.json index 96408bc4..5ebd2cf5 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -33,6 +33,9 @@ "cSpell.enabled": true, "diffEditor.experimental.showMoves": true, "editor.formatOnSave": true, + "files.associations": { + "**/.constraints/py*.txt": "pip-requirements" + }, "files.watcherExclude": { "**/*_cache/**": true, "**/.eggs/**": true, @@ -65,6 +68,7 @@ "python.analysis.autoImportCompletions": false, "python.analysis.inlayHints.pytestParameters": true, "python.analysis.typeCheckingMode": "strict", + "python.terminal.activateEnvironment": false, "python.testing.pytestArgs": ["--color=no", "--no-cov"], "python.testing.pytestEnabled": true, "python.testing.unittestEnabled": false, diff --git a/benchmarks/ampform.py b/benchmarks/ampform.py index d7143975..22cdbafe 100644 --- a/benchmarks/ampform.py +++ b/benchmarks/ampform.py @@ -197,8 +197,8 @@ def test_fit(self, backend, benchmark, model, size): def print_data_sample(data: DataSample, sample_size: int) -> None: """Print a `.DataSample`, so it can be pasted into the expected sample.""" - print() # noqa: T201 - pprint({ # noqa: T203 + print() + pprint({ i: np.round(four_momenta[:sample_size], decimals=11).tolist() for i, four_momenta in data.items() }) diff --git a/benchmarks/expression.py b/benchmarks/expression.py index 1964f38d..f65e62ae 100644 --- a/benchmarks/expression.py +++ b/benchmarks/expression.py @@ -114,7 +114,7 @@ def test_data(backend, benchmark, size): def test_fit( backend: str, benchmark, - optimizer_type: type[Minuit2] | type[ScipyMinimizer], + optimizer_type: type[Minuit2 | ScipyMinimizer], size: int, ): domain, data = generate_data_and_domain(backend, n_data=size, n_domain=10 * size) @@ -131,7 +131,7 @@ def test_fit( result = benchmark(optimizer.optimize, estimator, function.parameters) assert pytest.approx(result.estimator_value, rel=1e-2) == original_nll - if optimizer_type not in {ScipyMinimizer}: + if optimizer_type != ScipyMinimizer: assert result.minimum_valid for par in function.parameters: original_value = original_parameters[par] diff --git a/docs/amplitude-analysis.ipynb b/docs/amplitude-analysis.ipynb index 19847fad..cfd701d5 100644 --- a/docs/amplitude-analysis.ipynb +++ b/docs/amplitude-analysis.ipynb @@ -10,9 +10,6 @@ "jupyter": { "source_hidden": true }, - "slideshow": { - "slide_type": "skip" - }, "tags": [ "remove-cell", "skip-execution" @@ -34,9 +31,6 @@ "jupyter": { "source_hidden": true }, - "slideshow": { - "slide_type": "skip" - }, "tags": [ "remove-cell" ] @@ -58,9 +52,7 @@ }, { "cell_type": "markdown", - "metadata": { - "tags": [] - }, + "metadata": {}, "source": [ "# Amplitude analysis" ] @@ -88,13 +80,9 @@ "cell_type": "code", "execution_count": null, "metadata": { - "editable": true, "jupyter": { "source_hidden": true }, - "slideshow": { - "slide_type": "" - }, "tags": [ "remove-cell" ] @@ -107,8 +95,7 @@ { "cell_type": "markdown", "metadata": { - "jp-MarkdownHeadingCollapsed": true, - "tags": [] + "jp-MarkdownHeadingCollapsed": true }, "source": [ "(compwa-step-1)=\n", @@ -207,9 +194,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [] - }, + "metadata": {}, "outputs": [], "source": [ "import ampform\n", @@ -269,9 +254,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [] - }, + "metadata": {}, "outputs": [], "source": [ "from ampform.dynamics.builder import (\n", @@ -349,8 +332,7 @@ { "cell_type": "markdown", "metadata": { - "jp-MarkdownHeadingCollapsed": true, - "tags": [] + "jp-MarkdownHeadingCollapsed": true }, "source": [ "(compwa-step-2)=\n", @@ -503,9 +485,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [] - }, + "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", @@ -517,9 +497,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [] - }, + "metadata": {}, "outputs": [], "source": [ "p.sum(axis=0).round(decimals=14)" @@ -842,8 +820,7 @@ { "cell_type": "markdown", "metadata": { - "jp-MarkdownHeadingCollapsed": true, - "tags": [] + "jp-MarkdownHeadingCollapsed": true }, "source": [ "(compwa-step-3)=\n", @@ -1845,13 +1822,9 @@ "cell_type": "code", "execution_count": null, "metadata": { - "editable": true, "jupyter": { "source_hidden": true }, - "slideshow": { - "slide_type": "" - }, "tags": [ "remove-input" ] @@ -1890,13 +1863,9 @@ "cell_type": "code", "execution_count": null, "metadata": { - "editable": true, "jupyter": { "source_hidden": true }, - "slideshow": { - "slide_type": "" - }, "tags": [ "hide-input" ] diff --git a/docs/amplitude-analysis/analytic-continuation.ipynb b/docs/amplitude-analysis/analytic-continuation.ipynb index 1f5f529f..c649095e 100644 --- a/docs/amplitude-analysis/analytic-continuation.ipynb +++ b/docs/amplitude-analysis/analytic-continuation.ipynb @@ -10,9 +10,6 @@ "jupyter": { "source_hidden": true }, - "slideshow": { - "slide_type": "skip" - }, "tags": [ "remove-cell", "skip-execution" @@ -34,9 +31,6 @@ "jupyter": { "source_hidden": true }, - "slideshow": { - "slide_type": "skip" - }, "tags": [ "remove-cell" ] @@ -106,9 +100,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [] - }, + "metadata": {}, "outputs": [], "source": [ "reaction = qrules.generate_transitions(\n", diff --git a/docs/conf.py b/docs/conf.py index ae25c4bf..8f8a86ba 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -17,8 +17,8 @@ def create_tensorflow_inventory() -> None: if os.path.exists("tensorflow.inv"): return - subprocess.check_call( - ("sphobjinv", "convert", "-o", "zlib", "tensorflow.txt"), # noqa: S603 + subprocess.check_call( # noqa: S603 + ("sphobjinv", "convert", "-o", "zlib", "tensorflow.txt"), ) @@ -53,6 +53,9 @@ def get_tensorflow_url() -> str: BINDER_LINK = ( f"https://mybinder.org/v2/gh/ComPWA/{REPO_NAME}/{BRANCH}?filepath=docs/usage" ) +MATPLOTLIB_VERSION_REMAPPING = { + "matplotlib": {"3.9.1.post1": "3.9.1"}, +} add_module_names = False api_github_repo = f"{ORGANIZATION}/{REPO_NAME}" @@ -200,7 +203,10 @@ def get_tensorflow_url() -> str: "graphviz": ("https://graphviz.readthedocs.io/en/stable", None), "iminuit": ("https://scikit-hep.org/iminuit", None), "jax": ("https://jax.readthedocs.io/en/latest", None), - "matplotlib": (f"https://matplotlib.org/{pin('matplotlib')}", None), + "matplotlib": ( + f"https://matplotlib.org/{pin('matplotlib', MATPLOTLIB_VERSION_REMAPPING)}", + None, + ), "numpy": (f"https://numpy.org/doc/{pin_minor('numpy')}", None), "pandas": (f"https://pandas.pydata.org/pandas-docs/version/{pin('pandas')}", None), "pwa": ("https://pwa.readthedocs.io", None), diff --git a/docs/usage.ipynb b/docs/usage.ipynb index 5d22f6d1..17463de7 100644 --- a/docs/usage.ipynb +++ b/docs/usage.ipynb @@ -10,9 +10,6 @@ "jupyter": { "source_hidden": true }, - "slideshow": { - "slide_type": "skip" - }, "tags": [ "remove-cell", "skip-execution" @@ -34,9 +31,6 @@ "jupyter": { "source_hidden": true }, - "slideshow": { - "slide_type": "skip" - }, "tags": [ "remove-cell" ] @@ -58,9 +52,7 @@ }, { "cell_type": "markdown", - "metadata": { - "tags": [] - }, + "metadata": {}, "source": [ "# General examples" ] @@ -118,9 +110,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [] - }, + "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", @@ -141,9 +131,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [] - }, + "metadata": {}, "outputs": [], "source": [ "import sympy as sp\n", @@ -163,9 +151,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [] - }, + "metadata": {}, "outputs": [], "source": [ "from tensorwaves.function.sympy import create_parametrized_function\n", @@ -338,9 +324,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [] - }, + "metadata": {}, "outputs": [], "source": [ "from tensorwaves.estimator import ChiSquared\n", @@ -439,9 +423,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [] - }, + "metadata": {}, "outputs": [], "source": [ "import sympy as sp\n", @@ -454,9 +436,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [] - }, + "metadata": {}, "outputs": [], "source": [ "from tensorwaves.function.sympy import create_function\n", @@ -495,9 +475,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [] - }, + "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", @@ -537,9 +515,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [] - }, + "metadata": {}, "outputs": [], "source": [ "%timeit -n3 numpy_function(data)\n", @@ -572,9 +548,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [] - }, + "metadata": {}, "outputs": [], "source": [ "import sympy as sp\n", @@ -609,9 +583,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [] - }, + "metadata": {}, "outputs": [], "source": [ "cartesian_to_polar = {\n", @@ -648,9 +620,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [] - }, + "metadata": {}, "outputs": [], "source": [ "from tensorwaves.data import SympyDataTransformer\n", @@ -675,9 +645,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [] - }, + "metadata": {}, "outputs": [], "source": [ "from tensorwaves.data import (\n", @@ -820,9 +788,7 @@ }, { "cell_type": "markdown", - "metadata": { - "tags": [] - }, + "metadata": {}, "source": [ "## Advanced examples" ] @@ -836,9 +802,7 @@ }, { "cell_type": "markdown", - "metadata": { - "tags": [] - }, + "metadata": {}, "source": [ "```{toctree}\n", "---\n", diff --git a/docs/usage/basics.ipynb b/docs/usage/basics.ipynb index 97452502..f22fe7de 100644 --- a/docs/usage/basics.ipynb +++ b/docs/usage/basics.ipynb @@ -10,9 +10,6 @@ "jupyter": { "source_hidden": true }, - "slideshow": { - "slide_type": "skip" - }, "tags": [ "remove-cell", "skip-execution" @@ -34,9 +31,6 @@ "jupyter": { "source_hidden": true }, - "slideshow": { - "slide_type": "skip" - }, "tags": [ "remove-cell" ] @@ -133,9 +127,7 @@ }, { "cell_type": "markdown", - "metadata": { - "tags": [] - }, + "metadata": {}, "source": [ "## Formulate model" ] @@ -150,9 +142,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [] - }, + "metadata": {}, "outputs": [], "source": [ "def gaussian(x: sp.Symbol, mu: sp.Symbol, sigma: sp.Symbol) -> sp.Expr:\n", @@ -220,9 +210,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [] - }, + "metadata": {}, "outputs": [], "source": [ "%config InlineBackend.figure_formats = ['svg']\n", @@ -520,9 +508,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [] - }, + "metadata": {}, "outputs": [], "source": [ "from tensorwaves.data import NumpyDomainGenerator, NumpyUniformRNG\n", @@ -618,9 +604,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [] - }, + "metadata": {}, "outputs": [], "source": [ "from tensorwaves.data import IntensityDistributionGenerator\n", @@ -670,9 +654,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [] - }, + "metadata": {}, "outputs": [], "source": [ "initial_parameters = {\n", @@ -729,9 +711,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [] - }, + "metadata": {}, "outputs": [], "source": [ "estimator = UnbinnedNLL(function_1d, data, domain, backend=\"jax\")" @@ -747,9 +727,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [] - }, + "metadata": {}, "outputs": [], "source": [ "minuit2 = Minuit2(\n", @@ -795,9 +773,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [] - }, + "metadata": {}, "outputs": [], "source": [ "optimized_parameters = fit_result.parameter_values\n", @@ -849,9 +825,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [] - }, + "metadata": {}, "outputs": [], "source": [ "latest_parameters = YAMLSummary.load_latest_parameters(\"fit-result-1D.yaml\")\n", @@ -861,9 +835,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [] - }, + "metadata": {}, "outputs": [], "source": [ "optimizer = Minuit2()\n", @@ -1011,9 +983,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [] - }, + "metadata": {}, "outputs": [], "source": [ "boundaries = {\"x\": (0, 5), \"y\": (-np.pi, +np.pi)}\n", @@ -1065,9 +1035,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [] - }, + "metadata": {}, "outputs": [], "source": [ "initial_parameters = {\n", @@ -1143,9 +1111,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [] - }, + "metadata": {}, "outputs": [], "source": [ "estimator = UnbinnedNLL(function_2d, data_2d, domain_2d, backend=\"jax\")\n", @@ -1187,9 +1153,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [] - }, + "metadata": {}, "outputs": [], "source": [ "scipy = ScipyMinimizer(\n", @@ -1228,9 +1192,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [] - }, + "metadata": {}, "outputs": [], "source": [ "optimized_parameters = fit_result.parameter_values\n", diff --git a/docs/usage/binned-fit.ipynb b/docs/usage/binned-fit.ipynb index 24cb1cd8..999bb463 100644 --- a/docs/usage/binned-fit.ipynb +++ b/docs/usage/binned-fit.ipynb @@ -10,9 +10,6 @@ "jupyter": { "source_hidden": true }, - "slideshow": { - "slide_type": "skip" - }, "tags": [ "remove-cell", "skip-execution" @@ -34,9 +31,6 @@ "jupyter": { "source_hidden": true }, - "slideshow": { - "slide_type": "skip" - }, "tags": [ "remove-cell" ] @@ -73,9 +67,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [] - }, + "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", @@ -101,9 +93,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [] - }, + "metadata": {}, "outputs": [], "source": [ "%config InlineBackend.figure_formats = ['svg']\n", @@ -120,9 +110,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [] - }, + "metadata": {}, "outputs": [], "source": [ "x_values = (bin_edges[1:] + bin_edges[:-1]) / 2\n", @@ -131,9 +119,7 @@ }, { "cell_type": "markdown", - "metadata": { - "tags": [] - }, + "metadata": {}, "source": [ "The data distribution has been generated by {func}`numpy.random.power` and can therefore be described by the following expression:" ] @@ -141,9 +127,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [] - }, + "metadata": {}, "outputs": [], "source": [ "import sympy as sp\n", @@ -163,9 +147,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [] - }, + "metadata": {}, "outputs": [], "source": [ "from tensorwaves.function.sympy import create_parametrized_function\n", @@ -210,9 +192,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [] - }, + "metadata": {}, "outputs": [], "source": [ "from tensorwaves.estimator import ChiSquared\n", @@ -284,9 +264,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [] - }, + "metadata": {}, "outputs": [], "source": [ "bin_width = bin_edges[1] - bin_edges[0]\n", diff --git a/docs/usage/caching.ipynb b/docs/usage/caching.ipynb index 25d94174..e292dc11 100644 --- a/docs/usage/caching.ipynb +++ b/docs/usage/caching.ipynb @@ -10,9 +10,6 @@ "jupyter": { "source_hidden": true }, - "slideshow": { - "slide_type": "skip" - }, "tags": [ "remove-cell", "skip-execution" @@ -34,9 +31,6 @@ "jupyter": { "source_hidden": true }, - "slideshow": { - "slide_type": "skip" - }, "tags": [ "remove-cell" ] @@ -130,9 +124,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [] - }, + "metadata": {}, "outputs": [], "source": [ "from tensorwaves.function.sympy import create_parametrized_function\n", @@ -352,9 +344,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [] - }, + "metadata": {}, "outputs": [], "source": [ "from tensorwaves.estimator import create_cached_function\n", @@ -377,9 +367,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [] - }, + "metadata": {}, "outputs": [], "source": [ "cached_func.parameters" @@ -388,9 +376,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [] - }, + "metadata": {}, "outputs": [], "source": [ "cache_transformer.functions" @@ -456,9 +442,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [] - }, + "metadata": {}, "outputs": [], "source": [ "intensities = original_func(domain)\n", @@ -475,9 +459,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [] - }, + "metadata": {}, "outputs": [], "source": [ "cached_domain = cache_transformer(domain)\n", @@ -521,9 +503,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [] - }, + "metadata": {}, "outputs": [], "source": [ "%timeit -n100 original_func(domain)\n", diff --git a/docs/usage/chi-squared.ipynb b/docs/usage/chi-squared.ipynb index 36c259b0..f56e1dcc 100644 --- a/docs/usage/chi-squared.ipynb +++ b/docs/usage/chi-squared.ipynb @@ -10,9 +10,6 @@ "jupyter": { "source_hidden": true }, - "slideshow": { - "slide_type": "skip" - }, "tags": [ "remove-cell", "skip-execution" @@ -34,9 +31,6 @@ "jupyter": { "source_hidden": true }, - "slideshow": { - "slide_type": "skip" - }, "tags": [ "remove-cell" ] @@ -146,9 +140,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [] - }, + "metadata": {}, "outputs": [], "source": [ "original_parameters = function.parameters\n", diff --git a/docs/usage/faster-lambdify.ipynb b/docs/usage/faster-lambdify.ipynb index 42266d3e..c7e1374c 100644 --- a/docs/usage/faster-lambdify.ipynb +++ b/docs/usage/faster-lambdify.ipynb @@ -10,9 +10,6 @@ "jupyter": { "source_hidden": true }, - "slideshow": { - "slide_type": "skip" - }, "tags": [ "remove-cell", "skip-execution" @@ -34,9 +31,6 @@ "jupyter": { "source_hidden": true }, - "slideshow": { - "slide_type": "skip" - }, "tags": [ "remove-cell" ] @@ -346,9 +340,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [] - }, + "metadata": {}, "outputs": [], "source": [ "%%time\n", diff --git a/docs/usage/unbinned-fit.ipynb b/docs/usage/unbinned-fit.ipynb index d5679fcc..f33956c1 100644 --- a/docs/usage/unbinned-fit.ipynb +++ b/docs/usage/unbinned-fit.ipynb @@ -10,9 +10,6 @@ "jupyter": { "source_hidden": true }, - "slideshow": { - "slide_type": "skip" - }, "tags": [ "remove-cell", "skip-execution" @@ -34,9 +31,6 @@ "jupyter": { "source_hidden": true }, - "slideshow": { - "slide_type": "skip" - }, "tags": [ "remove-cell" ] @@ -73,9 +67,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [] - }, + "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", @@ -162,9 +154,7 @@ }, { "cell_type": "markdown", - "metadata": { - "tags": [] - }, + "metadata": {}, "source": [ "The data distribution has been generated by {func}`numpy.random.normal` and {func}`numpy.random.rayleigh` and can therefore be described by the following expression:" ] @@ -172,9 +162,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [] - }, + "metadata": {}, "outputs": [], "source": [ "import sympy as sp\n", @@ -203,9 +191,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [] - }, + "metadata": {}, "outputs": [], "source": [ "from tensorwaves.function.sympy import create_parametrized_function\n", @@ -266,9 +252,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [] - }, + "metadata": {}, "outputs": [], "source": [ "from tensorwaves.estimator import UnbinnedNLL\n", diff --git a/pyproject.toml b/pyproject.toml index 9bb6623f..e187a371 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -90,10 +90,8 @@ jax = [ "jaxlib", ] jupyter = [ - "black", - "isort", "jupyterlab", - "jupyterlab-code-formatter", + "jupyterlab-code-formatter >=3.0.0", "jupyterlab-git", "jupyterlab-lsp", "jupyterlab-myst", @@ -134,6 +132,7 @@ test = [ "pytest-benchmark", "pytest-cov", "pytest-xdist", + "tensorflow !=2.17.0", # https://github.com/ComPWA/tensorwaves/actions/runs/10274147572/job/28430227465?pr=530 "tensorwaves[test-types]", ] test-types = [ @@ -222,6 +221,10 @@ module = ["phasespace"] ignore_missing_imports = true module = ["scipy.optimize"] +[[tool.mypy.overrides]] +ignore_missing_imports = true +module = ["sympy.*"] + [[tool.mypy.overrides]] ignore_missing_imports = true module = ["tensorflow.python.ops.numpy_ops"] @@ -263,10 +266,12 @@ typeCheckingMode = "strict" addopts = ["--color=yes"] filterwarnings = [ "error", + "ignore: The `hash` argument is deprecated in favor of `unsafe_hash` and will be removed in or after August 2025.:DeprecationWarning", "ignore: `np.bool8` is a deprecated alias for `np.bool_`.*:DeprecationWarning", "ignore:.* is deprecated and will be removed in Pillow 10.*:DeprecationWarning", "ignore:.*Type google\\._upb\\..*This is deprecated.*", "ignore:.*Using or importing the ABCs.*:DeprecationWarning", + "ignore:.*jax.xla_computation is deprecated*:DeprecationWarning", "ignore:.*the imp module is deprecated in favour of importlib.*:DeprecationWarning", "ignore:Passing a schema to Validator.iter_errors is deprecated.*:DeprecationWarning", "ignore:Please use `spmatrix` from the `scipy.sparse` namespace.*:DeprecationWarning", @@ -311,40 +316,11 @@ docstring-code-format = true line-ending = "lf" [tool.ruff.lint] -extend-select = [ - "A", - "B", - "BLE", - "C4", - "C90", - "D", - "EM", - "ERA", - "FA", - "I", - "ICN", - "INP", - "ISC", - "N", - "NPY", - "PGH", - "PIE", - "PL", - "Q", - "RET", - "RSE", - "RUF", - "S", - "SIM", - "T20", - "TCH", - "TID", - "TRY", - "UP", - "YTT", -] ignore = [ + "ANN401", "C408", + "COM812", + "CPY001", "D101", "D102", "D103", @@ -354,23 +330,48 @@ ignore = [ "D213", "D407", "D416", + "DOC", + "DTZ005", "E501", + "FBT00", + "FURB10", + "FURB140", + "G004", "ISC001", "PLW1514", + "PT001", + "PTH", "RUF012", "S307", "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.flake8-self] +ignore-names = [ + "_latex", + "_numpycode", + "_print", +] + [tool.ruff.lint.isort] split-on-trailing-comma = false [tool.ruff.lint.per-file-ignores] "*.ipynb" = [ + "ANN", + "ARG002", "B018", "C90", "D", + "E303", "E402", "E703", "F404", @@ -391,14 +392,21 @@ split-on-trailing-comma = false "F821", ] "benchmarks/*" = [ + "ANN", "D", + "INP001", + "PGH001", "PLC0415", + "PLC2701", "PLR0913", "PLR0917", "PLR2004", "PLR6301", "S101", + "SLF001", + "T20", ] +"callbacks.py" = ["ARG002"] "docs/*" = [ "E402", "INP001", @@ -415,6 +423,8 @@ split-on-trailing-comma = false "src/tensorwaves/function/_backend.py" = ["PLC0415"] "src/tensorwaves/function/sympy/__init__.py" = ["PLC0415"] "tests/*" = [ + "ANN", + "ARG002", "D", "INP001", "PGH001", @@ -426,6 +436,7 @@ split-on-trailing-comma = false "PLR2004", "PLR6301", "S101", + "SLF001", "T20", ] diff --git a/src/tensorwaves/data/_data_sample.py b/src/tensorwaves/data/_data_sample.py index d524e7fa..486fac78 100644 --- a/src/tensorwaves/data/_data_sample.py +++ b/src/tensorwaves/data/_data_sample.py @@ -2,6 +2,7 @@ from __future__ import annotations +import operator from typing import TYPE_CHECKING, Any, Callable import numpy as np @@ -27,7 +28,7 @@ def _determine_merge_method( sample: DataSample, ) -> Callable[[tuple[np.ndarray, np.ndarray]], np.ndarray]: if len(sample) == 0: - return lambda sample_tuple: sample_tuple[1] + return operator.itemgetter(1) some_array = next(iter(sample.values())) rank = len(some_array.shape) if rank == 1: diff --git a/src/tensorwaves/data/rng.py b/src/tensorwaves/data/rng.py index a85b9bc3..06f80675 100644 --- a/src/tensorwaves/data/rng.py +++ b/src/tensorwaves/data/rng.py @@ -18,7 +18,7 @@ class NumpyUniformRNG(RealNumberGenerator): """Implements a uniform real random number generator using `numpy`.""" - def __init__(self, seed: float | None = None): + def __init__(self, seed: float | None = None) -> None: self.seed = seed def __call__( @@ -45,7 +45,7 @@ def seed(self, value: float | None) -> None: class TFUniformRealNumberGenerator(RealNumberGenerator): """Implements a uniform real random number generator using tensorflow.""" - def __init__(self, seed: float | None = None): + def __init__(self, seed: float | None = None) -> None: try: from tensorflow import float64 # noqa: PLC0415 except ImportError: # pragma: no cover diff --git a/src/tensorwaves/estimator.py b/src/tensorwaves/estimator.py index 5fe371c8..51af0ca1 100644 --- a/src/tensorwaves/estimator.py +++ b/src/tensorwaves/estimator.py @@ -86,7 +86,7 @@ def gradient_creator( return jax.grad(function) def raise_gradient_not_implemented( - parameters: Mapping[str, ParameterValue], + parameters: Mapping[str, ParameterValue], # noqa: ARG001 ) -> dict[str, ParameterValue]: msg = f"Gradient not implemented for back-end {backend}." raise NotImplementedError(msg) @@ -116,7 +116,7 @@ class ChiSquared(Estimator): .. seealso:: :doc:`/usage/chi-squared` """ - def __init__( # noqa: PLR0913 + def __init__( self, function: ParametrizedFunction[DataSample, np.ndarray], domain: DataSample, @@ -183,7 +183,7 @@ class UnbinnedNLL(Estimator): .. seealso:: :doc:`/usage/unbinned-fit` """ - def __init__( # noqa: PLR0913 + def __init__( self, function: ParametrizedFunction[DataSample, np.ndarray], data: DataSample, diff --git a/src/tensorwaves/function/sympy/__init__.py b/src/tensorwaves/function/sympy/__init__.py index f351def2..8e706d31 100644 --- a/src/tensorwaves/function/sympy/__init__.py +++ b/src/tensorwaves/function/sympy/__init__.py @@ -468,7 +468,7 @@ def prepare_caching( transformer_expressions[symbol] = sub_expr undefined_variables.update(variables - _get_free_symbols(sub_expr)) for symbol in undefined_variables: - transformer_expressions[symbol] = symbol + transformer_expressions[symbol] = symbol # noqa: PERF403 return cache_expression, transformer_expressions diff --git a/src/tensorwaves/function/sympy/_printer.py b/src/tensorwaves/function/sympy/_printer.py index c2ced124..8963c1c6 100644 --- a/src/tensorwaves/function/sympy/_printer.py +++ b/src/tensorwaves/function/sympy/_printer.py @@ -23,8 +23,8 @@ def __init__(self) -> None: "allow_unknown_functions": True, } ) - self._kc = _replace_module(NumPyPrinter._kc, "numpy", self._module) - self._kf = _replace_module(NumPyPrinter._kf, "numpy", self._module) + self._kc = _replace_module(NumPyPrinter._kc, "numpy", self._module) # noqa: SLF001 + self._kf = _replace_module(NumPyPrinter._kf, "numpy", self._module) # noqa: SLF001 self.printmethod = "_numpycode" # force using _numpycode methods diff --git a/src/tensorwaves/interface.py b/src/tensorwaves/interface.py index 9f13ce4e..4732de58 100644 --- a/src/tensorwaves/interface.py +++ b/src/tensorwaves/interface.py @@ -142,7 +142,7 @@ def _repr_pretty_(self, p: PrettyPrinter, cycle: bool) -> None: else: with p.group(indent=1, open=f"{class_name}("): for attribute in attrs.fields(type(self)): # type: ignore[misc] - if attribute.name in {"specifics"}: + if attribute.name == "specifics": continue value = getattr(self, attribute.name) if value != attribute.default: diff --git a/src/tensorwaves/optimizer/scipy.py b/src/tensorwaves/optimizer/scipy.py index c3e2f750..76c28ecd 100644 --- a/src/tensorwaves/optimizer/scipy.py +++ b/src/tensorwaves/optimizer/scipy.py @@ -80,8 +80,7 @@ def create_parameter_dict( ) def wrapped_function(pars: list) -> float: - nonlocal n_function_calls - nonlocal estimator_value + nonlocal n_function_calls, estimator_value n_function_calls += 1 update_parameters(pars) parameters = parameter_handler.unflatten(flattened_parameters) diff --git a/tests/function/test_function.py b/tests/function/test_function.py index a6f79d3f..e784936a 100644 --- a/tests/function/test_function.py +++ b/tests/function/test_function.py @@ -117,7 +117,7 @@ def test_variadic_args(self): def test_get_source_code(): - def inline_function(a, x): + def inline_function(a, x): # noqa: FURB118 return a * x function = PositionalArgumentFunction( @@ -126,7 +126,7 @@ def inline_function(a, x): ) src = get_source_code(function) expected_src = """ - def inline_function(a, x): + def inline_function(a, x): # noqa: FURB118 return a * x """ assert dedent(src).strip() == dedent(expected_src).strip() diff --git a/tests/optimizer/test_fit_simple_model.py b/tests/optimizer/test_fit_simple_model.py index 52e8f79a..680a1046 100644 --- a/tests/optimizer/test_fit_simple_model.py +++ b/tests/optimizer/test_fit_simple_model.py @@ -116,7 +116,7 @@ def test_optimize_all_parameters( backend: str, domain_and_data_sample: tuple[DataSample, DataSample], expression_and_parameters: tuple[sp.Expr, dict[sp.Symbol, float]], - optimizer_type: type[Minuit2] | type[ScipyMinimizer], + optimizer_type: type[Minuit2 | ScipyMinimizer], output_dir: Path, ): domain, data = domain_and_data_sample @@ -157,7 +157,7 @@ def test_optimize_all_parameters( assert pytest.approx(yaml[par]) == result.parameter_values[par] assert pytest.approx(result.estimator_value, rel=5e-3) == original_nll - if optimizer_type not in {ScipyMinimizer}: + if optimizer_type != ScipyMinimizer: assert result.minimum_valid for par in function.parameters: original_value = original_parameters[par] diff --git a/tests/test_interface.py b/tests/test_interface.py index 74869737..0ed1bafc 100644 --- a/tests/test_interface.py +++ b/tests/test_interface.py @@ -1,3 +1,5 @@ +import math + import pytest from IPython.lib.pretty import pretty @@ -13,7 +15,7 @@ def fit_result(self) -> FitResult: function_calls=50, estimator_value=-2e4, parameter_values={ - R"\pi": 3.14, + R"\pi": math.pi, "a": -5.0, "complex": 1 + 1j, },