-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
mahdi
committed
Nov 21, 2023
1 parent
f0f4f30
commit 4c8e508
Showing
5 changed files
with
55 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
__pycache__ | ||
*.egg-info | ||
env | ||
|
||
.coverage | ||
.vscode | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,10 @@ | ||
"""The import root for the book sections.""" | ||
|
||
# import system as Chapter3 | ||
# import modeling as Chapter4 | ||
# import levinson as Chapter5 | ||
# import lattice as Chapter6 | ||
# import optimal as Chapter7 | ||
# import spectrum as Chapter8 | ||
# import adaptive as Chapter9 | ||
# import state as Appendix |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
"""Test the state module.""" | ||
|
||
|
||
import numpy as np | ||
|
||
from pyssp import state | ||
|
||
|
||
def test_convm(): | ||
x = np.array([1, 2, 3]) | ||
p = 4 | ||
|
||
expected = np.array([[1, 0, 0, 0], | ||
[2, 1, 0, 0], | ||
[3, 2, 1, 0], | ||
[0, 3, 2, 1], | ||
[0, 0, 3, 2], | ||
[0, 0, 0, 3]], dtype=float) | ||
assert np.array_equal(expected, state.convm(x, p)) | ||
|
||
|
||
def test_covar(): | ||
x = np.array([1, 2, 3]) | ||
p = 4 | ||
|
||
expected = np.array([[1, 0, -0.5, 0, 0], | ||
[0, 1, 0, -0.5, 0], | ||
[-0.5, 0, 1, 0, -0.5], | ||
[0, -0.5, 0, 1, 0], | ||
[0, 0, -0.5, 0, 1]], dtype=float) | ||
assert np.array_equal(expected, state.covar(x, p)) |