-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #550 from gnzng/drop-pd
Drop pandas dependencies + remove by test created files
- Loading branch information
Showing
6 changed files
with
143 additions
and
66 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
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
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,41 @@ | ||
import numpy as np | ||
from larch.math.deglitch import remove_spikes_numpy, remove_spikes_pandas, remove_spikes_scipy | ||
|
||
|
||
def test_remove_spikes_numpy(): | ||
# Input array with spikes | ||
y = np.random.random(100) | ||
y[24] = 10 | ||
y[56] = 11 | ||
|
||
# Run the function | ||
result = remove_spikes_numpy(y, window=3, threshold=3) | ||
|
||
# Check if all elements in result are smaller than 5 | ||
assert np.all(result < 5), "Test failed: spikes not detected" | ||
|
||
|
||
def test_remove_spikes_scipy(): | ||
# Input array with spikes | ||
y = np.random.random(100) | ||
y[24] = 10 | ||
y[56] = 11 | ||
|
||
# Run the function | ||
result = remove_spikes_scipy(y, window=3, threshold=3) | ||
|
||
# Check if all elements in result are smaller than 5 | ||
assert np.all(result < 5), "Test failed: spikes not detected" | ||
|
||
|
||
def test_remove_spikes_pandas(): | ||
# Input array with spikes | ||
y = np.random.random(100) | ||
y[24] = 10 | ||
y[56] = 11 | ||
|
||
# Run the function | ||
result = remove_spikes_pandas(y, window=3, threshold=3) | ||
|
||
# Check if all elements in result are smaller than 5 | ||
assert np.all(result < 5), "Test failed: spikes not detected" |
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