Skip to content

Commit da2db86

Browse files
use reference-based calculation for Q-on to T-off (#4)
* use reference-based calculation for Q-on to T-off * Update dependencies, add test cases, migrate to GHA --------- Co-authored-by: l-bick <43580954+l-bick@users.noreply.github.com>
1 parent 084bf8c commit da2db86

File tree

13 files changed

+414
-191
lines changed

13 files changed

+414
-191
lines changed

.github/workflows/gitlab-mirror-actions.yml

Lines changed: 0 additions & 30 deletions
This file was deleted.

.github/workflows/pipeline.yml

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
name: CI/CD Pipeline
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
workflow_dispatch:
9+
10+
jobs:
11+
test:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v4
16+
17+
- name: Set up Python 3.13
18+
uses: actions/setup-python@v5
19+
with:
20+
python-version: '3.13'
21+
22+
- name: Install dependencies
23+
run: |
24+
pip install pytest
25+
pip install .
26+
27+
- name: Run Tests
28+
run: |
29+
pytest -W ignore::DeprecationWarning test/
30+
31+
build-and-publish:
32+
needs: test
33+
runs-on: ubuntu-latest
34+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
35+
steps:
36+
- name: Checkout repository
37+
uses: actions/checkout@v4
38+
39+
- name: Set up Python 3.13
40+
uses: actions/setup-python@v5
41+
with:
42+
python-version: '3.13'
43+
44+
- name: Install build tools
45+
run: pip install twine build --upgrade
46+
47+
- name: Build Wheel
48+
run: python3 -m build
49+
50+
- name: Upload to PyPI
51+
env:
52+
TWINE_USERNAME: __token__
53+
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
54+
run: python3 -m twine upload --skip-existing dist/*
55+
56+
deploy-docs:
57+
needs: test
58+
runs-on: ubuntu-latest
59+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
60+
61+
permissions:
62+
contents: read
63+
pages: write
64+
id-token: write
65+
66+
environment:
67+
name: github-pages
68+
url: ${{ steps.deployment.outputs.page_url }}
69+
70+
steps:
71+
- name: Checkout repository
72+
uses: actions/checkout@v4
73+
74+
- name: Set up Python 3.13
75+
uses: actions/setup-python@v5
76+
with:
77+
python-version: '3.13'
78+
79+
- name: Install System Dependencies (Pandoc)
80+
run: |
81+
sudo apt-get update
82+
sudo apt-get install -y pandoc
83+
84+
- name: Install Python Dependencies
85+
run: |
86+
pip install sphinx nbsphinx nbsphinx-link ipython sphinx-rtd-theme
87+
pip install -r requirements.txt
88+
89+
- name: Build Sphinx Documentation
90+
run: |
91+
sphinx-build -M html docs/source/ docs/build/
92+
93+
- name: Upload artifact
94+
uses: actions/upload-pages-artifact@v3
95+
with:
96+
path: docs/build/html
97+
98+
- name: Deploy to GitHub Pages
99+
id: deployment
100+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
publication
2+
13
# Byte-compiled / optimized / DLL files
24
__pycache__/
35
*.py[cod]

.gitlab-ci.yml

Lines changed: 0 additions & 51 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ ecg_aligned_80bpm = normalizer.transform(ecg)
8484
Also works with a lambda function, such as 'np.std'. Default is 'none'.
8585

8686
* `detrend`: Detrend each beat individually using the robust median of slopes.
87-
This is only computed if using `agg_beat`. Default is True.
87+
This is only computed if using `agg_beat`. Default is False.
8888

8989
* `silent`: Disable all warnings. Default is True.
9090

examples/example.ipynb

Lines changed: 30 additions & 30 deletions
Large diffs are not rendered by default.

examples/example_hz.ipynb

Lines changed: 31 additions & 31 deletions
Large diffs are not rendered by default.

pyproject.toml

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,39 @@
11
[build-system]
22
build-backend = "flit_core.buildapi"
33
requires = [
4-
'flit_core >=3.8.0,<4',
5-
'neurokit2>=0.2.7',
6-
'numpy>=1.24.2',
7-
'scipy>=1.12.0',
8-
'pandas>=2.2.0',
9-
'scikit-learn>=1.4.0'
4+
'flit_core >=3.12,<4',
5+
'neurokit2>=0.2.12',
6+
'numpy>=2.0',
7+
'scipy>=1.17, <2',
8+
'pandas>=2.0',
9+
'scikit-learn>=1.8'
1010
]
1111

1212
[project]
1313
name='rlign'
14-
version='1.1'
14+
version='1.2'
1515
description='Beat normalization for ECG data.'
1616
readme = "README.md"
17-
requires-python = ">=3.10"
17+
requires-python = ">=3.11"
1818
authors=[
1919
{name="Lucas Bickmann"},
2020
{name="Lucas Plagwitz"}
2121
]
2222
dependencies = [
23-
'neurokit2>=0.2.10',
24-
'numpy>=1.24.2',
25-
'scipy>=1.12.0',
26-
'pandas>=2.2.0',
27-
'scikit-learn>=1.4.0'
23+
'neurokit2>=0.2.12',
24+
'numpy>=2.0',
25+
'scipy>=1.17, <2',
26+
'pandas>=2.0',
27+
'scikit-learn>=1.8'
2828
]
2929
classifiers=[
3030
'Intended Audience :: Science/Research',
3131
'License :: OSI Approved :: MIT License',
3232
'Operating System :: POSIX :: Linux',
3333
'Programming Language :: Python :: 3',
3434
'Programming Language :: Python :: 3.11',
35+
'Programming Language :: Python :: 3.12',
36+
'Programming Language :: Python :: 3.13',
3537
'Development Status :: 5 - Production/Stable'
3638
]
3739

requirements.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
numpy>=1.24.2
2-
neurokit2>=0.2.7
3-
scikit-learn>=1.4.0
4-
pandas>=2.2.0
5-
scipy>=1.12.0
1+
numpy>=2.2
2+
neurokit2>=0.2.10
3+
scikit-learn>=1.8
4+
pandas>=2.2
5+
scipy>=1.17<2

0 commit comments

Comments
 (0)