Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 20 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,38 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["latest", "previous"]
include:
- mode: latest
- mode: previous
- mode: lowest-direct

steps:
- uses: actions/checkout@v7
with:
show-progress: false

- uses: astral-sh/setup-uv@v5
with:
cache-suffix: ${{ matrix.mode }}

- name: Install, sync, test
run: |
if [ "${{ matrix.python-version }}" = "previous" ]; then
LATEST=$(uv python list --only-downloads 2>/dev/null | grep -oP '3\.\d+' | sort -t. -k2 -n | tail -1)
PREV=$((${LATEST#3.} - 1))
if [ "${{ matrix.mode }}" = "previous" ]; then
LATEST=$(uv python list --only-downloads 2>/dev/null \
| grep -vE '3\.[0-9]+\.[0-9]+[a-z]' \
| grep -oP '^cpython-3\.\K[0-9]+' \
| sort -n | tail -1)
PREV=$((${LATEST} - 1))
uv python install "3.$PREV"
uv sync --extra test --python "3.$PREV"
uv run --python "3.$PREV" pytest -n auto --tb=short
elif [ "${{ matrix.mode }}" = "lowest-direct" ]; then
uv python install 3.11
uv pip compile pyproject.toml --resolution lowest-direct --python 3.11 -o /tmp/lowest-base.txt
uv venv --python 3.11 /tmp/lowest-venv
uv pip install --python /tmp/lowest-venv/bin/python -r /tmp/lowest-base.txt
uv pip install --python /tmp/lowest-venv/bin/python ".[test]"
/tmp/lowest-venv/bin/python -m pytest -n auto --tb=short
else
uv python install
uv sync --extra test
Expand All @@ -41,4 +56,4 @@ jobs:
with:
files: ./coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}
if: matrix.python-version == 'latest'
if: matrix.mode == 'latest'
3 changes: 2 additions & 1 deletion delaynet/detrending_methods/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@

# Extend named detrending methods with the function name
# e.g. adds "second_difference": second_difference
for method in __all_detrending__:
# Iterate in deterministic order so dict insertion order is stable across processes.
for method in sorted(__all_detrending__, key=lambda m: m.__name__):
__all_detrending_names__[method.__name__] = method

# Convenient name dict: "method.__name__": ["method", "method short", ...]
Expand Down
14 changes: 7 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ classifiers = [
dynamic = ["readme", "version"]
requires-python = ">=3.11,<3.15"
dependencies = [
"numpy",
"scipy",
"statsmodels",
"scikit-learn",
"numba",
"infomeasure>=0.5.0",
"igraph",
"numpy>=2.0.1",
"scipy>=1.13.0",
"statsmodels>=0.13.3",
"scikit-learn>=1.5.0",
"numba>=0.59.0",
"infomeasure>=0.6.2",
"igraph>=0.11.5",
"synthatdelays>=1.0.2",
]

Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def connectivity_metric_kwargs(request):

@pytest.fixture(
scope="session",
params=__all_detrending__,
params=sorted(__all_detrending__, key=lambda method: method.__name__),
)
def detrending_function(request):
"""Return a detrending function."""
Expand Down
20 changes: 10 additions & 10 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading