Skip to content

Update the load_data method of the database readers #269

Update the load_data method of the database readers

Update the load_data method of the database readers #269

Workflow file for this run

# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Run Test with PyTest and Codecov
on:
push:
branches: [ dev ]
pull_request:
branches: [ master ]
jobs:
build:
# Don't run on forked repos.
if: github.repository_owner == 'DeepPSP'
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v3
- name: Clear unnecessary system components
run: |
echo "Free space:"
df -h
sudo rm -rf /usr/local/lib/android # will release about 10 GB if you don't need Android
sudo rm -rf /usr/share/dotnet # will release about 20GB if you don't need .NET
sudo rm -rf /opt/ghc
sudo rm -rf /usr/local/share/boost
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- name: Install system libraries
run: |
sudo apt update
sudo apt install build-essential ffmpeg libsm6 libxext6 libsndfile1 -y
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0' # Not needed with a .ruby-version file
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'pip' # caching pip dependencies
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install -r requirements.txt
python -m pip install pytest pytest-xdist pytest-cov # Testing packages
python -m pip uninstall torch-ecg --yes # Remove if already installed
python setup.py install_egg_info # Workaround https://github.com/pypa/pip/issues/4537
python -m pip install -e .[dev]
python -m pip freeze
- name: Install nsrr and download a samll part of SHHS to do test
# ref. https://github.com/DeepPSP/nsrr-automate
run: |
gem install nsrr --no-document
nsrr download shhs/polysomnography/edfs/shhs1/ --file="^shhs1\-20010.*\.edf" --token=${{ secrets.NSRR_TOKEN }}
nsrr download shhs/polysomnography/annotations-events-nsrr/shhs1/ --file="^shhs1\-20010.*\-nsrr\.xml" --token=${{ secrets.NSRR_TOKEN }}
nsrr download shhs/polysomnography/annotations-events-profusion/shhs1/ --file="^shhs1\-20010.*\-profusion\.xml" --token=${{ secrets.NSRR_TOKEN }}
nsrr download shhs/polysomnography/annotations-rpoints/shhs1/ --file="^shhs1\-20010.*\-rpoint\.csv" --token=${{ secrets.NSRR_TOKEN }}
nsrr download shhs/datasets/ --shallow --token=${{ secrets.NSRR_TOKEN }}
nsrr download shhs/datasets/hrv-analysis/ --token=${{ secrets.NSRR_TOKEN }}
mkdir -p ~/tmp/nsrr-data/
mv shhs/ ~/tmp/nsrr-data/
du -sh ~/tmp/nsrr-data/*
- name: Run test with pytest and collect coverage
run: |
pytest -v -s \
--cov=torch_ecg \
--ignore=test/test_pipelines \
test
- name: Upload coverage to Codecov
if: matrix.python-version == '3.8'
uses: codecov/codecov-action@v3
- name: Remove downloaded NSRR data
run: |
rm -rf ~/tmp/nsrr-data/