From 19c1278ae0fcd742140693e9ff8f9c415faf5f20 Mon Sep 17 00:00:00 2001 From: GitHub Date: Sat, 2 Dec 2023 20:36:16 +0000 Subject: [PATCH 1/5] MAINT: update pip constraints and pre-commit --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fbd23936..e428b1e9 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -42,7 +42,7 @@ repos: - id: trailing-whitespace - repo: https://github.com/ComPWA/repo-maintenance - rev: 0.1.5 + rev: 0.1.6 hooks: - id: check-dev-files args: From e1b1e1ab550ae4404c491dd49cc9456d9ef2c05b Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sat, 2 Dec 2023 20:37:33 +0000 Subject: [PATCH 2/5] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .pre-commit-config.yaml | 21 ++------------------- pyproject.toml | 36 +++++++++++++++++++++--------------- 2 files changed, 23 insertions(+), 34 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e428b1e9..16802806 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -60,16 +60,6 @@ repos: - --additional-packages=IPython - --extras-require=doc,jax,pwa,viz - - repo: https://github.com/nbQA-dev/nbQA - rev: 1.7.1 - hooks: - - id: nbqa-pyupgrade - args: - - --py38-plus - - id: nbqa-ruff - args: - - --fix - - repo: https://github.com/psf/black-pre-commit-mirror rev: 23.11.0 hooks: @@ -157,19 +147,12 @@ repos: hooks: - id: pyright - - repo: https://github.com/asottile/pyupgrade - rev: v3.15.0 - hooks: - - id: pyupgrade - args: - - --py38-plus - - repo: https://github.com/astral-sh/ruff-pre-commit rev: v0.1.6 hooks: - id: ruff - args: - - --fix + args: [--fix] + types_or: [python, pyi, jupyter] - repo: https://github.com/ComPWA/mirrors-taplo rev: v0.8.1 diff --git a/pyproject.toml b/pyproject.toml index 96b3d857..6d8b731c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -92,10 +92,13 @@ jax = [ "jaxlib", ] jupyter = [ + "isort", "jupyterlab", "jupyterlab-code-formatter", + "jupyterlab-git", "jupyterlab-lsp", "jupyterlab-myst", + "python-lsp-ruff", "python-lsp-server[rope]", "tensorwaves[doc]", ] @@ -263,21 +266,6 @@ module = ["tensorflow.*"] ignore_missing_imports = true module = ["tqdm.*"] -[tool.nbqa.addopts] -ruff = [ - "--extend-ignore=B018", - "--extend-ignore=C90", - "--extend-ignore=D", - "--extend-ignore=N806", - "--extend-ignore=N816", - "--extend-ignore=PLR09", - "--extend-ignore=PLR2004", - "--extend-ignore=PLW0602", - "--extend-ignore=PLW0603", - "--extend-ignore=S301", - "--line-length=85", -] - [tool.pyright] exclude = [ "**/.git", @@ -340,6 +328,7 @@ testpaths = [ [tool.ruff] extend-exclude = ["typings"] +extend-include = ["*.ipynb"] extend-select = [ "A", "B", @@ -397,6 +386,23 @@ target-version = "py38" task-tags = ["cspell"] [tool.ruff.per-file-ignores] +"*.ipynb" = [ + "B018", + "C90", + "D", + "E402", + "E703", + "N806", + "N816", + "PLR09", + "PLR2004", + "PLW0602", + "PLW0603", + "S101", + "S301", + "T201", + "TCH00", +] "benchmarks/*" = [ "D", "PLR0913", From 22f685531facd091f515e633dbd4684250bb60f1 Mon Sep 17 00:00:00 2001 From: GitHub Date: Sat, 2 Dec 2023 20:42:59 +0000 Subject: [PATCH 3/5] MAINT: update pip constraints and pre-commit --- .constraints/py3.10.txt | 10 ++++++++++ .constraints/py3.11.txt | 10 ++++++++++ .constraints/py3.8.txt | 10 ++++++++++ .constraints/py3.9.txt | 10 ++++++++++ 4 files changed, 40 insertions(+) diff --git a/.constraints/py3.10.txt b/.constraints/py3.10.txt index a8b1ca65..45ac36d4 100644 --- a/.constraints/py3.10.txt +++ b/.constraints/py3.10.txt @@ -21,6 +21,7 @@ beautifulsoup4==4.12.2 black==23.11.0 bleach==6.1.0 cachetools==5.3.2 +cattrs==23.2.3 certifi==2023.11.17 cffi==1.16.0 cfgv==3.4.0 @@ -49,6 +50,8 @@ flatbuffers==23.5.26 fonttools==4.46.0 fqdn==1.5.1 gast==0.5.4 +gitdb==4.0.11 +gitpython==3.1.40 google-auth==2.24.0 google-auth-oauthlib==1.1.0 google-pasta==0.2.0 @@ -69,6 +72,7 @@ ipython==8.18.1 ipython-genutils==0.2.0 ipywidgets==8.1.1 isoduration==20.11.0 +isort==5.12.0 jax==0.4.20 jaxlib==0.4.20 jedi==0.19.1 @@ -85,9 +89,11 @@ jupyter-core==5.5.0 jupyter-events==0.9.0 jupyter-lsp==2.2.1 jupyter-server==2.11.1 +jupyter-server-mathjax==0.2.6 jupyter-server-terminals==0.4.4 jupyterlab==4.0.9 jupyterlab-code-formatter==2.2.1 +jupyterlab-git==0.50.0 jupyterlab-lsp==5.0.1 jupyterlab-myst==2.1.0 jupyterlab-pygments==0.3.0 @@ -98,6 +104,7 @@ kiwisolver==1.4.5 libclang==16.0.6 livereload==2.6.3 llvmlite==0.41.1 +lsprotocol==2023.0.0 markdown==3.5.1 markdown-it-py==3.0.0 markupsafe==2.1.3 @@ -114,6 +121,7 @@ myst-nb==1.0.0 myst-parser==2.0.0 nbclient==0.6.8 nbconvert==7.11.0 +nbdime==4.0.1 nbformat==5.9.2 nbmake==1.4.6 nest-asyncio==1.5.8 @@ -160,6 +168,7 @@ python-constraint==1.4.0 python-dateutil==2.8.2 python-json-logger==2.0.7 python-lsp-jsonrpc==1.1.2 +python-lsp-ruff==2.0.0 python-lsp-server==1.9.0 pytoolconfig==1.2.6 pytz==2023.3.post1 @@ -180,6 +189,7 @@ ruff==0.1.6 scipy==1.11.4 send2trash==1.8.2 six==1.16.0 +smmap==5.0.1 sniffio==1.3.0 snowballstemmer==2.2.0 soupsieve==2.5 diff --git a/.constraints/py3.11.txt b/.constraints/py3.11.txt index e8903e91..3a4ecb82 100644 --- a/.constraints/py3.11.txt +++ b/.constraints/py3.11.txt @@ -21,6 +21,7 @@ beautifulsoup4==4.12.2 black==23.11.0 bleach==6.1.0 cachetools==5.3.2 +cattrs==23.2.3 certifi==2023.11.17 cffi==1.16.0 cfgv==3.4.0 @@ -48,6 +49,8 @@ flatbuffers==23.5.26 fonttools==4.46.0 fqdn==1.5.1 gast==0.5.4 +gitdb==4.0.11 +gitpython==3.1.40 google-auth==2.24.0 google-auth-oauthlib==1.1.0 google-pasta==0.2.0 @@ -68,6 +71,7 @@ ipython==8.18.1 ipython-genutils==0.2.0 ipywidgets==8.1.1 isoduration==20.11.0 +isort==5.12.0 jax==0.4.20 jaxlib==0.4.20 jedi==0.19.1 @@ -84,9 +88,11 @@ jupyter-core==5.5.0 jupyter-events==0.9.0 jupyter-lsp==2.2.1 jupyter-server==2.11.1 +jupyter-server-mathjax==0.2.6 jupyter-server-terminals==0.4.4 jupyterlab==4.0.9 jupyterlab-code-formatter==2.2.1 +jupyterlab-git==0.50.0 jupyterlab-lsp==5.0.1 jupyterlab-myst==2.1.0 jupyterlab-pygments==0.3.0 @@ -97,6 +103,7 @@ kiwisolver==1.4.5 libclang==16.0.6 livereload==2.6.3 llvmlite==0.41.1 +lsprotocol==2023.0.0 markdown==3.5.1 markdown-it-py==3.0.0 markupsafe==2.1.3 @@ -113,6 +120,7 @@ myst-nb==1.0.0 myst-parser==2.0.0 nbclient==0.6.8 nbconvert==7.11.0 +nbdime==4.0.1 nbformat==5.9.2 nbmake==1.4.6 nest-asyncio==1.5.8 @@ -159,6 +167,7 @@ python-constraint==1.4.0 python-dateutil==2.8.2 python-json-logger==2.0.7 python-lsp-jsonrpc==1.1.2 +python-lsp-ruff==2.0.0 python-lsp-server==1.9.0 pytoolconfig==1.2.6 pytz==2023.3.post1 @@ -179,6 +188,7 @@ ruff==0.1.6 scipy==1.11.4 send2trash==1.8.2 six==1.16.0 +smmap==5.0.1 sniffio==1.3.0 snowballstemmer==2.2.0 soupsieve==2.5 diff --git a/.constraints/py3.8.txt b/.constraints/py3.8.txt index 37ccca6c..68ac224b 100644 --- a/.constraints/py3.8.txt +++ b/.constraints/py3.8.txt @@ -22,6 +22,7 @@ beautifulsoup4==4.12.2 black==23.11.0 bleach==6.1.0 cachetools==5.3.2 +cattrs==23.2.3 certifi==2023.11.17 cffi==1.16.0 cfgv==3.4.0 @@ -50,6 +51,8 @@ flatbuffers==23.5.26 fonttools==4.46.0 fqdn==1.5.1 gast==0.4.0 +gitdb==4.0.11 +gitpython==3.1.40 google-auth==2.24.0 google-auth-oauthlib==1.0.0 google-pasta==0.2.0 @@ -71,6 +74,7 @@ ipython==8.12.3 ipython-genutils==0.2.0 ipywidgets==8.1.1 isoduration==20.11.0 +isort==5.12.0 jax==0.4.13 jaxlib==0.4.13 jedi==0.19.1 @@ -87,9 +91,11 @@ jupyter-core==5.5.0 jupyter-events==0.9.0 jupyter-lsp==2.2.1 jupyter-server==2.11.1 +jupyter-server-mathjax==0.2.6 jupyter-server-terminals==0.4.4 jupyterlab==4.0.9 jupyterlab-code-formatter==2.2.1 +jupyterlab-git==0.50.0 jupyterlab-lsp==5.0.1 jupyterlab-myst==2.1.0 jupyterlab-pygments==0.3.0 @@ -100,6 +106,7 @@ kiwisolver==1.4.5 libclang==16.0.6 livereload==2.6.3 llvmlite==0.41.1 +lsprotocol==2023.0.0 markdown==3.5.1 markdown-it-py==2.2.0 markupsafe==2.1.3 @@ -116,6 +123,7 @@ myst-nb==0.17.2 myst-parser==0.18.1 nbclient==0.6.8 nbconvert==7.11.0 +nbdime==4.0.1 nbformat==5.9.2 nbmake==1.4.6 nest-asyncio==1.5.8 @@ -164,6 +172,7 @@ python-constraint==1.4.0 python-dateutil==2.8.2 python-json-logger==2.0.7 python-lsp-jsonrpc==1.1.2 +python-lsp-ruff==2.0.0 python-lsp-server==1.9.0 pytoolconfig==1.2.6 pytz==2023.3.post1 @@ -184,6 +193,7 @@ ruff==0.1.6 scipy==1.10.1 send2trash==1.8.2 six==1.16.0 +smmap==5.0.1 sniffio==1.3.0 snowballstemmer==2.2.0 soupsieve==2.5 diff --git a/.constraints/py3.9.txt b/.constraints/py3.9.txt index 21320246..aff3e03f 100644 --- a/.constraints/py3.9.txt +++ b/.constraints/py3.9.txt @@ -21,6 +21,7 @@ beautifulsoup4==4.12.2 black==23.11.0 bleach==6.1.0 cachetools==5.3.2 +cattrs==23.2.3 certifi==2023.11.17 cffi==1.16.0 cfgv==3.4.0 @@ -49,6 +50,8 @@ flatbuffers==23.5.26 fonttools==4.46.0 fqdn==1.5.1 gast==0.5.4 +gitdb==4.0.11 +gitpython==3.1.40 google-auth==2.24.0 google-auth-oauthlib==1.1.0 google-pasta==0.2.0 @@ -70,6 +73,7 @@ ipython==8.18.1 ipython-genutils==0.2.0 ipywidgets==8.1.1 isoduration==20.11.0 +isort==5.12.0 jax==0.4.20 jaxlib==0.4.20 jedi==0.19.1 @@ -86,9 +90,11 @@ jupyter-core==5.5.0 jupyter-events==0.9.0 jupyter-lsp==2.2.1 jupyter-server==2.11.1 +jupyter-server-mathjax==0.2.6 jupyter-server-terminals==0.4.4 jupyterlab==4.0.9 jupyterlab-code-formatter==2.2.1 +jupyterlab-git==0.50.0 jupyterlab-lsp==5.0.1 jupyterlab-myst==2.1.0 jupyterlab-pygments==0.3.0 @@ -99,6 +105,7 @@ kiwisolver==1.4.5 libclang==16.0.6 livereload==2.6.3 llvmlite==0.41.1 +lsprotocol==2023.0.0 markdown==3.5.1 markdown-it-py==3.0.0 markupsafe==2.1.3 @@ -115,6 +122,7 @@ myst-nb==1.0.0 myst-parser==2.0.0 nbclient==0.6.8 nbconvert==7.11.0 +nbdime==4.0.1 nbformat==5.9.2 nbmake==1.4.6 nest-asyncio==1.5.8 @@ -161,6 +169,7 @@ python-constraint==1.4.0 python-dateutil==2.8.2 python-json-logger==2.0.7 python-lsp-jsonrpc==1.1.2 +python-lsp-ruff==2.0.0 python-lsp-server==1.9.0 pytoolconfig==1.2.6 pytz==2023.3.post1 @@ -181,6 +190,7 @@ ruff==0.1.6 scipy==1.11.4 send2trash==1.8.2 six==1.16.0 +smmap==5.0.1 sniffio==1.3.0 snowballstemmer==2.2.0 soupsieve==2.5 From b0778cb5312b8a07cdc8f61ec465215c47dca33c Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sat, 2 Dec 2023 20:43:19 +0000 Subject: [PATCH 4/5] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- docs/usage/faster-lambdify.ipynb | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/usage/faster-lambdify.ipynb b/docs/usage/faster-lambdify.ipynb index 403308d0..cbc9e1ab 100644 --- a/docs/usage/faster-lambdify.ipynb +++ b/docs/usage/faster-lambdify.ipynb @@ -86,8 +86,6 @@ "from IPython.display import HTML, SVG\n", "\n", "from tensorwaves.function.sympy import (\n", - " create_parametrized_function,\n", - " fast_lambdify,\n", " split_expression,\n", ")\n", "\n", From d6e9bba85beeb86270e9784332109cec7cb272a7 Mon Sep 17 00:00:00 2001 From: Remco de Boer <29308176+redeboer@users.noreply.github.com> Date: Sat, 2 Dec 2023 22:04:52 +0100 Subject: [PATCH 5/5] FIX: address cell magic problem with Ruff --- docs/usage/faster-lambdify.ipynb | 2 ++ pyproject.toml | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/docs/usage/faster-lambdify.ipynb b/docs/usage/faster-lambdify.ipynb index cbc9e1ab..403308d0 100644 --- a/docs/usage/faster-lambdify.ipynb +++ b/docs/usage/faster-lambdify.ipynb @@ -86,6 +86,8 @@ "from IPython.display import HTML, SVG\n", "\n", "from tensorwaves.function.sympy import (\n", + " create_parametrized_function,\n", + " fast_lambdify,\n", " split_expression,\n", ")\n", "\n", diff --git a/pyproject.toml b/pyproject.toml index 6d8b731c..3fc26d06 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -403,6 +403,10 @@ task-tags = ["cspell"] "T201", "TCH00", ] +"*docs/usage/faster-lambdify.ipynb" = [ + "F401", + "F821", +] "benchmarks/*" = [ "D", "PLR0913",