Skip to content

Commit

Permalink
Merge pull request #3 from JanCBrammer/dev
Browse files Browse the repository at this point in the history
Version bump
  • Loading branch information
JanCBrammer authored Aug 4, 2020
2 parents 74d1342 + 7305f74 commit 040b6ce
Show file tree
Hide file tree
Showing 28 changed files with 1,077 additions and 1,658 deletions.
52 changes: 0 additions & 52 deletions .github/workflows/build.yml

This file was deleted.

35 changes: 35 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: publish
on:
release:
types: [published]


jobs:

build_publish:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Install dependencies
run: |
python -m pip install --upgrade setuptools pip wheel twine
- name: Build source and wheel
run: |
python setup.py sdist bdist_wheel
- name: Publish
# env:
# TWINE_USERNAME: ${{ secrets.TESTPYPI_USERNAME }}
# TWINE_PASSWORD: ${{ secrets.TESTPYPI_PASSWORD }}
# run: |
# twine upload --repository-url https://test.pypi.org/legacy/ dist/*
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
twine upload dist/*
147 changes: 147 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
name: test
on:
push:
branches:
- master
- dev
pull_request:
branches:
- master
- dev

jobs:

lint:

runs-on: ubuntu-latest

steps: # every step is marked with a leading hyphen (-)
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Install dependencies
run: |
python -m pip install --upgrade setuptools pip wheel
python -m pip install flake8
- name: Linting
run: |
flake8 biopeaks --exclude biopeaks/images,biopeaks/tests/testdata,biopeaks/resources.py --max-complexity=10 --ignore E303,C901,E203,W503,E501,W504,E129,W605,E371,E731
build:

needs: lint # only run if lint finishes
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Install dependencies
run: |
python -m pip install --upgrade setuptools pip wheel
- name: Build source and wheel
run: |
python setup.py sdist bdist_wheel
- name: Upload source
uses: actions/upload-artifact@v2
with:
name: source
path: dist/*.tar.gz
- name: Upload wheel
uses: actions/upload-artifact@v2
with:
name: wheel
path: dist/*.whl


test_source:

needs: build # only run if build finishes
runs-on: ${{ matrix.os }}
continue-on-error: false
strategy:
matrix: # all steps of this job will run using this matrix (matrix not accessible to other jobs)
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: [3.7, 3.8]

steps:
- uses: actions/checkout@v2
- name: Set up miniconda
uses: goanpeca/setup-miniconda@v1
with:
auto-update-conda: true
channels: conda-forge
channel-priority: strict
activate-environment: ci_env # includes pytest and pip
environment-file: environment.yml
python-version: ${{ matrix.python-version }}
auto-activate-base: false
- name: Download source
uses: actions/download-artifact@v2
with:
name: source
- name: Install source
shell: bash -l {0}
run: |
ls
pip install --no-index --find-links=. biopeaks # --no-index: do not install from PyPI, --find-links=.:search local dir for wheels or source
- name: Test with pytest on Ubuntu
if: matrix.os == 'ubuntu-latest'
shell: bash -l {0}
run: |
sudo apt-get install -y xvfb x11-utils libxkbcommon-x11-0
xvfb-run pytest -v
- name: Test with pytest on Windows and MacOS
if: matrix.os == 'windows-latest' || matrix.os == 'macos-latest'
shell: bash -l {0}
run: |
pytest -v
test_wheel:

needs: build # only run if build finishes
runs-on: ${{ matrix.os }}
continue-on-error: false
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: [3.7, 3.8]

steps:
- uses: actions/checkout@v2
- name: Set up miniconda
uses: goanpeca/setup-miniconda@v1
with:
auto-update-conda: true
channels: conda-forge
channel-priority: strict
activate-environment: ci_env
environment-file: environment.yml
python-version: ${{ matrix.python-version }}
auto-activate-base: false
- name: Download wheel
uses: actions/download-artifact@v2
with:
name: wheel
- name: Install wheel
shell: bash -l {0}
run: |
ls
pip install --no-index --find-links=. biopeaks
- name: Test with pytest on Ubuntu
if: matrix.os == 'ubuntu-latest'
shell: bash -l {0}
run: |
sudo apt-get install -y xvfb x11-utils libxkbcommon-x11-0
xvfb-run pytest -v
- name: Test with pytest on Windows and MacOS
if: matrix.os == 'windows-latest' || matrix.os == 'macos-latest'
shell: bash -l {0}
run: |
pytest -v
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ build/
dist/
__pycache__/
biopeaks/__pycache__/
biopeaks.egg-info/
biopeaks.egg-info/
.vscode/
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
![logo](docs/images/logo.png)

![](https://github.com/JanCBrammer/biopeaks/workflows/build/badge.svg?branch=dev)
![](https://github.com/JanCBrammer/biopeaks/workflows/test/badge.svg?branch=dev)

# Citation
Click on the badge below to cite `biopeaks` in a format of your choice.
Expand All @@ -13,17 +13,17 @@ Click on the badge below to cite `biopeaks` in a format of your choice.
`biopeaks` is a straightforward graphical user interface for feature extraction from electrocardiogram (ECG), photoplethysmogram (PPG) and breathing biosignals.
It processes these biosignals semi-automatically with sensible defaults and offers the following functionality:

* processes files in the open biosignal formats [EDF](https://en.wikipedia.org/wiki/European_Data_Format)
as well as [OpenSignals (Bitalino)](https://bitalino.com/en/software)
* interactive biosignal visualization
* biosignal segmentation
* benchmarked, automatic extrema detection (R-peaks in ECG, systolic peaks in PPG, exhalation troughs and inhalation
peaks in breathing signals)
* automatic state-of-the-art [artifact correction](https://www.tandfonline.com/doi/full/10.1080/03091902.2019.1640306)
+ processes files in the open biosignal formats [EDF](https://en.wikipedia.org/wiki/European_Data_Format), [OpenSignals (Bitalino)](https://bitalino.com/en/software)
as well as plain text files (.txt, .csv, .tsv)
+ interactive biosignal visualization
+ biosignal segmentation
+ benchmarked, automatic extrema detection (R-peaks in ECG, systolic peaks in PPG, exhalation troughs and inhalation
peaks in breathing signals) with signal-specific, sensible defaults
+ automatic state-of-the-art [artifact correction](https://www.tandfonline.com/doi/full/10.1080/03091902.2019.1640306)
for ECG and PPG extrema
* manual editing of extrema (useful in case of poor biosignal quality)
* calculation of instantaneous (heart- or breathing-) rate and period, as well as
breathing amplitude
* batch processing
+ manual editing of extrema
+ extraction of instantaneous features: (heart- or breathing-) rate and period, as well as breathing amplitude
+ .csv export of extrema and instantaneous features for further analysis (e.g., heart rate variability)
+ automatic analysis of multiple files (batch processing)

Visit the [documentation](https://jancbrammer.github.io/biopeaks/) for additional information.
2 changes: 1 addition & 1 deletion biopeaks.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
<qresource>
<file alias="python_icon.png">biopeaks/images/python_icon.png</file>
<file alias="mouse_icon.png">biopeaks/images/mouse_icon.png</file>
<file alias="logo.png">biopeaks/images/logo.png</file>
<file alias="file_icon.png">biopeaks/images/file_icon.png</file>
</qresource>
</RCC>
1 change: 0 additions & 1 deletion biopeaks/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,3 @@ def main():

if __name__ == '__main__':
main()

Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@

import glob
import os
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from biopeaks.heart import ecg_peaks
from wfdb.processing import compare_annotations


GUDB_dir = r"directory\containing\GUDB\subjects"
GUDB_dir = r"...\experiment_data"

os.chdir(GUDB_dir)

Expand Down
6 changes: 6 additions & 0 deletions biopeaks/benchmarks/benchmark_ECG_stream.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from biopeaks.heart import ecg_peaks
from benchmark_utils import BenchmarkDetectorGUDB


pipeline = BenchmarkDetectorGUDB(ecg_peaks, 1)
pipeline.benchmark_records("jogging", channel="cs_V2_V1", annotation="annotation_cs")
File renamed without changes.
Loading

0 comments on commit 040b6ce

Please sign in to comment.