Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ci.yml on push too #31

Merged
merged 34 commits into from
Dec 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
004a6ef
add mutis.flares.BayesianBlocks() class, which gives a Bayesian Block…
Nov 30, 2021
5522126
add several styles for plotting flares
Nov 30, 2021
8984e0f
add mutis.flares.Flare() class
Nov 30, 2021
5ec9f01
add Flare analysis notebook to docs, small fixes
Dec 3, 2021
e946835
small fix docs
Dec 3, 2021
916877c
use test data in flare analysis notebook
Dec 7, 2021
cae7379
add __init__ to mutis.flare folder
Dec 7, 2021
d165b88
add docstrings to flare submodule, small fix in notebook
Dec 7, 2021
bb795b7
add submodule in docs index, fix docstrings
Dec 7, 2021
61a5404
docstrings
Dec 7, 2021
2adf66a
alphabetic ordering, improve docstring
juanep97 Dec 13, 2023
ee72580
fix tests for python 3.11
juanep97 Dec 13, 2023
67567ac
bump python version to 3.11
juanep97 Dec 13, 2023
c6c1c92
fix docs
juanep97 Dec 13, 2023
0299f0a
try to fix CI
juanep97 Dec 13, 2023
e35dcf9
bump action versions
juanep97 Dec 13, 2023
5faf38f
debug actions
juanep97 Dec 13, 2023
cf92364
debug ci
juanep97 Dec 13, 2023
02961bc
debug ci
juanep97 Dec 13, 2023
42ffcfb
debug ci
juanep97 Dec 13, 2023
d0c3830
debug ci
juanep97 Dec 13, 2023
9e192de
fix ci
juanep97 Dec 13, 2023
f1a84e2
fix ci
juanep97 Dec 13, 2023
8566771
add tests for bayesian blocks
juanep97 Dec 13, 2023
b44fe4c
fix ci.yml on push too
juanep97 Dec 14, 2023
9375a23
fix ci.yml
juanep97 Dec 14, 2023
2f09cb3
Merge branch 'main' into dev
juanep97 Dec 14, 2023
00b9251
fix ci tests
juanep97 Dec 14, 2023
a636393
Merge branch 'dev' of github.com:IAA-CSIC/MUTIS into dev
juanep97 Dec 14, 2023
780b101
increase test coverage
juanep97 Dec 14, 2023
0b54c3a
try to fix nft
juanep97 Dec 14, 2023
8786829
fix nft
juanep97 Dec 14, 2023
f63074a
stop code cov from commenting on PRs
juanep97 Dec 14, 2023
1d91034
more sensible codecov targets
juanep97 Dec 14, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
comment: false

coverage:
status:
project:
default:
target: 80%
patch:
default:
target: 50%
2 changes: 0 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
- name: create and activate env
uses: conda-incubator/setup-miniconda@v3
with:
Expand Down Expand Up @@ -64,7 +63,6 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
- name: create and activate env
uses: conda-incubator/setup-miniconda@v3
with:
Expand Down
4 changes: 2 additions & 2 deletions mutis/lib/signal.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ def lc_gen_psd_nft(times, values):
compute the power spectral density and to reconstruct the
randomised signal."""

k = np.arange(-times.size // 2, times.size / 2)
n = k.size
k = np.arange(-times.size / 2, times.size / 2)
n = 2* (k.size//2)

nft = nfft.nfft_adjoint(
(times - (times.max() + times.min()) / 2) / np.ptp(times), values, n, use_fft=True
Expand Down
9 changes: 0 additions & 9 deletions mutis/signal.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,6 @@ class Signal:

def __init__(self, times, values, dvalues=None, fgen=None):

if times.dtype is not np.float64:
log.warning('times.dtype not float64, which may cause erros when using numba, casting automatically.')

if values.dtype is not np.float64:
log.warning('values.dtype not float64, which It may cause erros when using numba, casting automatically.')

if dvalues.dtype is not np.float64:
log.warning('dvalues.dtype not float64, which may cause erros when using numba, casting automatically.')

self.times = np.array(times, dtype=np.float64)
self.values = np.array(values, dtype=np.float64)
self.fgen = fgen
Expand Down
14 changes: 13 additions & 1 deletion mutis/tests/test_bayblocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,25 @@
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()

# test that the signal and the bayblocks can be plotted
bayblocks.signal.plot()
bayblocks.plot()
assert len(bayblocks.get_flare_list()) == 3

assert len(bayblocks.get_flare_list()) == 3

## test that the flares can be plotted too

for flare in bayblocks.get_flare_list():
flare.plot()
Loading