File tree Expand file tree Collapse file tree 3 files changed +12
-7
lines changed Expand file tree Collapse file tree 3 files changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -50,11 +50,11 @@ skip-magic-trailing-comma = false
50
50
line-ending = " auto"
51
51
52
52
[tool .mypy ]
53
- mypy_path = " pyssp "
53
+ mypy_path = " . "
54
54
ignore_missing_imports = true
55
55
disallow_incomplete_defs = true
56
56
disallow_untyped_calls = true
57
57
disallow_untyped_defs = true
58
58
disallow_untyped_decorators = true
59
59
plugins = " numpy.typing.mypy_plugin"
60
- files = [" pyssp/*.py" ]
60
+ files = [" pyssp/**.py " , " tests/** .py" ]
Original file line number Diff line number Diff line change 1
- """"""
1
+ """Validation implementation of optimal controllers/estimators. """
2
2
3
3
import numpy as np
4
4
from pyssp import optimal
5
5
6
6
7
- def test_kalman ():
7
+ def test_kalman () -> None :
8
+ """Validate Kalman filter (estimator) implementation."""
9
+
8
10
av = 1
9
11
aw = 0.36
10
12
A = 0.8
@@ -13,8 +15,9 @@ def test_kalman():
13
15
14
16
rng = np .random .default_rng (seed = 100 )
15
17
18
+ # because the assumption is that vn and wn (noise in observations and system) must be draw
19
+ # independently from two seperate random processes
16
20
rw , rv = rng .spawn (2 )
17
-
18
21
wn = rw .normal (0 , aw , N )
19
22
vn = rv .normal (0 , av , N )
20
23
Original file line number Diff line number Diff line change 6
6
from pyssp import state
7
7
8
8
9
- def test_convm ():
9
+ def test_convm () -> None :
10
+ """Given a known system, generate its convolution matrix and validate."""
10
11
x = np .array ([1 , 2 , 3 ])
11
12
p = 4
12
13
@@ -19,7 +20,8 @@ def test_convm():
19
20
assert np .array_equal (expected , state .convm (x , p ))
20
21
21
22
22
- def test_covar ():
23
+ def test_covar () -> None :
24
+ """Given a known system, generate its covariance matrix to validate implementation."""
23
25
x = np .array ([1 , 2 , 3 ])
24
26
p = 4
25
27
You can’t perform that action at this time.
0 commit comments