From 2cb4d0f7ea20d83b96ea88db1a1164d05fd76e68 Mon Sep 17 00:00:00 2001 From: Wessel Bruinsma Date: Thu, 19 Feb 2026 14:53:27 +0100 Subject: [PATCH 1/5] Force `_jax_tensor` to be faithful --- lab/types.py | 1 + lab/util.py | 4 +--- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/lab/types.py b/lab/types.py index 5c5232b..7c75524 100644 --- a/lab/types.py +++ b/lab/types.py @@ -103,6 +103,7 @@ def _jax_version(): "jaxlib._jax", "ArrayImpl", condition=lambda: _jax_version() >= (0, 6, 0), + faithful=True, ), ] _jax_tracer = ModuleType("jax.core", "Tracer") diff --git a/lab/util.py b/lab/util.py index 7622435..b88b9f1 100644 --- a/lab/util.py +++ b/lab/util.py @@ -2,8 +2,6 @@ import numpy as np import plum -import plum.signature -import plum.type from . import B @@ -210,7 +208,7 @@ def wrapper(*args, **kw_args): # means that an implementation is not available. types_after = tuple(type(arg) for arg in args) if types_before == types_after: - signature = plum.signature.Signature(*types_after) + signature = plum.Signature(*types_after) raise plum.NotFoundLookupError(f.__name__, signature, []) # Retry call. From 7a57c13acb22f89963f7c7a61854548c546eb4d2 Mon Sep 17 00:00:00 2001 From: Wessel Bruinsma Date: Fri, 20 Feb 2026 09:50:19 +0100 Subject: [PATCH 2/5] Upgrade Plum version --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index d45f4fd..82b334d 100755 --- a/setup.py +++ b/setup.py @@ -112,7 +112,7 @@ requirements = [ "numpy>=1.16", "scipy>=1.3", - "plum-dispatch>=2.6.0", + "plum-dispatch>=2.7.1", "opt-einsum", ] From 73f268e97bcf8d740f892fc291507d646fd9b0ae Mon Sep 17 00:00:00 2001 From: Wessel Bruinsma Date: Sat, 21 Feb 2026 10:31:23 +0100 Subject: [PATCH 3/5] Drop Python 3.9 --- .github/workflows/ci.yml | 3 +-- setup.py | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4a0664a..d88b18d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.9, "3.10", "3.11", "3.12"] + python-version: ["3.10", "3.11", "3.12", "3.13"] steps: - uses: actions/checkout@v2 with: @@ -21,7 +21,6 @@ jobs: - name: Install dependencies run: | sudo apt-get install gfortran - # JAX isn't yet NumPy 2 compatible. pip install --upgrade pip setuptools 'setuptools_scm[toml]' setuptools_scm_git_archive numpy Cython python setup.py --version LAB_BUILD=1 pip install --no-cache-dir -U -r requirements.txt | cat diff --git a/setup.py b/setup.py index 82b334d..8d52a6d 100755 --- a/setup.py +++ b/setup.py @@ -118,7 +118,7 @@ setup( packages=find_packages(exclude=["docs"]), - python_requires=">=3.9", + python_requires=">=3.10", install_requires=requirements, cmdclass={"build_ext": build_ext}, ext_modules=ext_modules, From c58bfbc3f9a88edce582ee0624ada7eb10f28497 Mon Sep 17 00:00:00 2001 From: Wessel Bruinsma Date: Sat, 21 Feb 2026 10:38:07 +0100 Subject: [PATCH 4/5] Fix import --- tests/test_types.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/test_types.py b/tests/test_types.py index 9f4e12a..8c531b1 100644 --- a/tests/test_types.py +++ b/tests/test_types.py @@ -5,13 +5,12 @@ import tensorflow as tf import torch from autograd import grad -from plum import isinstance -from plum.promotion import _promotion_rule, convert +from plum import convert, isinstance +from plum._promotion import _promotion_rule import lab as B -# noinspection PyUnresolvedReferences -from .util import autograd_box, check_lazy_shapes +from .util import autograd_box, check_lazy_shapes # noqa: F401 def test_numeric(check_lazy_shapes): From 1b8fba62adb1c57c0da3d49e2986fa641a672bed Mon Sep 17 00:00:00 2001 From: Wessel Bruinsma Date: Sat, 21 Feb 2026 10:49:02 +0100 Subject: [PATCH 5/5] Fix instantiation of `NotFoundLookupError` --- lab/util.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lab/util.py b/lab/util.py index b88b9f1..a605e38 100644 --- a/lab/util.py +++ b/lab/util.py @@ -2,6 +2,7 @@ import numpy as np import plum +from plum._method import MethodList from . import B @@ -209,7 +210,7 @@ def wrapper(*args, **kw_args): types_after = tuple(type(arg) for arg in args) if types_before == types_after: signature = plum.Signature(*types_after) - raise plum.NotFoundLookupError(f.__name__, signature, []) + raise plum.NotFoundLookupError(f.__name__, signature, MethodList()) # Retry call. return getattr(B, f.__name__)(*args, **kw_args)