-
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.
Fix tests, bump python version to 3.11 (#29)
* fix tests * bump python version to 3.11 * fix ci * add tests for bayesian blocks
- Loading branch information
Showing
7 changed files
with
72 additions
and
23 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
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,16 @@ | ||
import unittest | ||
import numpy as np | ||
from mutis.flares.bayblocks import BayesianBlocks | ||
from mutis import Signal | ||
|
||
def test_bayblocks(): | ||
# test the bayblock algorithm with a signal that corresponds to 3 gaussian pulses in a row | ||
t = np.linspace(0, 6, 50) | ||
y = np.exp(-(t-1)**2/0.1) + np.exp(-(t-3)**2/0.1) + np.exp(-(t-5)**2/0.1) | ||
dy = 0.1 * np.abs(y) | ||
signal = Signal(t, y, dy) | ||
bayblocks = BayesianBlocks(signal, p=1e-1) | ||
bayblocks.get_flares() | ||
bayblocks.signal.plot() | ||
bayblocks.plot() | ||
assert len(bayblocks.get_flare_list()) == 3 |
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