Skip to content

Add log-transform support to SleepStatsAgreement (Euser et al. 2008) #392

Add log-transform support to SleepStatsAgreement (Euser et al. 2008)

Add log-transform support to SleepStatsAgreement (Euser et al. 2008) #392

Workflow file for this run

name: PyTest
on:
push:
branches: [master]
paths:
- 'src/**'
- 'tests/**'
- 'pyproject.toml'
pull_request:
branches: [master]
paths:
- 'src/**'
- 'tests/**'
- 'pyproject.toml'
env:
FORCE_COLOR: 1
UV_SYSTEM_PYTHON: 1
YASA_DATA_DIR: ${{ github.workspace }}/.yasa_data
jobs:
test:
strategy:
fail-fast: false
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.10", "3.11", "3.12", "3.13"]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v6
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Set up uv
uses: astral-sh/setup-uv@v7
- name: Cache sample data
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/.yasa_data
key: yasa-sample-data-14564285
- name: Install libomp (macOS)
if: ${{ matrix.platform == 'macos-latest' }}
run: brew install libomp
- name: Install dependencies
run: uv pip install --group=test ".[full]"
- name: Test with pytest
run: uv run pytest --verbose
# Test against different dependency versions
test-dependency-combinations:
strategy:
fail-fast: false
matrix:
platform: [ubuntu-latest, windows-latest]
deps:
# Minimum supported versions (as defined in pyproject.toml)
- python-version: "3.10"
numpy: "numpy==1.22.4"
scipy: "scipy==1.8.1"
pandas: "pandas==2.1.1"
mne: "mne==1.3.0"
label: "minimum-versions"
# Latest available versions (already tested above)
# - python-version: "3.13"
# numpy: "numpy"
# scipy: "scipy"
# pandas: "pandas"
# mne: "mne"
# label: "latest-versions"
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v6
- name: Set up Python ${{ matrix.deps.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.deps.python-version }}
- name: Set up uv
uses: astral-sh/setup-uv@v7
- name: Cache sample data
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/.yasa_data
key: yasa-sample-data-14564285
- name: Install setuptools (required by mne==1.3.0)
if: ${{ matrix.deps.label == 'minimum-versions' }}
run: uv pip install setuptools
- name: Install numpy (${{ matrix.deps.label }})
run: uv pip install "${{ matrix.deps.numpy }}"
- name: Install dependencies (${{ matrix.deps.label }})
run: >-
uv pip install --group=test ".[full]"
"${{ matrix.deps.scipy }}"
"${{ matrix.deps.pandas }}"
"${{ matrix.deps.mne }}"
- name: Display installed versions
run: |
python -c "import numpy; print(f'numpy: {numpy.__version__}')"
python -c "import scipy; print(f'scipy: {scipy.__version__}')"
python -c "import pandas; print(f'pandas: {pandas.__version__}')"
python -c "import mne; print(f'mne: {mne.__version__}')"
- name: Test with pytest
run: pytest --verbose
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Cache sample data
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/.yasa_data
key: yasa-sample-data-14564285
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version-file: "pyproject.toml"
- name: Set up uv
uses: astral-sh/setup-uv@v7
- name: Install dependencies
run: uv pip install --group=test ".[full]"
- name: Run tests with coverage
run: pytest --cov --cov-report=xml --verbose
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
fail_ci_if_error: true