Skip to content

Commit ea79a8e

Browse files
author
mahdi
committed
Resolve #18: enforcing all static checks for pytests in tests/**
1 parent 0d3dc09 commit ea79a8e

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@ skip-magic-trailing-comma = false
5050
line-ending = "auto"
5151

5252
[tool.mypy]
53-
mypy_path = "pyssp"
53+
mypy_path = "."
5454
ignore_missing_imports = true
5555
disallow_incomplete_defs = true
5656
disallow_untyped_calls = true
5757
disallow_untyped_defs = true
5858
disallow_untyped_decorators = true
5959
plugins = "numpy.typing.mypy_plugin"
60-
files = ["pyssp/*.py"]
60+
files = ["pyssp/**.py", "tests/**.py"]

tests/test_optimal.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
""""""
1+
"""Validation implementation of optimal controllers/estimators."""
22

33
import numpy as np
44
from pyssp import optimal
55

66

7-
def test_kalman():
7+
def test_kalman() -> None:
8+
"""Validate Kalman filter (estimator) implementation."""
9+
810
av = 1
911
aw = 0.36
1012
A = 0.8
@@ -13,8 +15,9 @@ def test_kalman():
1315

1416
rng = np.random.default_rng(seed=100)
1517

18+
# because the assumption is that vn and wn (noise in observations and system) must be draw
19+
# independently from two seperate random processes
1620
rw, rv = rng.spawn(2)
17-
1821
wn = rw.normal(0, aw, N)
1922
vn = rv.normal(0, av, N)
2023

tests/test_state.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
from pyssp import state
77

88

9-
def test_convm():
9+
def test_convm() -> None:
10+
"""Given a known system, generate its convolution matrix and validate."""
1011
x = np.array([1, 2, 3])
1112
p = 4
1213

@@ -19,7 +20,8 @@ def test_convm():
1920
assert np.array_equal(expected, state.convm(x, p))
2021

2122

22-
def test_covar():
23+
def test_covar() -> None:
24+
"""Given a known system, generate its covariance matrix to validate implementation."""
2325
x = np.array([1, 2, 3])
2426
p = 4
2527

0 commit comments

Comments
 (0)