Skip to content

Commit 0383a4f

Browse files
Prep for 0.7.0 (major update to dependencies, tests, documentation and build infra) (#225)
* Update changelog and version * Upgrade installation + tests (from Pingouin) * add pytest matrix * Update minimal dependency version * Update changelog.rst * Update doc * Apply ruff * Fix CI * Add conftest file * Fix pandas 3.0 hypno.to_numpy() str * Bump Scipy to 1.8.1 * Fix CI pandas 3.0 * remove maxfail * Update doc workflows * Fix warnings * Fix broken links * Update doc conf and contributing * Fix remaining CI and sphinx warnings * Ran and updated all notebooks * Add Hypnogram.from_integers * fix ruff * remove filterwarning pandas4 * Update changelog * Fix broken image slow_waves.png * Added evaluation module in changelog * disable --cov in addopts to enable single running pytest on single file * Add unit tests for evaluation module * Update readme, index and quickstart * Update docs * Update quickstart and add notebook + ruff * Fix CI for shapiro if N<3 * Set 0.7.0 release date to March 2026 * Remove paypal link * Remove contribution section in FAQ * Updated changelog 0.7.0 * Fix rst in evaluation * Update README * Update workflows * Add retry in fetch_sample and cache in GH workflows * Remove legacy hypno functions from README * Improve doc * Improve doc in evaluation.py * Improve doc of class Hypnogram * Fix doctest for yasa.hypno * Fix doctest in evaluation module * ruff format
1 parent cbdba7f commit 0383a4f

48 files changed

Lines changed: 3428 additions & 2545 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/deploy_doc.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Deploy Documentation to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [master]
6+
workflow_dispatch:
7+
8+
# Cancel any in-progress job or run
9+
concurrency:
10+
group: "pages"
11+
cancel-in-progress: true
12+
13+
jobs:
14+
deploy-docs:
15+
runs-on: ubuntu-latest
16+
permissions:
17+
pages: write
18+
id-token: write
19+
environment:
20+
name: github-pages
21+
url: ${{ steps.deployment.outputs.page_url }}
22+
env:
23+
FORCE_COLOR: true
24+
UV_SYSTEM_PYTHON: 1
25+
steps:
26+
- uses: actions/checkout@v6
27+
28+
- name: Set up Python
29+
uses: actions/setup-python@v6
30+
with:
31+
python-version-file: "pyproject.toml"
32+
33+
- name: Set up uv
34+
uses: astral-sh/setup-uv@v7
35+
36+
- name: Install dependencies
37+
run: uv pip install --group=docs --editable .
38+
39+
- name: Build documentation
40+
run: |
41+
make -C docs clean
42+
make -C docs html
43+
44+
- name: Upload Pages artifact
45+
uses: actions/upload-pages-artifact@v3
46+
with:
47+
path: docs/build/html
48+
49+
- name: Deploy to GitHub Pages
50+
id: deployment
51+
uses: actions/deploy-pages@v4

.github/workflows/docs.yml

Lines changed: 31 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,38 @@
1-
# Workflow for building sphinx documentation remotely
2-
# and deploying the static HTML to a GitHub Pages site.
3-
# Note this approach does not require the static HTML
4-
# files to be stored/pushed/committed to an alternate
5-
# pages branch or anything like that. It uses GitHub Action artifacts.
6-
# https://github.com/sphinx-notes/pages
7-
name: Build and Deploy Sphinx Docs to GitHub Pages
1+
name: Build documentation and upload as artifact to GitHub Actions
82

93
on:
104
push:
11-
branches:
12-
- master
13-
release:
14-
types:
15-
- published
16-
17-
# Allows you to run this workflow manually from the Actions tab
18-
workflow_dispatch:
19-
20-
# Allow one concurrent deployment
21-
concurrency:
22-
group: "pages"
23-
cancel-in-progress: true
5+
branches: [master]
6+
pull_request:
7+
branches: [master]
248

259
jobs:
26-
deploy:
10+
docs:
2711
runs-on: ubuntu-latest
28-
environment:
29-
name: github-pages
30-
url: ${{ steps.deployment.outputs.page_url }}
31-
permissions:
32-
pages: write
33-
id-token: write
12+
env:
13+
FORCE_COLOR: true
14+
UV_SYSTEM_PYTHON: 1
3415
steps:
35-
- name: Deploy to GitHub Pages
36-
id: deployment
37-
uses: sphinx-notes/pages@v3
16+
- uses: actions/checkout@v6
17+
18+
- name: Set up Python
19+
uses: actions/setup-python@v6
20+
with:
21+
python-version-file: "pyproject.toml"
22+
23+
- name: Set up uv
24+
uses: astral-sh/setup-uv@v7
25+
26+
- name: Install dependencies
27+
run: uv pip install --group=docs --editable .
28+
29+
- name: Build documentation
30+
run: |
31+
make -C docs clean
32+
make -C docs html
33+
34+
- name: Upload documentation artifacts
35+
uses: actions/upload-artifact@v6
36+
with:
37+
name: docs-artifact
38+
path: docs/build/html

.github/workflows/python_tests.yml

Lines changed: 141 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,158 @@
1-
name: Python tests
1+
name: PyTest
22

33
on:
44
push:
55
branches: [master]
6+
paths:
7+
- 'src/**'
8+
- 'tests/**'
9+
- 'pyproject.toml'
610
pull_request:
711
branches: [master]
12+
paths:
13+
- 'src/**'
14+
- 'tests/**'
15+
- 'pyproject.toml'
16+
17+
env:
18+
FORCE_COLOR: 1
19+
UV_SYSTEM_PYTHON: 1
20+
YASA_DATA_DIR: ${{ github.workspace }}/.yasa_data
821

922
jobs:
10-
build:
23+
test:
1124
strategy:
1225
fail-fast: false
1326
matrix:
1427
platform: [ubuntu-latest, macos-latest, windows-latest]
15-
python-version: ["3.9", "3.10", "3.11", "3.12"]
28+
python-version: ["3.10", "3.11", "3.12", "3.13"]
29+
30+
runs-on: ${{ matrix.platform }}
31+
32+
steps:
33+
- uses: actions/checkout@v6
34+
35+
- name: Set up Python ${{ matrix.python-version }}
36+
uses: actions/setup-python@v6
37+
with:
38+
python-version: ${{ matrix.python-version }}
39+
40+
- name: Set up uv
41+
uses: astral-sh/setup-uv@v7
42+
43+
- name: Cache sample data
44+
uses: actions/cache@v4
45+
with:
46+
path: ${{ github.workspace }}/.yasa_data
47+
key: yasa-sample-data-14564285
48+
49+
- name: Install libomp (macOS)
50+
if: ${{ matrix.platform == 'macos-latest' }}
51+
run: brew install libomp
52+
53+
- name: Install dependencies
54+
run: uv pip install --group=test .
55+
56+
- name: Test with pytest
57+
run: uv run pytest --verbose
58+
59+
# Test against different dependency versions
60+
test-dependency-combinations:
61+
strategy:
62+
fail-fast: false
63+
matrix:
64+
platform: [ubuntu-latest, windows-latest]
65+
deps:
66+
# Minimum supported versions (as defined in pyproject.toml)
67+
- python-version: "3.10"
68+
numpy: "numpy==1.22.4"
69+
scipy: "scipy==1.8.1"
70+
pandas: "pandas==2.1.1"
71+
mne: "mne==1.3.0"
72+
numba: "numba==0.57.1"
73+
label: "minimum-versions"
74+
75+
# Latest available versions (already tested above)
76+
# - python-version: "3.13"
77+
# numpy: "numpy"
78+
# scipy: "scipy"
79+
# pandas: "pandas"
80+
# mne: "mne"
81+
# numba: "numba"
82+
# label: "latest-versions"
1683

1784
runs-on: ${{ matrix.platform }}
85+
steps:
86+
- uses: actions/checkout@v6
87+
88+
- name: Set up Python ${{ matrix.deps.python-version }}
89+
uses: actions/setup-python@v6
90+
with:
91+
python-version: ${{ matrix.deps.python-version }}
92+
93+
- name: Set up uv
94+
uses: astral-sh/setup-uv@v7
95+
96+
- name: Cache sample data
97+
uses: actions/cache@v4
98+
with:
99+
path: ${{ github.workspace }}/.yasa_data
100+
key: yasa-sample-data-14564285
101+
102+
- name: Install setuptools (required by mne==1.3.0)
103+
if: ${{ matrix.deps.label == 'minimum-versions' }}
104+
run: uv pip install setuptools
105+
106+
- name: Install numpy (${{ matrix.deps.label }})
107+
run: uv pip install "${{ matrix.deps.numpy }}"
108+
109+
- name: Install dependencies (${{ matrix.deps.label }})
110+
run: >-
111+
uv pip install --group=test .
112+
"${{ matrix.deps.scipy }}"
113+
"${{ matrix.deps.pandas }}"
114+
"${{ matrix.deps.mne }}"
115+
"${{ matrix.deps.numba }}"
18116
19-
env:
20-
FORCE_COLOR: true
117+
- name: Display installed versions
118+
run: |
119+
python -c "import numpy; print(f'numpy: {numpy.__version__}')"
120+
python -c "import scipy; print(f'scipy: {scipy.__version__}')"
121+
python -c "import pandas; print(f'pandas: {pandas.__version__}')"
122+
python -c "import mne; print(f'mne: {mne.__version__}')"
123+
python -c "import numba; print(f'numba: {numba.__version__}')"
21124
125+
- name: Test with pytest
126+
run: pytest --verbose
127+
128+
coverage:
129+
runs-on: ubuntu-latest
22130
steps:
23-
- uses: actions/checkout@v4
24-
25-
- name: Set up Python ${{ matrix.python-version }}
26-
uses: actions/setup-python@v5
27-
with:
28-
python-version: ${{ matrix.python-version }}
29-
30-
- name: Install libomp (macOS)
31-
if: ${{ matrix.platform == 'macos-latest' }}
32-
run: brew install libomp
33-
34-
- name: Install dependencies
35-
run: |
36-
python -m pip install --upgrade pip
37-
pip install ".[test]"
38-
39-
- name: Test with pytest
40-
run: |
41-
pytest --cov --cov-report=xml --verbose
42-
43-
- name: Upload coverage report
44-
if: ${{ matrix.platform == 'ubuntu-latest' && matrix.python-version == 3.9 }}
45-
uses: codecov/codecov-action@v4
46-
with:
47-
token: a58a0c62-fb11-4429-977b-65bec01ecb44
48-
file: ./coverage.xml
131+
- uses: actions/checkout@v6
132+
133+
- name: Cache sample data
134+
uses: actions/cache@v4
135+
with:
136+
path: ${{ github.workspace }}/.yasa_data
137+
key: yasa-sample-data-14564285
138+
139+
- name: Set up Python
140+
uses: actions/setup-python@v6
141+
with:
142+
python-version-file: "pyproject.toml"
143+
144+
- name: Set up uv
145+
uses: astral-sh/setup-uv@v7
146+
147+
- name: Install dependencies
148+
run: uv pip install --group=test .
149+
150+
- name: Run tests with coverage
151+
run: pytest --cov --cov-report=xml --verbose
152+
153+
- name: Upload coverage to Codecov
154+
uses: codecov/codecov-action@v5
155+
with:
156+
token: ${{ secrets.CODECOV_TOKEN }}
157+
files: ./coverage.xml
158+
fail_ci_if_error: true

.github/workflows/ruff.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
11
name: Ruff
2-
on: [push, pull_request]
2+
on:
3+
push:
4+
paths-ignore:
5+
- '*.rst'
6+
- 'docs/**'
7+
pull_request:
8+
paths-ignore:
9+
- '*.rst'
10+
- 'docs/**'
311
jobs:
412
ruff:
513
runs-on: ubuntu-latest
614
steps:
7-
- uses: actions/checkout@v4
15+
- uses: actions/checkout@v6
16+
- uses: astral-sh/setup-uv@v7
817
- name: "Linting"
9-
uses: astral-sh/ruff-action@v3
18+
run: uvx ruff check
1019
- name: "Formatting"
11-
uses: astral-sh/ruff-action@v3
12-
with:
13-
args: "format --check"
20+
run: uvx ruff format --check

0 commit comments

Comments
 (0)