-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix smoothing for current amplitude detection (#139)
- Loading branch information
Showing
2 changed files
with
33 additions
and
2 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
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 @@ | ||
from bluepyefe.ecode import tools | ||
import numpy as np | ||
from numpy.testing import assert_array_almost_equal, assert_almost_equal | ||
|
||
|
||
def test_scipy_signal2d(): | ||
np.random.seed(42) | ||
data = np.random.uniform(-1, 1, 10) | ||
res = tools.scipy_signal2d(data, 85) | ||
assert_array_almost_equal( | ||
res, | ||
[ | ||
0.2022300234864176, | ||
0.1973169683940732, | ||
0.1973169683940732, | ||
0.1973169683940732, | ||
0.1973169683940732, | ||
0.1973169683940732, | ||
0.1973169683940732, | ||
0.2022300234864176, | ||
0.2022300234864176, | ||
0.2022300234864176, | ||
], | ||
) | ||
|
||
|
||
def test_base_current(): | ||
np.random.seed(42) | ||
data = np.random.uniform(-1, 1, 10) | ||
base = tools.base_current(data) | ||
assert_almost_equal(base, 0.1973169683940732) |