NatLabRockies / NatLabRockies/rdtools

Replace filterpy package

Open
#496 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
189
Forks
82
PR merge metrics
No merged PRs in 30d

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 98907c1a44db5a879edf800c8fc94d897c124ef6 tries to sanitize the Warning from the notebooks.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by inspecting the soiling module's use of filterpy and the GitHub nbval workflow under Python 3.13. Review commit 98907c1a44db5a879edf800c8fc94d897c124ef2 to understand the existing regex3 and regex4 sanitation, then determine the required replacement or inline logic. Done means the sanitation rules can be removed and the workflow completes without a SyntaxWarning.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.