-
Notifications
You must be signed in to change notification settings - Fork 79
Description
Describe the bug
Python 3.12 started emitting DeprecationWarning for invalid escape sequences in string literals, and Python 3.13 upgraded those to SyntaxWarning. The filterpy package has a docstring in helpers.py line 367 containing:
P = \Sum {A[i] B[i].T} for i in 0..N
That \S is not a valid Python escape sequence (like \n, \t, etc.), but it was silently ignored in Python ≤3.11. Since our default environment uses Python 3.13, it now triggers a SyntaxWarning at import time.
The filterpy package is unmaintained (last release was 2018), so the fix won't come from upstream.
Full error message and traceback
This is a compile-time warning — it's emitted when Python compiles the .py source file to bytecode (.pyc). On local Windows machine, filterpy was already compiled to .pyc during a prior import (e.g., when pip/pixi installed it, or during a previous notebook run). Since the cached .pyc exists, Python skips recompilation on subsequent imports and the warning is never re-emitted. That's why local saved notebook output doesn't include it.
To Reproduce
Run Github nbval Workflow and remove [regex3] and [regex4] sanitation rules.
Expected behavior
No SyntaxWarning.
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
The soiling module uses filterpy for Kalman filtering; could switch to a maintained alternative like simdkalman or inline the needed logic
Commit 98907c1 tries to sanitize the Warning from the notebooks.