Skip to content

Commit 07439f1

Browse files
adeebshihadehclaude
andcommitted
Fix mypy: add explicit ndarray type annotations for class attributes
mypy infers different ndarray shape types for np.zeros(0) vs np.array([...]), causing type mismatch errors in subclasses. Explicit np.ndarray annotations make the types compatible. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 67392de commit 07439f1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

rednose/helpers/kalmanfilter.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55

66
class KalmanFilter:
77
name = "<name>"
8-
initial_x = np.zeros(0)
9-
initial_P_diag = np.zeros(0)
10-
Q = np.zeros((0, 0))
8+
initial_x: np.ndarray = np.zeros(0)
9+
initial_P_diag: np.ndarray = np.zeros(0)
10+
Q: np.ndarray = np.zeros((0, 0))
1111
obs_noise: dict[int, Any] = {}
1212

1313
# Should be initialized when initializating a KalmanFilter implementation

0 commit comments

Comments
 (0)